Real vFW CNF config-assign and config-deploy
[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": "8.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                         "on_failure": [
169                             "handle_error"
170                         ]
171                     },
172                     "config-apply": {
173                         "description": "Activate K8s config template",
174                         "target": "k8s-config-apply",
175                         "activities": [
176                             {
177                                 "call_operation": "K8sConfigTemplateComponent.process"
178                             }
179                         ],
180                         "on_success": [
181                             "status-verification-script"
182                         ]
183                     },
184                     "status-verification-script": {
185                         "description": "Simple status verification script",
186                         "target": "simple-status-check",
187                         "activities": [
188                             {
189                                 "call_operation": "ComponentScriptExecutor.process"
190                             }
191                         ],
192                         "on_success": [
193                             "collect-results"
194                         ],
195                         "on_failure": [
196                             "handle_error"
197                         ]
198                     },
199                     "handle_error": {
200                         "description": "Simple error verification script",
201                         "target": "simple-error-check",
202                         "activities": [
203                             {
204                                 "call_operation": "ComponentScriptExecutor.process"
205                             }
206                         ],
207                         "on_success": [
208                             "collect-results"
209                         ]
210                     },
211                     "collect-results": {
212                         "description": "Final collection of results",
213                         "target": "collect-results"
214                     }
215                 },
216                 "inputs": {
217                     "resolution-key": {
218                         "required": true,
219                         "type": "string"
220                     },
221                     "config-deploy-properties": {
222                         "description": "Dynamic PropertyDefinition for workflow(config-deploy).",
223                         "required": true,
224                         "type": "dt-config-deploy-properties"
225                     }
226                 }
227             }
228         },
229         "node_templates": {
230             "resource-assignment": {
231                 "type": "component-resource-resolution",
232                 "interfaces": {
233                     "ResourceResolutionComponent": {
234                         "operations": {
235                             "process": {
236                                 "inputs": {
237                                     "artifact-prefix-names": {
238                                         "get_input": "template-prefix"
239                                     }
240                                 }
241                             }
242                         }
243                     }
244                 },
245                 "artifacts": {
246                     "helm_base_template-template": {
247                         "type": "artifact-template-velocity",
248                         "file": "Templates/base_template-template.vtl"
249                     },
250                     "helm_base_template-mapping": {
251                         "type": "artifact-mapping-resource",
252                         "file": "Templates/base_template-mapping.json"
253                     },
254                     "helm_vpkg-template": {
255                         "type": "artifact-template-velocity",
256                         "file": "Templates/vpkg-template.vtl"
257                     },
258                     "helm_vpkg-mapping": {
259                         "type": "artifact-mapping-resource",
260                         "file": "Templates/vpkg-mapping.json"
261                     },
262                     "helm_vfw-template": {
263                         "type": "artifact-template-velocity",
264                         "file": "Templates/vfw-template.vtl"
265                     },
266                     "helm_vfw-mapping": {
267                         "type": "artifact-mapping-resource",
268                         "file": "Templates/vfw-mapping.json"
269                     },
270                     "vnf-template": {
271                         "type": "artifact-template-velocity",
272                         "file": "Templates/vnf-template.vtl"
273                     },
274                     "vnf-mapping": {
275                         "type": "artifact-mapping-resource",
276                         "file": "Templates/vnf-mapping.json"
277                     },
278                     "helm_vsn-template": {
279                         "type": "artifact-template-velocity",
280                         "file": "Templates/vsn-template.vtl"
281                     },
282                     "helm_vsn-mapping": {
283                         "type": "artifact-mapping-resource",
284                         "file": "Templates/vsn-mapping.json"
285                     }
286                 }
287             },
288             "k8s-profile-upload": {
289                 "type": "component-k8s-profile-upload",
290                 "interfaces": {
291                     "K8sProfileUploadComponent": {
292                         "operations": {
293                             "process": {
294                                 "inputs": {
295                                     "artifact-prefix-names": {
296                                         "get_input": "template-prefix"
297                                     },
298                                     "resource-assignment-map": {
299                                         "get_attribute": [
300                                             "resource-assignment",
301                                             "assignment-map"
302                                         ]
303                                     }
304                                 }
305                             }
306                         }
307                     }
308                 },
309                 "artifacts": {
310                     "vfw-cnf-cds-base-profile": {
311                         "type": "artifact-k8sprofile-content",
312                         "file": "Templates/k8s-profiles/vfw-cnf-cds-base-profile.tar.gz"
313                     },
314                     "vfw-cnf-cds-vpkg-profile": {
315                         "type": "artifact-k8sprofile-content",
316                         "file": "Templates/k8s-profiles/vfw-cnf-cds-vpkg-profile"
317                     },
318                     "vfw-cnf-cds-vpkg-profile-mapping": {
319                         "type": "artifact-mapping-resource",
320                         "file": "Templates/k8s-profiles/vfw-cnf-cds-vpkg-profile/ssh-service-mapping.json"
321                     }
322                 }
323             },
324             "k8s-config-template": {
325                 "type": "component-k8s-config-template",
326                 "interfaces": {
327                     "K8sConfigTemplateComponent": {
328                         "operations": {
329                             "process": {
330                                 "inputs": {
331                                     "artifact-prefix-names": [
332                                         "helm_vpkg"
333                                     ],
334                                     "resource-assignment-map": {
335                                         "get_attribute": [
336                                             "config-setup-process",
337                                             "",
338                                             "assignment-map",
339                                             "config-deploy",
340                                             "config-deploy-setup"
341                                         ]
342                                     }
343                                 }
344                             }
345                         }
346                     }
347                 },
348                 "artifacts": {
349                     "ssh-service-config": {
350                         "type": "artifact-k8sconfig-content",
351                         "file": "Templates/k8s-configs/ssh-service.tar.gz"
352                     },
353                     "ssh-service-config-customizable": {
354                         "type": "artifact-k8sconfig-content",
355                         "file": "Templates/k8s-configs/ssh-service-config"
356                     },
357                     "ssh-service-config-customizable-mapping": {
358                         "type": "artifact-mapping-resource",
359                         "file": "Templates/k8s-configs/ssh-service-config/ssh-service-mapping.json"
360                     }
361                 }
362             },
363             "k8s-config-apply": {
364                 "type": "component-k8s-config-value",
365                 "interfaces": {
366                     "K8sConfigValueComponent": {
367                         "operations": {
368                             "process": {
369                                 "inputs": {
370                                     "artifact-prefix-names": [
371                                         "helm_vpkg"
372                                     ],
373                                     "k8s-config-operation-type": "create",
374                                     "resource-assignment-map": {
375                                         "get_attribute": [
376                                             "config-setup-process",
377                                             "",
378                                             "assignment-map",
379                                             "config-deploy",
380                                             "config-deploy-setup"
381                                         ]
382                                     }
383                                 }
384                             }
385                         }
386                     }
387                 },
388                 "artifacts": {
389                     "ssh-service-default": {
390                         "type": "artifact-k8sconfig-content",
391                         "file": "Templates/k8s-configs/ssh-service-config/values.yaml"
392                     },
393                     "ssh-service-config": {
394                         "type": "artifact-k8sconfig-content",
395                         "file": "Templates/k8s-configs/ssh-service-values/values.yaml.vtl"
396                     },
397                     "ssh-service-config-mapping": {
398                         "type": "artifact-mapping-resource",
399                         "file": "Templates/k8s-configs/ssh-service-values/ssh-service-mapping.json"
400                     }
401                 }
402             },
403             "simple-status-check": {
404                 "type": "component-script-executor",
405                 "interfaces": {
406                     "ComponentScriptExecutor": {
407                         "operations": {
408                             "process": {
409                                 "inputs": {
410                                     "script-type": "kotlin",
411                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.SimpleStatusCheck",
412                                     "instance-dependencies": [
413                                         "blueprintPropertiesService"
414                                     ],
415                                     "dynamic-properties": "*simple-status-properties"
416                                 }
417                             }
418                         }
419                     }
420                 }
421             },
422             "simple-error-check": {
423                 "type": "component-script-executor",
424                 "interfaces": {
425                     "ComponentScriptExecutor": {
426                         "operations": {
427                             "process": {
428                                 "inputs": {
429                                     "script-type": "kotlin",
430                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.SimpleErrorCheck",
431                                     "instance-dependencies": [
432                                         "blueprintPropertiesService"
433                                     ],
434                                     "dynamic-properties": "*simple-status-properties"
435                                 }
436                             }
437                         }
438                     }
439                 }
440             },
441             "config-setup-process": {
442                 "type": "component-resource-resolution",
443                 "interfaces": {
444                     "ResourceResolutionComponent": {
445                         "operations": {
446                             "process": {
447                                 "inputs": {
448                                     "resolution-key": {
449                                         "get_input": "resolution-key"
450                                     },
451                                     "store-result": false,
452                                     "artifact-prefix-names": [
453                                         "config-deploy"
454                                     ]
455                                 },
456                                 "outputs": {
457                                     "resource-assignment-params": {
458                                         "get_attribute": [
459                                             "SELF",
460                                             "assignment-params"
461                                         ]
462                                     },
463                                     "status": "success"
464                                 }
465                             }
466                         }
467                     }
468                 },
469                 "artifacts": {
470                     "config-deploy-template": {
471                         "type": "artifact-template-velocity",
472                         "file": "Templates/config-setup-template.vtl"
473                     },
474                     "config-deploy-mapping": {
475                         "type": "artifact-mapping-resource",
476                         "file": "Templates/config-setup-mapping.json"
477                     }
478                 }
479             },
480             "config-deploy-process": {
481                 "type": "component-script-executor",
482                 "interfaces": {
483                     "ComponentScriptExecutor": {
484                         "operations": {
485                             "process": {
486                                 "inputs": {
487                                     "script-type": "kotlin",
488                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.ConfigDeploy",
489                                     "dynamic-properties": "*config-deploy-properties"
490                                 }
491                             }
492                         }
493                     }
494                 }
495             },
496             "collect-results": {
497                 "type": "component-script-executor",
498                 "interfaces": {
499                     "ComponentScriptExecutor": {
500                         "operations": {
501                             "process": {
502                                 "implementation": {
503                                     "primary": "component-script",
504                                     "timeout": 180,
505                                     "operation_host": "SELF"
506                                 },
507                                 "inputs": {
508                                     "script-type": "kotlin",
509                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.CollectorScript"
510                                 },
511                                 "outputs": {}
512                             }
513                         }
514                     }
515                 }
516             }
517         }
518     }
519 }