Implementation of config-assign and config-deploy actions
[demo.git] / heat / vFW_CNF_CDS / templates / cba / Definitions / vFW_CNF_CDS.json
1 {
2     "tosca_definitions_version": "controller_blueprint_1_0_0",
3     "metadata": {
4         "template_author": "Samuli Silvius <s.silvius@partner.samsung.com>",
5         "author-email": "lukasz.rajewski@orange.com",
6         "user-groups": "ADMIN, OPERATION",
7         "template_name": "vFW_CNF_CDS",
8         "template_version": "7.0.0",
9         "template_tags": "Samuli Silvius, Lukasz Rajewski, vFW_CNF_CDS",
10         "template_type": "DEFAULT"
11     },
12     "imports": [
13         {
14             "file": "Definitions/data_types.json"
15         },
16         {
17             "file": "Definitions/relationship_types.json"
18         },
19         {
20             "file": "Definitions/artifact_types.json"
21         },
22         {
23             "file": "Definitions/node_types.json"
24         },
25         {
26             "file": "Definitions/policy_types.json"
27         }
28     ],
29     "dsl_definitions": {
30         "vpkg-rest-api": {
31             "type": "basic-auth",
32             "url": "http://",
33             "username": "admin",
34             "password": "admin"
35         },
36         "config-deploy-properties": {
37             "resolution-key": {
38                 "get_input": "resolution-key"
39             }
40         },
41         "simple-status-properties": {
42             "resolution-key": {
43                 "get_input": "resolution-key"
44             },
45             "config-deploy-setup": {
46                 "get_attribute": [
47                     "config-setup-process",
48                     "",
49                     "assignment-map",
50                     "config-deploy",
51                     "config-deploy-setup"
52                 ]
53             }
54         }
55     },
56     "topology_template": {
57         "workflows": {
58             "resource-assignment": {
59                 "steps": {
60                     "resource-assignment": {
61                         "description": "Resource Assign Workflow",
62                         "target": "resource-assignment",
63                         "activities": [
64                             {
65                                 "call_operation": "ResourceResolutionComponent.process"
66                             }
67                         ],
68                         "on_success": [
69                             "profile-upload"
70                         ]
71                     },
72                     "profile-upload": {
73                         "description": "Generate and upload K8s Profile",
74                         "target": "k8s-profile-upload",
75                         "activities": [
76                             {
77                                 "call_operation": "ComponentScriptExecutor.process"
78                             }
79                         ]
80                     }
81                 },
82                 "inputs": {
83                     "template-prefix": {
84                         "required": true,
85                         "type": "list",
86                         "entry_schema": {
87                             "type": "string"
88                         }
89                     },
90                     "resolution-key": {
91                         "required": false,
92                         "type": "string",
93                         "entry_schema": {
94                             "type": ""
95                         }
96                     },
97                     "resource-assignment-properties": {
98                         "description": "Dynamic PropertyDefinition for workflow(resource-assignment).",
99                         "required": true,
100                         "type": "dt-resource-assignment-properties"
101                     }
102                 },
103                 "outputs": {
104                     "meshed-template": {
105                         "type": "json",
106                         "value": {
107                             "get_attribute": [
108                                 "resource-assignment",
109                                 "assignment-params"
110                             ]
111                         }
112                     }
113                 }
114             },
115             "config-assign": {
116                 "steps": {
117                     "config-setup": {
118                         "description": "Gather necessary input for config template upload",
119                         "target": "config-setup-process",
120                         "activities": [
121                             {
122                                 "call_operation": "ResourceResolutionComponent.process"
123                             }
124                         ],
125                         "on_success": [
126                             "config-template"
127                         ]
128                     },
129                     "config-template": {
130                         "description": "Generate and upload K8s config template",
131                         "target": "k8s-config-template",
132                         "activities": [
133                             {
134                                 "call_operation": "K8sConfigTemplateComponent.process"
135                             }
136                         ]
137                     }
138                 },
139                 "inputs": {
140                     "resolution-key": {
141                         "required": true,
142                         "type": "string"
143                     },
144                     "store-result": {
145                         "required": true,
146                         "type": "boolean"
147                     },
148                     "config-assign-properties": {
149                         "description": "Dynamic PropertyDefinition for workflow(config-assign).",
150                         "required": true,
151                         "type": "dt-config-assign-properties"
152                     }
153                 }
154             },
155             "config-deploy": {
156                 "steps": {
157                     "config-setup": {
158                         "description": "Gather necessary input for config init and status verification",
159                         "target": "config-setup-process",
160                         "activities": [
161                             {
162                                 "call_operation": "ResourceResolutionComponent.process"
163                             }
164                         ],
165                         "on_success": [
166                             "config-apply"
167                         ]
168                     },
169                     "config-apply": {
170                         "description": "Activate K8s config template",
171                         "target": "k8s-config-apply",
172                         "activities": [
173                             {
174                                 "call_operation": "K8sConfigTemplateComponent.process"
175                             }
176                         ],
177                         "on_success": [
178                             "status-verification-script"
179                         ]
180                     },
181                     "status-verification-script": {
182                         "description": "Simple status verification script",
183                         "target": "simple-status-check",
184                         "activities": [
185                             {
186                                 "call_operation": "ComponentScriptExecutor.process"
187                             }
188                         ]
189                     }
190                 },
191                 "inputs": {
192                     "resolution-key": {
193                         "required": true,
194                         "type": "string"
195                     },
196                     "config-deploy-properties": {
197                         "description": "Dynamic PropertyDefinition for workflow(config-deploy).",
198                         "required": true,
199                         "type": "dt-config-deploy-properties"
200                     }
201                 }
202             }
203         },
204         "node_templates": {
205             "resource-assignment": {
206                 "type": "component-resource-resolution",
207                 "interfaces": {
208                     "ResourceResolutionComponent": {
209                         "operations": {
210                             "process": {
211                                 "inputs": {
212                                     "artifact-prefix-names": {
213                                         "get_input": "template-prefix"
214                                     }
215                                 }
216                             }
217                         }
218                     }
219                 },
220                 "artifacts": {
221                     "helm_base_template-template": {
222                         "type": "artifact-template-velocity",
223                         "file": "Templates/base_template-template.vtl"
224                     },
225                     "helm_base_template-mapping": {
226                         "type": "artifact-mapping-resource",
227                         "file": "Templates/base_template-mapping.json"
228                     },
229                     "helm_vpkg-template": {
230                         "type": "artifact-template-velocity",
231                         "file": "Templates/vpkg-template.vtl"
232                     },
233                     "helm_vpkg-mapping": {
234                         "type": "artifact-mapping-resource",
235                         "file": "Templates/vpkg-mapping.json"
236                     },
237                     "helm_vfw-template": {
238                         "type": "artifact-template-velocity",
239                         "file": "Templates/vfw-template.vtl"
240                     },
241                     "helm_vfw-mapping": {
242                         "type": "artifact-mapping-resource",
243                         "file": "Templates/vfw-mapping.json"
244                     },
245                     "vnf-template": {
246                         "type": "artifact-template-velocity",
247                         "file": "Templates/vnf-template.vtl"
248                     },
249                     "vnf-mapping": {
250                         "type": "artifact-mapping-resource",
251                         "file": "Templates/vnf-mapping.json"
252                     },
253                     "helm_vsn-template": {
254                         "type": "artifact-template-velocity",
255                         "file": "Templates/vsn-template.vtl"
256                     },
257                     "helm_vsn-mapping": {
258                         "type": "artifact-mapping-resource",
259                         "file": "Templates/vsn-mapping.json"
260                     }
261                 }
262             },
263             "k8s-profile-upload": {
264                 "type": "component-k8s-profile-upload",
265                 "interfaces": {
266                     "K8sProfileUploadComponent": {
267                         "operations": {
268                             "process": {
269                                 "inputs": {
270                                     "artifact-prefix-names": {
271                                         "get_input": "template-prefix"
272                                     },
273                                     "resource-assignment-map": {
274                                         "get_attribute": [
275                                             "resource-assignment",
276                                             "assignment-map"
277                                         ]
278                                     }
279                                 }
280                             }
281                         }
282                     }
283                 },
284                 "artifacts": {
285                     "vfw-cnf-cds-base-profile": {
286                         "type": "artifact-k8sprofile-content",
287                         "file": "Templates/k8s-profiles/vfw-cnf-cds-base-profile.tar.gz"
288                     },
289                     "vfw-cnf-cds-vpkg-profile": {
290                         "type": "artifact-k8sprofile-content",
291                         "file": "Templates/k8s-profiles/vfw-cnf-cds-vpkg-profile"
292                     },
293                     "vfw-cnf-cds-vpkg-profile-mapping": {
294                         "type": "artifact-mapping-resource",
295                         "file": "Templates/k8s-profiles/vfw-cnf-cds-vpkg-profile/ssh-service-mapping.json"
296                     }
297                 }
298             },
299             "k8s-config-template": {
300                 "type": "component-k8s-config-template",
301                 "interfaces": {
302                     "K8sConfigTemplateComponent": {
303                         "operations": {
304                             "process": {
305                                 "inputs": {
306                                     "artifact-prefix-names": [
307                                         "helm_vpkg"
308                                     ],
309                                     "resource-assignment-map": {
310                                         "get_attribute": [
311                                             "config-setup-process",
312                                             "",
313                                             "assignment-map",
314                                             "config-deploy",
315                                             "config-deploy-setup"
316                                         ]
317                                     }
318                                 }
319                             }
320                         }
321                     }
322                 },
323                 "artifacts": {
324                     "ssh-service-config": {
325                         "type": "artifact-k8sprofile-content",
326                         "file": "Templates/k8s-configs/ssh-service.tar.gz"
327                     },
328                     "ssh-service-config-customizable": {
329                         "type": "artifact-k8sprofile-content",
330                         "file": "Templates/k8s-configs/ssh-service-config"
331                     },
332                     "ssh-service-config-customizable-mapping": {
333                         "type": "artifact-mapping-resource",
334                         "file": "Templates/k8s-configs/ssh-service-config/ssh-service-mapping.json"
335                     }
336                 }
337             },
338             "k8s-config-apply": {
339                 "type": "component-k8s-config-value",
340                 "interfaces": {
341                     "K8sConfigValueComponent": {
342                         "operations": {
343                             "process": {
344                                 "inputs": {
345                                     "artifact-prefix-names": [
346                                         "helm_vpkg"
347                                     ],
348                                     "resource-assignment-map": {
349                                         "get_attribute": [
350                                             "config-setup-process",
351                                             "",
352                                             "assignment-map",
353                                             "config-deploy",
354                                             "config-deploy-setup"
355                                         ]
356                                     }
357                                 }
358                             }
359                         }
360                     }
361                 }
362             },
363             "simple-status-check": {
364                 "type": "component-script-executor",
365                 "interfaces": {
366                     "ComponentScriptExecutor": {
367                         "operations": {
368                             "process": {
369                                 "inputs": {
370                                     "script-type": "kotlin",
371                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.SimpleStatusCheck",
372                                     "instance-dependencies": [
373                                         "blueprintPropertiesService"
374                                     ],
375                                     "dynamic-properties": "*simple-status-properties"
376                                 }
377                             }
378                         }
379                     }
380                 }
381             },
382             "config-setup-process": {
383                 "type": "component-resource-resolution",
384                 "interfaces": {
385                     "ResourceResolutionComponent": {
386                         "operations": {
387                             "process": {
388                                 "inputs": {
389                                     "resolution-key": {
390                                         "get_input": "resolution-key"
391                                     },
392                                     "store-result": false,
393                                     "artifact-prefix-names": [
394                                         "config-deploy"
395                                     ]
396                                 },
397                                 "outputs": {
398                                     "resource-assignment-params": {
399                                         "get_attribute": [
400                                             "SELF",
401                                             "assignment-params"
402                                         ]
403                                     },
404                                     "status": "success"
405                                 }
406                             }
407                         }
408                     }
409                 },
410                 "artifacts": {
411                     "config-deploy-template": {
412                         "type": "artifact-template-velocity",
413                         "file": "Templates/config-setup-template.vtl"
414                     },
415                     "config-deploy-mapping": {
416                         "type": "artifact-mapping-resource",
417                         "file": "Templates/config-setup-mapping.json"
418                     }
419                 }
420             },
421             "config-deploy-process": {
422                 "type": "component-script-executor",
423                 "interfaces": {
424                     "ComponentScriptExecutor": {
425                         "operations": {
426                             "process": {
427                                 "inputs": {
428                                     "script-type": "kotlin",
429                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.ConfigDeploy",
430                                     "dynamic-properties": "*config-deploy-properties"
431                                 }
432                             }
433                         }
434                     }
435                 }
436             }
437         }
438     }
439 }