eae69245b02a12f9c84a74cbc2d02551108ef82f
[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         }
184       },
185       "resource-assignment-py": {
186         "type": "component-resource-resolution",
187         "interfaces": {
188           "ResourceResolutionComponent": {
189             "operations": {
190               "process": {
191                 "implementation": {
192                   "primary": "component-script"
193                 },
194                 "inputs": {
195                   "action-name": {
196                     "get_input": "action-name"
197                   }
198                 },
199                 "outputs": {
200                   "resource-assignment-params": "",
201                   "status": ""
202                 }
203               }
204             }
205           }
206         },
207         "artifacts": {
208           "component-script": {
209             "type": "artifact-script-jython",
210             "file": "Scripts/python/SamplePythonComponentNode.py"
211           }
212         }
213       },
214       "activate-jython": {
215         "type": "component-jython-executor",
216         "interfaces": {
217           "ComponentJythonExecutor": {
218             "operations": {
219               "process": {
220                 "implementation": {
221                   "primary": "component-script"
222                 },
223                 "inputs": {
224                   "instance-dependencies": [
225                     "json-parser-service"
226                   ]
227                 },
228                 "outputs": {
229                   "response-data": "",
230                   "status": ""
231                 }
232               }
233             }
234           }
235         },
236         "artifacts": {
237           "component-script": {
238             "type": "artifact-script-jython",
239             "file": "Scripts/python/SamplePythonComponentNode.py"
240           }
241         }
242       },
243       "activate-netconf": {
244         "type": "component-netconf-executor",
245         "interfaces": {
246           "ComponentNetconfExecutor": {
247             "operations": {
248               "process": {
249                 "implementation": {
250                   "primary": "component-script"
251                 },
252                 "inputs": {
253                   "script-type": "jython",
254                   "script-class-reference": "Scripts/python/NetconfRpcExample.py",
255                   "instance-dependencies": [
256                   ],
257                   "dynamic-properties": "*dynamic-netconf-properties"
258                 },
259                 "outputs": {
260                   "response-data": "",
261                   "status": ""
262                 }
263               }
264             }
265           }
266         },
267         "requirements": {
268           "netconf-connection": {
269             "capability": "netconf",
270             "node": "sample-netconf-device",
271             "relationship": "tosca.relationships.ConnectsTo"
272           }
273         },
274         "artifacts": {
275           "hostname-template": {
276             "type": "artifact-template-velocity",
277             "file": "Templates/hostname-template.vtl"
278           },
279           "hostname-mapping": {
280             "type": "artifact-mapping-resource",
281             "file": "Definitions/hostname-mapping.json"
282           },
283           "component-script": {
284             "type": "artifact-script-jython",
285             "file": "Scripts/python/NetconfRpcExample.py"
286           }
287         }
288       },
289       "activate-restconf": {
290         "type": "component-restconf-executor",
291         "interfaces": {
292           "ComponentRestconfExecutor": {
293             "operations": {
294               "process": {
295                 "implementation": {
296                   "primary": "component-script"
297                 },
298                 "inputs": {
299                   "script-type": "kotlin",
300                   "script-class-reference": "DefaultRestconf_cba$MountNEditConfigure",
301                   "instance-dependencies": []
302                 },
303                 "outputs": {
304                   "response-data": "",
305                   "status": "success"
306                 }
307               }
308             }
309           }
310         }
311       },
312       "sample-netconf-device": {
313         "type": "vnf-netconf-device",
314         "capabilities": {
315           "netconf": {
316             "properties": {
317               "login-key": "sample-key",
318               "login-account": "sample-account",
319               "target-ip-address": {
320                 "get_attribute": [
321                   "resource-assignment",
322                   "",
323                   "assignment-params",
324                   "$.ipAddress"
325                 ]
326               },
327               "port-number": 830,
328               "connection-time-out": 30
329             }
330           }
331         }
332       }
333     },
334     "workflows": {
335       "resource-assignment": {
336         "inputs": {
337           "resource-assignment-properties": {
338             "required": true,
339             "type": "dt-resource-assignment-properties"
340           }
341         },
342         "steps": {
343           "call-resource-assignment": {
344             "description": "Resource Assignment Workflow",
345             "target": "resource-assignment-process",
346             "activities": [
347               {
348                 "call_operation": "CONFIG.ResourceAssignment"
349               }
350             ]
351           }
352         },
353         "outputs": {
354           "response-property": {
355             "type": "string",
356             "value": "executed"
357           },
358           "template-properties": {
359             "type": "json",
360             "value": {
361               "get_attribute": [
362                 "resource-assignment",
363                 "assignment-params"
364               ]
365             }
366           }
367         }
368       },
369       "activate": {
370         "inputs": {
371           "request-id": {
372             "required": true,
373             "type": "string"
374           },
375           "action-name": {
376             "required": true,
377             "type": "string"
378           },
379           "scope-type": {
380             "required": true,
381             "type": "string"
382           },
383           "hostname": {
384             "required": true,
385             "type": "string"
386           }
387         },
388         "steps": {
389           "activate-process": {
390             "description": "Netconf Activation Workflow",
391             "target": "activate-process",
392             "activities": [
393               {
394                 "call_operation": "CONFIG.ActivateProcess"
395               }
396             ]
397           }
398         }
399       },
400       "activate-restconf": {
401         "steps": {
402           "activate-process": {
403             "description": "Activate Restconf flow",
404             "target": "activate-restconf",
405             "activities": [
406               {
407                 "call_operation": "ComponentRestconfExecutor.process"
408               }
409             ]
410           }
411         }
412       },
413       "assign-activate": {
414         "inputs": {
415           "assign-activate-properties": {
416             "required": true,
417             "type": "dt-assign-activate-properties"
418           }
419         },
420         "steps": {
421           "activate-process": {
422             "description": "Resource Assign and Netconf Activation Workflow",
423             "target": "assign-activate-process",
424             "activities": [
425               {
426                 "call_operation": "CONFIG.AssignActivateProcess"
427               }
428             ]
429           }
430         }
431       }
432     }
433   }
434 }