7a9239819238ab0e83e7a3086c040f77e9d264eb
[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       "sample-netconf-device": {
282         "type": "vnf-netconf-device",
283         "capabilities": {
284           "netconf": {
285             "properties": {
286               "login-key": "sample-key",
287               "login-account": "sample-account",
288               "target-ip-address": {
289                 "get_attribute": [
290                   "resource-assignment",
291                   "",
292                   "assignment-params",
293                   "$.ipAddress"
294                 ]
295               },
296               "port-number": 830,
297               "connection-time-out": 30
298             }
299           }
300         }
301       }
302     },
303     "workflows": {
304       "resource-assignment": {
305         "inputs": {
306           "resource-assignment-properties": {
307             "required": true,
308             "type": "dt-resource-assignment-properties"
309           }
310         },
311         "steps": {
312           "call-resource-assignment": {
313             "description": "Resource Assignment Workflow",
314             "target": "resource-assignment-process",
315             "activities": [
316               {
317                 "call_operation": "CONFIG.ResourceAssignment"
318               }
319             ]
320           }
321         }
322       },
323       "activate": {
324         "inputs": {
325           "request-id": {
326             "required": true,
327             "type": "string"
328           },
329           "action-name": {
330             "required": true,
331             "type": "string"
332           },
333           "scope-type": {
334             "required": true,
335             "type": "string"
336           },
337           "hostname": {
338             "required": true,
339             "type": "string"
340           }
341         },
342         "steps": {
343           "activate-process": {
344             "description": "Netconf Activation Workflow",
345             "target": "activate-process",
346             "activities": [
347               {
348                 "call_operation": "CONFIG.ActivateProcess"
349               }
350             ]
351           }
352         }
353       },
354       "assign-activate": {
355         "inputs": {
356           "assign-activate-properties": {
357             "required": true,
358             "type": "dt-assign-activate-properties"
359           }
360         },
361         "steps": {
362           "activate-process": {
363             "description": "Resource Assign and Netconf Activation Workflow",
364             "target": "assign-activate-process",
365             "activities": [
366               {
367                 "call_operation": "CONFIG.AssignActivateProcess"
368               }
369             ]
370           }
371         }
372       }
373     }
374   }
375 }