Fix the transform-templating for referenced complex types
[ccsdk/cds.git] / components / model-catalog / blueprint-model / test-blueprint / baseconfiguration / Definitions / activation-blueprint.json
1 {
2   "metadata": {
3     "template_author": "Brinda Santh Muthuramalingam",
4     "author-email": "brindasanth@in.ibm.com",
5     "user-groups": "ADMIN, OPERATION",
6     "template_name": "baseconfiguration",
7     "template_version": "1.0.0",
8     "template_tags": "brinda, tosca"
9   },
10   "imports": [
11     {
12       "file": "Definitions/data_types.json"
13     },
14     {
15       "file": "Definitions/relationship_types.json"
16     },
17     {
18       "file": "Definitions/artifact_types.json"
19     },
20     {
21       "file": "Definitions/node_types.json"
22     },
23     {
24       "file": "Definitions/policy_types.json"
25     }
26   ],
27   "dsl_definitions": {
28     "dynamic-netconf-properties": {
29       "device-name": "netconf device",
30       "host-name": "sample-host"
31     },
32     "dynamic-rest-source": {
33       "type": "basic-type",
34       "url": "http://localhost:8080",
35       "userId": {
36         "get_input": "rest-user-name"
37       }
38     },
39     "dynamic-db-source": {
40       "type": "maria-db",
41       "url": "jdbc:mysql://localhost:3306/sdnctl",
42       "username": "sdnctl",
43       "password": {
44         "get_attribute": [
45           "BPP",
46           "dynamic-db-source.password"
47         ]
48       }
49     }
50   },
51   "topology_template": {
52     "inputs": {
53       "request-id": {
54         "required": true,
55         "type": "string"
56       },
57       "action-name": {
58         "required": true,
59         "type": "string"
60       },
61       "scope-type": {
62         "required": true,
63         "type": "string"
64       },
65       "hostname": {
66         "required": true,
67         "type": "string"
68       }
69     },
70     "node_templates": {
71       "resource-assignment-process": {
72         "type": "dg-generic",
73         "properties": {
74           "content": {
75             "get_artifact": [
76               "SELF",
77               "dg-resource-assignment-process"
78             ]
79           },
80           "dependency-node-templates": [
81             "resource-assignment"
82           ]
83         },
84         "artifacts": {
85           "dg-resource-assignment-process": {
86             "type": "artifact-directed-graph",
87             "file": "Plans/CONFIG_ResourceAssignment_1.0.0.xml"
88           }
89         }
90       },
91       "activate-process": {
92         "type": "dg-generic",
93         "properties": {
94           "content": {
95             "get_artifact": [
96               "SELF",
97               "dg-activate-process"
98             ]
99           },
100           "dependency-node-templates": [
101             "activate-jython"
102           ]
103         },
104         "artifacts": {
105           "dg-activate-process": {
106             "type": "artifact-directed-graph",
107             "file": "Plans/CONFIG_ActivateNetconf_1.0.0.xml"
108           }
109         }
110       },
111       "assign-activate-process": {
112         "type": "dg-generic",
113         "properties": {
114           "content": {
115             "get_artifact": [
116               "SELF",
117               "dg-assign-activate-process"
118             ]
119           },
120           "dependency-node-templates": [
121             "resource-assignment",
122             "activate-jython"
123           ]
124         },
125         "artifacts": {
126           "dg-assign-activate-process": {
127             "type": "artifact-directed-graph",
128             "file": "Plans/CONFIG_AssignActivateNetconf_1.0.0.xml"
129           }
130         }
131       },
132       "resource-assignment": {
133         "type": "component-resource-resolution",
134         "interfaces": {
135           "ResourceResolutionComponent": {
136             "operations": {
137               "process": {
138                 "inputs": {
139                   "action-name": {
140                     "get_input": "action-name"
141                   },
142                   "resource-type": "vnf-type",
143                   "request-id": {
144                     "get_input": "request-id"
145                   },
146                   "resource-id": {
147                     "get_input": "hostname"
148                   },
149                   "artifact-prefix-names": [
150                     "baseconfig"
151                   ]
152                 },
153                 "outputs": {
154                   "resource-assignment-params": {
155                     "get_attribute": [
156                       "SELF",
157                       "assignment-params"
158                     ]
159                   },
160                   "status": "success"
161                 }
162               }
163             }
164           }
165         },
166         "artifacts": {
167           "baseconfig-template": {
168             "type": "artifact-template-velocity",
169             "file": "Templates/baseconfig-template.vtl"
170           },
171           "baseconfig-mapping": {
172             "type": "artifact-mapping-resource",
173             "file": "Definitions/baseconfig-mapping.json"
174           },
175           "another-template": {
176             "type": "artifact-template-jinja",
177             "file": "Templates/another-template.jinja"
178           },
179           "another-mapping": {
180             "type": "artifact-mapping-resource",
181             "file": "Definitions/another-mapping.json"
182           },
183           "maxoccurrence-template": {
184             "type": "artifact-template-velocity",
185             "file": "Templates/maxoccurrence-template.vtl"
186           },
187           "maxoccurrence-mapping": {
188             "type": "artifact-mapping-resource",
189             "file": "Definitions/maxoccurrence-mapping.json"
190           },
191           "transform-template": {
192             "type": "artifact-template-velocity",
193             "file": "Templates/baseconfig-template.vtl"
194           },
195           "transform-mapping": {
196             "type": "artifact-mapping-resource",
197             "file": "Definitions/transform-mapping.json"
198           },
199           "notemplate-mapping": {
200             "type": "artifact-mapping-resource",
201             "file": "Definitions/notemplate-mapping.json"
202           }
203         }
204       },
205       "resource-assignment-py": {
206         "type": "component-resource-resolution",
207         "interfaces": {
208           "ResourceResolutionComponent": {
209             "operations": {
210               "process": {
211                 "implementation": {
212                   "primary": "component-script"
213                 },
214                 "inputs": {
215                   "action-name": {
216                     "get_input": "action-name"
217                   }
218                 },
219                 "outputs": {
220                   "resource-assignment-params": "",
221                   "status": ""
222                 }
223               }
224             }
225           }
226         },
227         "artifacts": {
228           "component-script": {
229             "type": "artifact-script-jython",
230             "file": "Scripts/python/SamplePythonComponentNode.py"
231           }
232         }
233       },
234       "activate-jython": {
235         "type": "component-jython-executor",
236         "interfaces": {
237           "ComponentJythonExecutor": {
238             "operations": {
239               "process": {
240                 "implementation": {
241                   "primary": "component-script"
242                 },
243                 "inputs": {
244                   "instance-dependencies": [
245                     "json-parser-service"
246                   ]
247                 },
248                 "outputs": {
249                   "response-data": "",
250                   "status": ""
251                 }
252               }
253             }
254           }
255         },
256         "artifacts": {
257           "component-script": {
258             "type": "artifact-script-jython",
259             "file": "Scripts/python/SamplePythonComponentNode.py"
260           }
261         }
262       },
263       "activate-netconf": {
264         "type": "component-netconf-executor",
265         "interfaces": {
266           "ComponentNetconfExecutor": {
267             "operations": {
268               "process": {
269                 "implementation": {
270                   "primary": "component-script"
271                 },
272                 "inputs": {
273                   "script-type": "jython",
274                   "script-class-reference": "Scripts/python/NetconfRpcExample.py",
275                   "instance-dependencies": [
276                   ],
277                   "dynamic-properties": "*dynamic-netconf-properties"
278                 },
279                 "outputs": {
280                   "response-data": "",
281                   "status": ""
282                 }
283               }
284             }
285           }
286         },
287         "requirements": {
288           "netconf-connection": {
289             "capability": "netconf",
290             "node": "sample-netconf-device",
291             "relationship": "tosca.relationships.ConnectsTo"
292           }
293         },
294         "artifacts": {
295           "hostname-template": {
296             "type": "artifact-template-velocity",
297             "file": "Templates/hostname-template.vtl"
298           },
299           "hostname-mapping": {
300             "type": "artifact-mapping-resource",
301             "file": "Definitions/hostname-mapping.json"
302           },
303           "component-script": {
304             "type": "artifact-script-jython",
305             "file": "Scripts/python/NetconfRpcExample.py"
306           }
307         }
308       },
309       "activate-restconf": {
310         "type": "component-script-executor",
311         "interfaces": {
312           "ComponentScriptExecutor": {
313             "operations": {
314               "process": {
315                 "implementation": {
316                   "primary": "component-script"
317                 },
318                 "inputs": {
319                   "script-type": "kotlin",
320                   "script-class-reference": "DefaultRestconf_cba$MountNEditConfigure"
321                 },
322                 "outputs": {
323                   "response-data": "",
324                   "status": "success"
325                 }
326               }
327             }
328           }
329         }
330       },
331       "activate-cli": {
332         "type": "component-script-executor",
333         "interfaces": {
334           "ComponentScriptExecutor": {
335             "operations": {
336               "process": {
337                 "implementation": {
338                   "primary": "component-script"
339                 },
340                 "inputs": {
341                   "script-type": "internal",
342                   "script-class-reference": "internal.scripts.TestCliScriptFunction"
343                 },
344                 "outputs": {
345                   "response-data": "",
346                   "status": "success"
347                 }
348               }
349             }
350           }
351         }
352       },
353       "sample-netconf-device": {
354         "type": "vnf-netconf-device",
355         "capabilities": {
356           "netconf": {
357             "properties": {
358               "login-key": "sample-key",
359               "login-account": "sample-account",
360               "target-ip-address": {
361                 "get_attribute": [
362                   "resource-assignment",
363                   "",
364                   "assignment-params",
365                   "$.ipAddress"
366                 ]
367               },
368               "port-number": 830,
369               "connection-time-out": 30
370             }
371           }
372         }
373       }
374     },
375     "relationship_templates": {
376       "cli-device-properties": {
377         "type": "tosca.relationships.ConnectsTo.SshClient",
378         "description": "SSH Connection",
379         "properties": {
380           "connection-config": {
381             "password": "sample-password",
382             "host": {
383               "get_input": "hostname"
384             },
385             "type": "basic-auth",
386             "connectionTimeOut": 30,
387             "username": "sample-user"
388           }
389         }
390       }
391     },
392     "workflows": {
393       "resource-assignment": {
394         "inputs": {
395           "resource-assignment-properties": {
396             "required": true,
397             "type": "dt-resource-assignment-properties"
398           }
399         },
400         "steps": {
401           "call-resource-assignment": {
402             "description": "Resource Assignment Workflow",
403             "target": "resource-assignment-process",
404             "activities": [
405               {
406                 "call_operation": "CONFIG.ResourceAssignment"
407               }
408             ]
409           }
410         },
411         "outputs": {
412           "response-property": {
413             "type": "string",
414             "value": "executed"
415           },
416           "template-properties": {
417             "type": "json",
418             "value": {
419               "get_attribute": [
420                 "resource-assignment",
421                 "assignment-params"
422               ]
423             }
424           }
425         }
426       },
427       "activate": {
428         "inputs": {
429           "request-id": {
430             "required": true,
431             "type": "string"
432           },
433           "action-name": {
434             "required": true,
435             "type": "string"
436           },
437           "scope-type": {
438             "required": true,
439             "type": "string"
440           },
441           "hostname": {
442             "required": true,
443             "type": "string"
444           }
445         },
446         "steps": {
447           "activate-process": {
448             "description": "Netconf Activation Workflow",
449             "target": "activate-process",
450             "activities": [
451               {
452                 "call_operation": "CONFIG.ActivateProcess"
453               }
454             ]
455           }
456         }
457       },
458       "activate-restconf": {
459         "steps": {
460           "activate-process": {
461             "description": "Activate Restconf flow",
462             "target": "activate-restconf",
463             "activities": [
464               {
465                 "call_operation": "ComponentRestconfExecutor.process"
466               }
467             ]
468           }
469         }
470       },
471       "activate-cli": {
472         "steps": {
473           "activate-process": {
474             "description": "Activate CLI flow",
475             "target": "activate-cli",
476             "activities": [
477               {
478                 "call_operation": "ComponentScriptExecutor.process"
479               }
480             ]
481           }
482         }
483       },
484       "assign-activate": {
485         "inputs": {
486           "assign-activate-properties": {
487             "required": true,
488             "type": "dt-assign-activate-properties"
489           }
490         },
491         "steps": {
492           "activate-process": {
493             "description": "Resource Assign and Netconf Activation Workflow",
494             "target": "assign-activate-process",
495             "activities": [
496               {
497                 "call_operation": "CONFIG.AssignActivateProcess"
498               }
499             ]
500           }
501         }
502       },
503       "imperative-test-wf": {
504         "steps": {
505           "activate-step1": {
506             "description": "Activate CLI flow 1",
507             "target": "activate-cli",
508             "activities": [
509               {
510                 "call_operation": "ComponentScriptExecutor.process"
511               }
512             ],
513             "on_success": [
514               "activate-step2"
515             ]
516           },
517           "activate-step2": {
518             "description": "Activate CLI flow 2",
519             "target": "activate-cli",
520             "activities": [
521               {
522                 "call_operation": "ComponentScriptExecutor.process"
523               }
524             ],
525             "on_success": [
526               "activate-step3"
527             ]
528           },
529           "activate-step3": {
530             "description": "Activate CLI flow 3",
531             "target": "activate-cli",
532             "activities": [
533               {
534                 "call_operation": "ComponentScriptExecutor.process"
535               }
536             ]
537           }
538         }
539       }
540     }
541   }
542 }