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