CDS max-occurrence feature
[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           "notemplate-mapping": {
192             "type": "artifact-mapping-resource",
193             "file": "Definitions/notemplate-mapping.json"
194           }
195         }
196       },
197       "resource-assignment-py": {
198         "type": "component-resource-resolution",
199         "interfaces": {
200           "ResourceResolutionComponent": {
201             "operations": {
202               "process": {
203                 "implementation": {
204                   "primary": "component-script"
205                 },
206                 "inputs": {
207                   "action-name": {
208                     "get_input": "action-name"
209                   }
210                 },
211                 "outputs": {
212                   "resource-assignment-params": "",
213                   "status": ""
214                 }
215               }
216             }
217           }
218         },
219         "artifacts": {
220           "component-script": {
221             "type": "artifact-script-jython",
222             "file": "Scripts/python/SamplePythonComponentNode.py"
223           }
224         }
225       },
226       "activate-jython": {
227         "type": "component-jython-executor",
228         "interfaces": {
229           "ComponentJythonExecutor": {
230             "operations": {
231               "process": {
232                 "implementation": {
233                   "primary": "component-script"
234                 },
235                 "inputs": {
236                   "instance-dependencies": [
237                     "json-parser-service"
238                   ]
239                 },
240                 "outputs": {
241                   "response-data": "",
242                   "status": ""
243                 }
244               }
245             }
246           }
247         },
248         "artifacts": {
249           "component-script": {
250             "type": "artifact-script-jython",
251             "file": "Scripts/python/SamplePythonComponentNode.py"
252           }
253         }
254       },
255       "activate-netconf": {
256         "type": "component-netconf-executor",
257         "interfaces": {
258           "ComponentNetconfExecutor": {
259             "operations": {
260               "process": {
261                 "implementation": {
262                   "primary": "component-script"
263                 },
264                 "inputs": {
265                   "script-type": "jython",
266                   "script-class-reference": "Scripts/python/NetconfRpcExample.py",
267                   "instance-dependencies": [
268                   ],
269                   "dynamic-properties": "*dynamic-netconf-properties"
270                 },
271                 "outputs": {
272                   "response-data": "",
273                   "status": ""
274                 }
275               }
276             }
277           }
278         },
279         "requirements": {
280           "netconf-connection": {
281             "capability": "netconf",
282             "node": "sample-netconf-device",
283             "relationship": "tosca.relationships.ConnectsTo"
284           }
285         },
286         "artifacts": {
287           "hostname-template": {
288             "type": "artifact-template-velocity",
289             "file": "Templates/hostname-template.vtl"
290           },
291           "hostname-mapping": {
292             "type": "artifact-mapping-resource",
293             "file": "Definitions/hostname-mapping.json"
294           },
295           "component-script": {
296             "type": "artifact-script-jython",
297             "file": "Scripts/python/NetconfRpcExample.py"
298           }
299         }
300       },
301       "activate-restconf": {
302         "type": "component-script-executor",
303         "interfaces": {
304           "ComponentScriptExecutor": {
305             "operations": {
306               "process": {
307                 "implementation": {
308                   "primary": "component-script"
309                 },
310                 "inputs": {
311                   "script-type": "kotlin",
312                   "script-class-reference": "DefaultRestconf_cba$MountNEditConfigure"
313                 },
314                 "outputs": {
315                   "response-data": "",
316                   "status": "success"
317                 }
318               }
319             }
320           }
321         }
322       },
323       "activate-cli": {
324         "type": "component-script-executor",
325         "interfaces": {
326           "ComponentScriptExecutor": {
327             "operations": {
328               "process": {
329                 "implementation": {
330                   "primary": "component-script"
331                 },
332                 "inputs": {
333                   "script-type": "internal",
334                   "script-class-reference": "internal.scripts.TestCliScriptFunction"
335                 },
336                 "outputs": {
337                   "response-data": "",
338                   "status": "success"
339                 }
340               }
341             }
342           }
343         }
344       },
345       "sample-netconf-device": {
346         "type": "vnf-netconf-device",
347         "capabilities": {
348           "netconf": {
349             "properties": {
350               "login-key": "sample-key",
351               "login-account": "sample-account",
352               "target-ip-address": {
353                 "get_attribute": [
354                   "resource-assignment",
355                   "",
356                   "assignment-params",
357                   "$.ipAddress"
358                 ]
359               },
360               "port-number": 830,
361               "connection-time-out": 30
362             }
363           }
364         }
365       }
366     },
367     "relationship_templates": {
368       "cli-device-properties": {
369         "type": "tosca.relationships.ConnectsTo.SshClient",
370         "description": "SSH Connection",
371         "properties": {
372           "connection-config": {
373             "password": "sample-password",
374             "host": {
375               "get_input": "hostname"
376             },
377             "type": "basic-auth",
378             "connectionTimeOut": 30,
379             "username": "sample-user"
380           }
381         }
382       }
383     },
384     "workflows": {
385       "resource-assignment": {
386         "inputs": {
387           "resource-assignment-properties": {
388             "required": true,
389             "type": "dt-resource-assignment-properties"
390           }
391         },
392         "steps": {
393           "call-resource-assignment": {
394             "description": "Resource Assignment Workflow",
395             "target": "resource-assignment-process",
396             "activities": [
397               {
398                 "call_operation": "CONFIG.ResourceAssignment"
399               }
400             ]
401           }
402         },
403         "outputs": {
404           "response-property": {
405             "type": "string",
406             "value": "executed"
407           },
408           "template-properties": {
409             "type": "json",
410             "value": {
411               "get_attribute": [
412                 "resource-assignment",
413                 "assignment-params"
414               ]
415             }
416           }
417         }
418       },
419       "activate": {
420         "inputs": {
421           "request-id": {
422             "required": true,
423             "type": "string"
424           },
425           "action-name": {
426             "required": true,
427             "type": "string"
428           },
429           "scope-type": {
430             "required": true,
431             "type": "string"
432           },
433           "hostname": {
434             "required": true,
435             "type": "string"
436           }
437         },
438         "steps": {
439           "activate-process": {
440             "description": "Netconf Activation Workflow",
441             "target": "activate-process",
442             "activities": [
443               {
444                 "call_operation": "CONFIG.ActivateProcess"
445               }
446             ]
447           }
448         }
449       },
450       "activate-restconf": {
451         "steps": {
452           "activate-process": {
453             "description": "Activate Restconf flow",
454             "target": "activate-restconf",
455             "activities": [
456               {
457                 "call_operation": "ComponentRestconfExecutor.process"
458               }
459             ]
460           }
461         }
462       },
463       "activate-cli": {
464         "steps": {
465           "activate-process": {
466             "description": "Activate CLI flow",
467             "target": "activate-cli",
468             "activities": [
469               {
470                 "call_operation": "ComponentScriptExecutor.process"
471               }
472             ]
473           }
474         }
475       },
476       "assign-activate": {
477         "inputs": {
478           "assign-activate-properties": {
479             "required": true,
480             "type": "dt-assign-activate-properties"
481           }
482         },
483         "steps": {
484           "activate-process": {
485             "description": "Resource Assign and Netconf Activation Workflow",
486             "target": "assign-activate-process",
487             "activities": [
488               {
489                 "call_operation": "CONFIG.AssignActivateProcess"
490               }
491             ]
492           }
493         }
494       },
495       "imperative-test-wf": {
496         "steps": {
497           "activate-step1": {
498             "description": "Activate CLI flow 1",
499             "target": "activate-cli",
500             "activities": [
501               {
502                 "call_operation": "ComponentScriptExecutor.process"
503               }
504             ],
505             "on_success": [
506               "activate-step2"
507             ]
508           },
509           "activate-step2": {
510             "description": "Activate CLI flow 2",
511             "target": "activate-cli",
512             "activities": [
513               {
514                 "call_operation": "ComponentScriptExecutor.process"
515               }
516             ],
517             "on_success": [
518               "activate-step3"
519             ]
520           },
521           "activate-step3": {
522             "description": "Activate CLI flow 3",
523             "target": "activate-cli",
524             "activities": [
525               {
526                 "call_operation": "ComponentScriptExecutor.process"
527               }
528             ]
529           }
530         }
531       }
532     }
533   }
534 }