Class: Archsight::Template
- Inherits:
-
Object
- Object
- Archsight::Template
- Defined in:
- lib/archsight/template.rb
Overview
Template generates YAML templates for architecture resources
Class Method Summary collapse
Class Method Details
.generate(kind_name) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/archsight/template.rb', line 9 def self.generate(kind_name) klass = Archsight::Resources[kind_name.to_s] raise "Unknown resource kind '#{kind_name}'" unless klass yaml = {} yaml["apiVersion"] = "architecture/v1alpha1" yaml["kind"] = kind_name yaml["metadata"] = { "name" => "TODO" } add_annotations(yaml, klass) add_relations(yaml, klass) yaml.to_yaml end |