add python compatibility module
[ccsdk/apps.git] / components / core / src / main / kotlin / org / onap / ccsdk / apps / controllerblueprints / core / data / BluePrintModel.kt
1 /*\r
2  * Copyright © 2017-2018 AT&T Intellectual Property.\r
3  * Modifications Copyright © 2018 IBM.\r
4  *\r
5  * Licensed under the Apache License, Version 2.0 (the "License");\r
6  * you may not use this file except in compliance with the License.\r
7  * You may obtain a copy of the License at\r
8  *\r
9  *     http://www.apache.org/licenses/LICENSE-2.0\r
10  *\r
11  * Unless required by applicable law or agreed to in writing, software\r
12  * distributed under the License is distributed on an "AS IS" BASIS,\r
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
14  * See the License for the specific language governing permissions and\r
15  * limitations under the License.\r
16  */\r
17 \r
18 package org.onap.ccsdk.apps.controllerblueprints.core.data\r
19 \r
20 import com.fasterxml.jackson.annotation.JsonIgnore\r
21 import com.fasterxml.jackson.annotation.JsonProperty\r
22 import com.fasterxml.jackson.databind.JsonNode\r
23 import io.swagger.annotations.ApiModelProperty\r
24 \r
25 /**\r
26  *\r
27  *\r
28  * @author Brinda Santh\r
29  */\r
30 open class EntityType {\r
31     @get:JsonIgnore\r
32     var id: String? = null\r
33     var description: String? = null\r
34     var version: String = "1.0.0"\r
35     var metadata: MutableMap<String, String>? = null\r
36     @get:JsonProperty("derived_from")\r
37     lateinit var derivedFrom: String\r
38     var attributes: MutableMap<String, AttributeDefinition>? = null\r
39     var properties: MutableMap<String, PropertyDefinition>? = null\r
40 }\r
41 \r
42 /*\r
43  5.3.2 tosca.datatypes.Credential\r
44  The Credential type is a complex TOSCA data Type used when describing\r
45  authorization credentials used to access network accessible resources.\r
46  */\r
47 class Credential {\r
48     @get:JsonIgnore\r
49     var id: String? = null\r
50     var protocol: String? = null\r
51     @get:JsonProperty("token_type")\r
52     lateinit var tokenType: String\r
53     lateinit var token: String\r
54     var keys: MutableMap<String, String>? = null\r
55     lateinit var user: String\r
56 }\r
57 \r
58 /*\r
59 3.5.2 Constraint clause\r
60 A constraint clause defines an operation along with one or more compatible values that can be used to define a constraint on a property or parameter’s allowed values when it is defined in a TOSCA Service Template or one of its entities.\r
61  */\r
62 class ConstraintClause {\r
63     @get:JsonProperty("equal")\r
64     var equal: JsonNode? = null\r
65     @get:JsonProperty("greater_than")\r
66     var greaterThan: Any? = null\r
67     @get:JsonProperty("greater_or_equal")\r
68     var greaterOrEqual: Any? = null\r
69     @get:JsonProperty("less_than")\r
70     var lessThan: Any? = null\r
71     @get:JsonProperty("less_or_equal")\r
72     var lessOrEqual: Any? = null\r
73     @get:JsonProperty("in_range")\r
74     var inRange: Any? = null\r
75     @get:JsonProperty("valid_values")\r
76     var validValues: MutableList<JsonNode>? = null\r
77     @get:JsonProperty("length")\r
78     var length: Any? = null\r
79     @get:JsonProperty("min_length")\r
80     var minLength: Any? = null\r
81     @get:JsonProperty("max_length")\r
82     var maxLength: Any? = null\r
83     var pattern: String? = null\r
84     var schema: String? = null\r
85 }\r
86 \r
87 /*\r
88 3.5.4 Node Filter definition\r
89 A node filter definition defines criteria for selection of a TOSCA Node Template based upon the template’s property values, capabilities and capability properties.\r
90  */\r
91 \r
92 class NodeFilterDefinition {\r
93     var properties: MutableMap<String, PropertyDefinition>? = null\r
94     var capabilities : MutableList<String>? = null\r
95 }\r
96 \r
97 /*\r
98 3.5.5 Repository definition\r
99  A repository definition defines a named external repository which contains deployment\r
100  and implementation artifacts that are referenced within the TOSCA Service Template.\r
101 */\r
102 class RepositoryDefinition {\r
103     @get:JsonIgnore\r
104     var id: String? = null\r
105     var description: String? = null\r
106     lateinit var url: String\r
107     var credential: Credential? = null\r
108 }\r
109 \r
110 \r
111 /*\r
112 3.5.6 Artifact definition\r
113 An artifact definition defines a named, typed file that can be associated with Node Type\r
114 or Node Template and used by orchestration engine to facilitate deployment and implementation of interface operations.\r
115  */\r
116 class ArtifactDefinition {\r
117     @get:JsonIgnore\r
118     var id: String? = null\r
119     var type: String? = null\r
120     var file: String? = null\r
121     var repository: String? = null\r
122     var description: String? = null\r
123     @get:JsonProperty("deploy_Path")\r
124     var deployPath: String? = null\r
125     var properties: MutableMap<String, JsonNode>? = null\r
126     var content: String? = null\r
127     @Deprecated("Mapping content is define by the Type")\r
128     var mappingContent: String? = null\r
129 }\r
130 \r
131 \r
132 /*\r
133 3.5.7 Import definition\r
134 An import definition is used within a TOSCA Service Template to locate and uniquely name\r
135 another TOSCA Service Template file which has type and template definitions to be imported (included)\r
136 and referenced within another Service Template.\r
137  */\r
138 class ImportDefinition {\r
139     @get:JsonIgnore\r
140     var id: String? = null\r
141     lateinit var file: String\r
142     var repository: String? = null\r
143     @get:JsonProperty("namespace_uri")\r
144     var namespaceUri: String? = null\r
145     @get:JsonProperty("namespace_prefix")\r
146     var namespacePrefix: String? = null\r
147 }\r
148 \r
149 /*\r
150 3.5.8 Property definition A property definition defines a named, typed value and related data that can be associated with an\r
151 entity defined in this specification (e.g., Node Types, Relationship Types, Capability Types, etc.).\r
152 Properties are used by template authors to provide input values to TOSCA entities which indicate their “desired state” when they are\r
153 instantiated. The value of a property can be retrieved using the get_property function within TOSCA Service Templates.\r
154  */\r
155 class PropertyDefinition {\r
156     @get:JsonIgnore\r
157     var id: String? = null\r
158     var description: String? = null\r
159     var required: Boolean? = null\r
160     lateinit var type: String\r
161     @get:JsonProperty("default")\r
162     var defaultValue: JsonNode? = null\r
163     var status: String? = null\r
164     var constraints: MutableList<ConstraintClause>? = null\r
165     @get:JsonProperty("entry_schema")\r
166     var entrySchema: EntrySchema? = null\r
167     @get:ApiModelProperty(notes = "Property Value, It may be raw JSON or primitive data type values")\r
168     var value: JsonNode? = null\r
169 }\r
170 \r
171 \r
172 /*\r
173 3.5.10 Attribute definition\r
174 \r
175 An attribute definition defines a named, typed value that can be associated with an entity defined in this\r
176 specification (e.g., a Node, Relationship or Capability Type).  Specifically, it is used to expose the\r
177 “actual state” of some property of a TOSCA entity after it has been deployed and instantiated\r
178 (as set by the TOSCA orchestrator). Attribute values can be retrieved via the get_attribute function\r
179 from the instance model and used as values to other entities within TOSCA Service Templates.\r
180  */\r
181 \r
182 class AttributeDefinition {\r
183     @get:JsonIgnore\r
184     var id: String? = null\r
185     var description: String? = null\r
186     lateinit var type: String\r
187     @JsonProperty("default")\r
188     var defaultValue: JsonNode? = null\r
189     var status: String? = null\r
190     @JsonProperty("entry_schema")\r
191     var entrySchema: String? = null\r
192 }\r
193 \r
194 /*\r
195 3.5.13 Operation definition\r
196 An operation definition defines a named function or procedure that can be bound to an implementation artifact (e.g., a script).\r
197  */\r
198 class OperationDefinition {\r
199     @get:JsonIgnore\r
200     var id: String? = null\r
201     var description: String? = null\r
202     var implementation: Implementation? = null\r
203     var inputs: MutableMap<String, PropertyDefinition>? = null\r
204     var outputs: MutableMap<String, PropertyDefinition>? = null\r
205 }\r
206 \r
207 class Implementation {\r
208     lateinit var primary: String\r
209     var dependencies: MutableList<String>? = null\r
210 }\r
211 \r
212 /*\r
213 3.5.14 Interface definition\r
214 An interface definition defines a named interface that can be associated with a Node or Relationship Type\r
215  */\r
216 class InterfaceDefinition {\r
217     @get:JsonIgnore\r
218     var id: String? = null\r
219     var type: String? = null\r
220     var operations: MutableMap<String, OperationDefinition>? = null\r
221     var inputs: MutableMap<String, PropertyDefinition>? = null\r
222 }\r
223 \r
224 /*\r
225 3.5.15 Event Filter definition\r
226 An event filter definition defines criteria for selection of an attribute, for the purpose of monitoring it, within a TOSCA entity, or one its capabilities.\r
227  */\r
228 class EventFilterDefinition {\r
229     @get:JsonIgnore\r
230     var id: String? = null\r
231     lateinit var node: String\r
232     var requirement: String? = null\r
233     var capability: String? = null\r
234 }\r
235 \r
236 /*\r
237 3.5.16 Trigger definition TODO\r
238 A trigger definition defines the event, condition and action that is used to “trigger” a policy it is associated with.\r
239  */\r
240 class TriggerDefinition {\r
241     @get:JsonIgnore\r
242     var id: String? = null\r
243     var description: String? = null\r
244     @get:JsonProperty("event_type")\r
245     lateinit var eventType: String\r
246     @get:JsonProperty("target_filter")\r
247     var targetFilter: EventFilterDefinition? = null\r
248     var condition: ConditionClause? = null\r
249     var constraint: ConditionClause? = null\r
250     var method: String? = null\r
251     lateinit var action: String\r
252 }\r
253 \r
254 /*\r
255     3.5.17 Workflow activity definition\r
256     A workflow activity defines an operation to be performed in a TOSCA workflow. Activities allows to:\r
257     · Delegate the workflow for a node expected to be provided         by the orchestrator\r
258     · Set the state of a node\r
259     · Call an operation        defined on a TOSCA interface of a node, relationship or group\r
260     · Inline another workflow defined in the topology (to allow reusability)\r
261  */\r
262 class Activity {\r
263     var delegate: String? = null\r
264     @get:JsonProperty("set_state")\r
265     var setState: String? = null\r
266     @get:JsonProperty("call_operation")\r
267     var callOperation: String? = null\r
268     var inlines: ArrayList<String>? = null\r
269 }\r
270 \r
271 /*\r
272 3.5.20 Workflow precondition definition\r
273 A workflow condition can be used as a filter or precondition to check if a workflow can be processed or not based on the state of the instances of a TOSCA topology deployment. When not met, the workflow will not be triggered.\r
274  */\r
275 class PreConditionDefinition {\r
276     @get:JsonIgnore\r
277     var id: String? = null\r
278     lateinit var target: String\r
279     @get:JsonProperty("target_relationship")\r
280     lateinit var targetRelationship: String\r
281     lateinit var condition: ArrayList<ConditionClause>\r
282 }\r
283 \r
284 /*\r
285 3.5.21 Workflow step definition\r
286 A workflow step allows to define one or multiple sequenced activities in a workflow and how they are connected to other steps in the workflow. They are the building blocks of a declarative workflow.\r
287  */\r
288 class Step {\r
289     @get:JsonIgnore\r
290     var id: String? = null\r
291     var description: String? = null\r
292     var target: String? = null\r
293     @JsonProperty("target_relationship")\r
294     var targetRelationship: String? = null\r
295     @JsonProperty("operation_host")\r
296     var operationHost: String? = null\r
297     var activities: ArrayList<Activity>? = null\r
298     @get:JsonProperty("on_success")\r
299     var onSuccess: ArrayList<String>? = null\r
300     @get:JsonProperty("on_failure")\r
301     var onFailure: ArrayList<String>? = null\r
302 }\r
303 \r
304 /*\r
305 3.6.2 Capability definition\r
306 A capability definition defines a named, typed set of data that can be associated with Node Type or Node Template to describe a transparent capability or feature of the software component the node describes.\r
307  */\r
308 \r
309 class CapabilityDefinition {\r
310     @get:JsonIgnore\r
311     var id: String? = null\r
312     lateinit var type: String\r
313     var description: String? = null\r
314     var properties: MutableMap<String, PropertyDefinition>? = null\r
315     @get:JsonProperty("valid_source_types")\r
316     var validSourceTypes: MutableList<String>? = null\r
317     var occurrences: MutableList<Any>? = null\r
318 }\r
319 \r
320 /*\r
321 3.6.3 Requirement definition\r
322 The Requirement definition describes a named requirement (dependencies) of a TOSCA Node Type or Node template which needs to be fulfilled by a matching Capability definition declared by another TOSCA modelable entity.  The requirement definition may itself include the specific name of the fulfilling entity (explicitly) or provide an abstract type, along with additional filtering characteristics, that a TOSCA orchestrator can use to fulfill the capability at runtime (implicitly).\r
323  */\r
324 class RequirementDefinition {\r
325     @get:JsonIgnore\r
326     var id: String? = null\r
327     var description: String? = null\r
328     var capability: String? = null\r
329     var node: String? = null\r
330     var relationship: String? = null\r
331     var occurrences: MutableList<Any>? = null\r
332 }\r
333 \r
334 /*\r
335 3.6.4 Artifact Type\r
336 An Artifact Type is a reusable entity that defines the type of one or more files that are used to define implementation or deployment artifacts that are referenced by nodes or relationships on their operations.\r
337  */\r
338 class ArtifactType : EntityType() {\r
339     @get:JsonProperty("mime_type")\r
340     var mimeType: String? = null\r
341     @get:JsonProperty("file_ext")\r
342     var fileExt: MutableList<String>? = null\r
343 \r
344 }\r
345 \r
346 /*\r
347 3.6.6 Data Type\r
348 A Data Type definition defines the schema for new named datatypes in TOSCA.\r
349  */\r
350 \r
351 class DataType : EntityType(){\r
352     var constraints: MutableList<ConstraintClause>? = null\r
353 }\r
354 \r
355 /*\r
356 3.6.9 Node Type\r
357 A Node Type is a reusable entity that defines the type of one or more Node Templates. As such, a Node Type defines the structure of observable properties via a Properties Definition, the Requirements and Capabilities of the node as well as its supported interfaces.\r
358 \r
359  */\r
360 \r
361 class NodeType : EntityType() {\r
362     var capabilities: MutableMap<String, CapabilityDefinition>? = null\r
363     var requirements: MutableMap<String, RequirementDefinition>? = null\r
364     var interfaces: MutableMap<String, InterfaceDefinition>? = null\r
365     var artifacts: MutableMap<String, ArtifactDefinition>? = null\r
366 }\r
367 \r
368 /*\r
369 3.6.8 Requirement Type\r
370 A Requirement Type is a reusable entity that describes a kind of requirement that a Node Type can declare to expose.  The TOSCA Simple Profile seeks to simplify the need for declaring specific Requirement Types from nodes and instead rely upon nodes declaring their features sets using TOSCA Capability Types along with a named Feature notation.\r
371  */\r
372 \r
373 class RequirementType : EntityType() {\r
374     var requirements: MutableMap<String, RequirementDefinition>? = null\r
375     var capabilities: MutableMap<String, CapabilityDefinition>? = null\r
376     var interfaces: MutableMap<String, InterfaceDefinition>? = null\r
377     var artifacts: MutableMap<String, ArtifactDefinition>? = null\r
378 }\r
379 \r
380 /*\r
381 3.6.10 Relationship Type\r
382 A Relationship Type is a reusable entity that defines the type of one or more relationships between Node Types or Node Templates.\r
383 */\r
384 \r
385 class RelationshipType : EntityType() {\r
386     var interfaces: MutableMap<String, InterfaceDefinition>? = null\r
387     @get:JsonProperty("valid_target_types")\r
388     var validTargetTypes: ArrayList<String>? = null\r
389 }\r
390 \r
391 /*\r
392 3.6.11 Group Type\r
393 A Group Type defines logical grouping types for nodes, typically for different management purposes.\r
394 Groups can effectively be viewed as logical nodes that are not part of the physical deployment topology\r
395  of an application, yet can have capabilities and the ability to attach policies and interfaces\r
396  that can be applied (depending on the group type) to its member nodes.\r
397  */\r
398 \r
399 class GroupType : EntityType() {\r
400     var members: MutableList<String>? = null\r
401     var requirements: ArrayList<RequirementDefinition>? = null\r
402     var capabilities: MutableMap<String, CapabilityDefinition>? = null\r
403     var interfaces: MutableMap<String, InterfaceDefinition>? = null\r
404 \r
405 }\r
406 \r
407 /*\r
408     3.6.12 Policy Type\r
409     A Policy Type defines a type of requirement that affects or governs an application or service’s\r
410     topology at some stage of its lifecycle, but is not explicitly part of the topology itself\r
411     (i.e., it does not prevent the application or service from being deployed or run if it did not exist).\r
412  */\r
413 class PolicyType : EntityType(){\r
414     lateinit var targets: MutableList<String>\r
415 }\r
416 \r
417 /*\r
418 3.7.1 Capability assignment\r
419 A capability assignment allows node template authors to assign values to properties and attributes for a named capability definition that is part of a Node Template’s type definition.\r
420  */\r
421 class CapabilityAssignment {\r
422     @get:JsonIgnore\r
423     var id: String? = null\r
424     var attributes: MutableMap<String, JsonNode>? = null\r
425     var properties: MutableMap<String, JsonNode>? = null\r
426 }\r
427 \r
428 /*\r
429 3.7.4 Relationship Template\r
430 A Relationship Template specifies the occurrence of a manageable relationship between node templates as part of an application’s topology model that is defined in a TOSCA Service Template.  A Relationship template is an instance of a specified Relationship Type and can provide customized properties, constraints or operations which override the defaults provided by its Relationship Type and its implementations.\r
431  */\r
432 class GroupDefinition {\r
433     @get:JsonIgnore\r
434     var id: String? = null\r
435     lateinit var type: String\r
436     var description: String? = null\r
437     var metadata : MutableMap<String, String>? = null\r
438     var properties : MutableMap<String, JsonNode>? = null\r
439     var members = ArrayList<String>()\r
440     var interfaces : MutableMap<String, InterfaceDefinition>?= null\r
441 }\r
442 \r
443 /*\r
444 3.7.6 Policy definition\r
445 A policy definition defines a policy that can be associated with a TOSCA topology or top-level entity definition (e.g., group definition, node template, etc.).\r
446  */\r
447 class PolicyDefinition {\r
448     @get:JsonIgnore\r
449     var id: String? = null\r
450     lateinit var type: String\r
451     var description: String? = null\r
452     var metadata: MutableMap<String, String>? = null\r
453     var properties: MutableMap<String, JsonNode>? = null\r
454     var targets: MutableList<String>? = null\r
455 }\r
456 \r
457 \r
458 /*\r
459 3.8 Topology Template definition\r
460 This section defines the topology template of a cloud application. The main ingredients of the topology template are node templates representing components of the application and relationship templates representing links between the components. These elements are defined in the nested node_templates section and the nested relationship_templates sections, respectively.  Furthermore, a topology template allows for defining input parameters, output parameters as well as grouping of node templates.\r
461  */\r
462 class TopologyTemplate {\r
463     @get:JsonIgnore\r
464     var id: String? = null\r
465     var description: String? = null\r
466     var inputs: MutableMap<String, PropertyDefinition>? = null\r
467     @get:JsonProperty("node_templates")\r
468     var nodeTemplates: MutableMap<String, NodeTemplate>? = null\r
469     @get:JsonProperty("relationship_templates")\r
470     var relationshipTemplates: MutableMap<String, RelationshipTemplate>? = null\r
471     var policies: MutableMap<String, PolicyDefinition>? = null\r
472     var outputs: MutableMap<String, PropertyDefinition>? = null\r
473     @get:JsonProperty("substitution_mappings")\r
474     var substitutionMappings: Any? = null\r
475     var workflows: MutableMap<String, Workflow>? = null\r
476 }\r
477 \r
478 class SubstitutionMapping {\r
479     @get:JsonProperty("node_type")\r
480     lateinit var nodeType: String\r
481     lateinit var capabilities: ArrayList<String>\r
482     lateinit var requirements: ArrayList<String>\r
483 }\r
484 \r
485 class EntrySchema {\r
486     lateinit var type: String\r
487     var constraints: MutableList<ConstraintClause>? = null\r
488 }\r
489 \r
490 class InterfaceAssignment {\r
491     @get:JsonIgnore\r
492     var id: String? = null\r
493     var operations: MutableMap<String, OperationAssignment>? = null\r
494     var inputs: MutableMap<String, JsonNode>? = null\r
495 }\r
496 \r
497 /*\r
498 3.7.3 Node Template\r
499 A Node Template specifies the occurrence of a manageable software component as part of an application’s topology model which is defined in a TOSCA Service Template.  A Node template is an instance of a specified Node Type and can provide customized properties, constraints or operations which override the defaults provided by its Node Type and its implementations.\r
500  */\r
501 \r
502 class NodeTemplate {\r
503     @get:JsonIgnore\r
504     var id: String? = null\r
505     var description: String? = null\r
506     lateinit var type: String\r
507     var metadata: MutableMap<String, String>? = null\r
508     var directives: MutableList<String>? = null\r
509     //@get:JsonSerialize(using = PropertyDefinitionValueSerializer::class)\r
510     var properties: MutableMap<String, JsonNode>? = null\r
511     var attributes: MutableMap<String, JsonNode>? = null\r
512     var capabilities: MutableMap<String, CapabilityAssignment>? = null\r
513     var requirements: MutableMap<String, RequirementAssignment>? = null\r
514     var interfaces: MutableMap<String, InterfaceAssignment>? = null\r
515     var artifacts: MutableMap<String, ArtifactDefinition>? = null\r
516     @get:JsonProperty("node_filter")\r
517     var nodeFilter: NodeFilterDefinition? = null\r
518     var copy: String? = null\r
519 }\r
520 \r
521 class OperationAssignment {\r
522     @get:JsonIgnore\r
523     var id: String? = null\r
524     var description: String? = null\r
525     var implementation: Implementation? = null\r
526     var inputs: MutableMap<String, JsonNode>? = null\r
527     var outputs: MutableMap<String, JsonNode>? = null\r
528 }\r
529 \r
530 /*\r
531 3.7.4 Relationship Template\r
532 A Relationship Template specifies the occurrence of a manageable relationship between node templates as part of an application’s topology model that is defined in a TOSCA Service Template.  A Relationship template is an instance of a specified Relationship Type and can provide customized properties, constraints or operations which override the defaults provided by its Relationship Type and its implementations.\r
533  */\r
534 \r
535 class RelationshipTemplate {\r
536     var type: String? = null\r
537     var description: String? = null\r
538     var metadata: MutableMap<String, String>? = null\r
539     var properties: MutableMap<String, PropertyDefinition>? = null\r
540     var attributes: MutableMap<String, JsonNode>? = null\r
541     var interfaces: MutableMap<String, InterfaceDefinition>? = null\r
542     var copy: String? = null\r
543 }\r
544 \r
545 /*\r
546 3.7.2 Requirement assignment\r
547 A Requirement assignment allows template authors to provide either concrete names of TOSCA templates or provide abstract selection criteria for providers to use to find matching TOSCA templates that are used to fulfill a named requirement’s declared TOSCA Node Type.\r
548  */\r
549 \r
550 class RequirementAssignment {\r
551     @get:JsonIgnore\r
552     var id: String? = null\r
553     var capability: String? = null\r
554     var node: String? = null\r
555     //Relationship Type or Relationship Template\r
556     var relationship: String? = null\r
557 }\r
558 \r
559 \r
560 class Workflow {\r
561     @get:JsonIgnore\r
562     var id: String? = null\r
563     var description: String? = null\r
564     var steps: MutableMap<String, Step>? = null\r
565     var preconditions: ArrayList<PreConditionDefinition>? = null\r
566     var inputs: MutableMap<String, PropertyDefinition>? = null\r
567 }\r
568 \r
569 \r
570 class ConditionClause {\r
571     var and: ArrayList<MutableMap<String, Any>>? = null\r
572     var or: ArrayList<MutableMap<String, Any>>? = null\r
573     @get:JsonProperty("assert")\r
574     var assertConditions: ArrayList<MutableMap<String, Any>>? = null\r
575 }\r
576 \r
577 /*\r
578 3.9 Service Template definition\r
579 A TOSCA Service Template (YAML) document contains element definitions of building blocks for cloud application, or complete models of cloud applications. This section describes the top-level structural elements (TOSCA keynames) along with their grammars, which are allowed to appear in a TOSCA Service Template document.\r
580  */\r
581 \r
582 class ServiceTemplate {\r
583     @get:JsonIgnore\r
584     var id: String? = null\r
585     @get:JsonProperty("tosca_definitions_version")\r
586     var toscaDefinitionsVersion: String = "controller_blueprint_1_0_0"\r
587     var metadata: MutableMap<String, String>? = null\r
588     var description: String? = null\r
589     @get:JsonProperty("dsl_definitions")\r
590     var dslDefinitions: MutableMap<String, Any>? = null\r
591     var repositories: MutableMap<String, RepositoryDefinition>? = null\r
592     var imports: MutableList<ImportDefinition>? = null\r
593     @get:JsonProperty("artifact_types")\r
594     var artifactTypes: MutableMap<String, ArtifactType>? = null\r
595     @get:JsonProperty("data_types")\r
596     var dataTypes: MutableMap<String, DataType>? = null\r
597     @get:JsonProperty("node_types")\r
598     var nodeTypes: MutableMap<String, NodeType>? = null\r
599     @get:JsonProperty("policy_types")\r
600     var policyTypes: PolicyType? = null\r
601     @get:JsonProperty("topology_template")\r
602     var topologyTemplate: TopologyTemplate? = null\r
603 }\r
604 \r
605 class ToscaMetaData {\r
606     lateinit var toscaMetaFileVersion: String\r
607     lateinit var csarVersion: String\r
608     lateinit var createdBy: String\r
609     lateinit var entityDefinitions: String\r
610     var templateTags: String? = null\r
611 }\r
612 \r