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