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