135016a11b88762612e6fab9629d70065ef2b933
[ccsdk/cds.git] /
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       "activate-cli": {
313         "type": "component-script-executor",
314         "interfaces": {
315           "ComponentScriptExecutor": {
316             "operations": {
317               "process": {
318                 "implementation": {
319                   "primary": "component-script"
320                 },
321                 "inputs": {
322                   "script-type": "internal",
323                   "script-class-reference": "internal.scripts.TestCliScriptFunction"
324                 },
325                 "outputs": {
326                   "response-data": "",
327                   "status": "success"
328                 }
329               }
330             }
331           }
332         }
333       },
334       "sample-netconf-device": {
335         "type": "vnf-netconf-device",
336         "capabilities": {
337           "netconf": {
338             "properties": {
339               "login-key": "sample-key",
340               "login-account": "sample-account",
341               "target-ip-address": {
342                 "get_attribute": [
343                   "resource-assignment",
344                   "",
345                   "assignment-params",
346                   "$.ipAddress"
347                 ]
348               },
349               "port-number": 830,
350               "connection-time-out": 30
351             }
352           }
353         }
354       }
355     },
356     "workflows": {
357       "resource-assignment": {
358         "inputs": {
359           "resource-assignment-properties": {
360             "required": true,
361             "type": "dt-resource-assignment-properties"
362           }
363         },
364         "steps": {
365           "call-resource-assignment": {
366             "description": "Resource Assignment Workflow",
367             "target": "resource-assignment-process",
368             "activities": [
369               {
370                 "call_operation": "CONFIG.ResourceAssignment"
371               }
372             ]
373           }
374         },
375         "outputs": {
376           "response-property": {
377             "type": "string",
378             "value": "executed"
379           },
380           "template-properties": {
381             "type": "json",
382             "value": {
383               "get_attribute": [
384                 "resource-assignment",
385                 "assignment-params"
386               ]
387             }
388           }
389         }
390       },
391       "activate": {
392         "inputs": {
393           "request-id": {
394             "required": true,
395             "type": "string"
396           },
397           "action-name": {
398             "required": true,
399             "type": "string"
400           },
401           "scope-type": {
402             "required": true,
403             "type": "string"
404           },
405           "hostname": {
406             "required": true,
407             "type": "string"
408           }
409         },
410         "steps": {
411           "activate-process": {
412             "description": "Netconf Activation Workflow",
413             "target": "activate-process",
414             "activities": [
415               {
416                 "call_operation": "CONFIG.ActivateProcess"
417               }
418             ]
419           }
420         }
421       },
422       "activate-restconf": {
423         "steps": {
424           "activate-process": {
425             "description": "Activate Restconf flow",
426             "target": "activate-restconf",
427             "activities": [
428               {
429                 "call_operation": "ComponentRestconfExecutor.process"
430               }
431             ]
432           }
433         }
434       },
435       "activate-cli": {
436         "steps": {
437           "activate-process": {
438             "description": "Activate CLI flow",
439             "target": "activate-cli",
440             "activities": [
441               {
442                 "call_operation": "ComponentScriptExecutor.process"
443               }
444             ]
445           }
446         }
447       },
448       "assign-activate": {
449         "inputs": {
450           "assign-activate-properties": {
451             "required": true,
452             "type": "dt-assign-activate-properties"
453           }
454         },
455         "steps": {
456           "activate-process": {
457             "description": "Resource Assign and Netconf Activation Workflow",
458             "target": "assign-activate-process",
459             "activities": [
460               {
461                 "call_operation": "CONFIG.AssignActivateProcess"
462               }
463             ]
464           }
465         }
466       }
467     }
468   }
469 }