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