[vFW CNF CDS] vf_module and vnf name generation improvment in CBA
[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         "naming-resolution": {
31             "type": "basic-auth",
32             "url": "http://neng-serv:8080/web/service",
33             "username": "ccsdkapps",
34             "password": "ccsdkapps"
35         },
36         "vpkg-rest-api": {
37             "type": "basic-auth",
38             "url": "http://",
39             "username": "admin",
40             "password": "admin"
41         },
42         "config-deploy-properties": {
43             "resolution-key": {
44                 "get_input": "resolution-key"
45             }
46         },
47         "simple-status-properties": {
48             "resolution-key": {
49                 "get_input": "resolution-key"
50             },
51             "config-deploy-setup": {
52                 "get_attribute": [
53                     "config-setup-process",
54                     "",
55                     "assignment-map",
56                     "config-deploy",
57                     "config-deploy-setup"
58                 ]
59             }
60         }
61     },
62     "topology_template": {
63         "workflows": {
64             "resource-assignment": {
65                 "steps": {
66                     "resource-assignment": {
67                         "description": "Resource Assign Workflow",
68                         "target": "resource-assignment",
69                         "activities": [
70                             {
71                                 "call_operation": "ResourceResolutionComponent.process"
72                             }
73                         ],
74                         "on_success": [
75                             "profile-upload"
76                         ]
77                     },
78                     "profile-upload": {
79                         "description": "Generate and upload K8s Profile",
80                         "target": "k8s-profile-upload",
81                         "activities": [
82                             {
83                                 "call_operation": "ComponentScriptExecutor.process"
84                             }
85                         ]
86                     }
87                 },
88                 "inputs": {
89                     "template-prefix": {
90                         "required": true,
91                         "type": "list",
92                         "entry_schema": {
93                             "type": "string"
94                         }
95                     },
96                     "resolution-key": {
97                         "required": false,
98                         "type": "string",
99                         "entry_schema": {
100                             "type": ""
101                         }
102                     },
103                     "resource-assignment-properties": {
104                         "description": "Dynamic PropertyDefinition for workflow(resource-assignment).",
105                         "required": true,
106                         "type": "dt-resource-assignment-properties"
107                     }
108                 },
109                 "outputs": {
110                     "meshed-template": {
111                         "type": "json",
112                         "value": {
113                             "get_attribute": [
114                                 "resource-assignment",
115                                 "assignment-params"
116                             ]
117                         }
118                     }
119                 }
120             },
121             "config-assign": {
122                 "steps": {
123                     "config-setup": {
124                         "description": "Gather necessary input for config template upload",
125                         "target": "config-setup-process",
126                         "activities": [
127                             {
128                                 "call_operation": "ResourceResolutionComponent.process"
129                             }
130                         ],
131                         "on_success": [
132                             "config-template"
133                         ]
134                     },
135                     "config-template": {
136                         "description": "Generate and upload K8s config template",
137                         "target": "k8s-config-template",
138                         "activities": [
139                             {
140                                 "call_operation": "K8sConfigTemplateComponent.process"
141                             }
142                         ]
143                     }
144                 },
145                 "inputs": {
146                     "resolution-key": {
147                         "required": true,
148                         "type": "string"
149                     },
150                     "store-result": {
151                         "required": true,
152                         "type": "boolean"
153                     },
154                     "config-assign-properties": {
155                         "description": "Dynamic PropertyDefinition for workflow(config-assign).",
156                         "required": true,
157                         "type": "dt-config-assign-properties"
158                     }
159                 }
160             },
161             "config-deploy": {
162                 "steps": {
163                     "config-setup": {
164                         "description": "Gather necessary input for config init and status verification",
165                         "target": "config-setup-process",
166                         "activities": [
167                             {
168                                 "call_operation": "ResourceResolutionComponent.process"
169                             }
170                         ],
171                         "on_success": [
172                             "config-apply"
173                         ],
174                         "on_failure": [
175                             "handle_error"
176                         ]
177                     },
178                     "config-apply": {
179                         "description": "Activate K8s config template",
180                         "target": "k8s-config-apply",
181                         "activities": [
182                             {
183                                 "call_operation": "K8sConfigTemplateComponent.process"
184                             }
185                         ],
186                         "on_success": [
187                             "status-verification-script"
188                         ]
189                     },
190                     "status-verification-script": {
191                         "description": "Simple status verification script",
192                         "target": "simple-status-check",
193                         "activities": [
194                             {
195                                 "call_operation": "ComponentScriptExecutor.process"
196                             }
197                         ],
198                         "on_success": [
199                             "collect-results"
200                         ],
201                         "on_failure": [
202                             "handle_error"
203                         ]
204                     },
205                     "handle_error": {
206                         "description": "Simple error verification script",
207                         "target": "simple-error-check",
208                         "activities": [
209                             {
210                                 "call_operation": "ComponentScriptExecutor.process"
211                             }
212                         ],
213                         "on_success": [
214                             "collect-results"
215                         ]
216                     },
217                     "collect-results": {
218                         "description": "Final collection of results",
219                         "target": "collect-results"
220                     }
221                 },
222                 "inputs": {
223                     "resolution-key": {
224                         "required": true,
225                         "type": "string"
226                     },
227                     "config-deploy-properties": {
228                         "description": "Dynamic PropertyDefinition for workflow(config-deploy).",
229                         "required": true,
230                         "type": "dt-config-deploy-properties"
231                     }
232                 }
233             },
234             "health-check": {
235                 "steps": {
236                     "config-setup": {
237                         "description": "Gather necessary input for config init and status verification",
238                         "target": "config-setup-process",
239                         "activities": [
240                             {
241                                 "call_operation": "ResourceResolutionComponent.process"
242                             }
243                         ],
244                         "on_success": [
245                             "config-apply"
246                         ],
247                         "on_failure": [
248                             "handle_error"
249                         ]
250                     },
251                     "config-apply": {
252                         "description": "Activate K8s config template",
253                         "target": "k8s-config-apply",
254                         "activities": [
255                             {
256                                 "call_operation": "K8sConfigTemplateComponent.process"
257                             }
258                         ],
259                         "on_success": [
260                             "status-verification-script"
261                         ]
262                     },
263                     "status-verification-script": {
264                         "description": "Simple status verification script",
265                         "target": "simple-status-check",
266                         "activities": [
267                             {
268                                 "call_operation": "ComponentScriptExecutor.process"
269                             }
270                         ],
271                         "on_success": [
272                             "health-check-process"
273                         ],
274                         "on_failure": [
275                             "handle_error"
276                         ]
277                     },
278                     "health-check-process": {
279                         "description": "Start health check script",
280                         "target": "health-check-script",
281                         "activities": [
282                             {
283                                 "call_operation": "ComponentScriptExecutor.process"
284                             }
285                         ],
286                         "on_success": [
287                             "collect-results"
288                         ],
289                         "on_failure": [
290                             "handle_error"
291                         ]
292                     },
293                     "handle_error": {
294                         "description": "Simple error verification script",
295                         "target": "simple-error-check",
296                         "activities": [
297                             {
298                                 "call_operation": "ComponentScriptExecutor.process"
299                             }
300                         ],
301                         "on_success": [
302                             "collect-results"
303                         ]
304                     },
305                     "collect-results": {
306                         "description": "Final collection of results",
307                         "target": "collect-results"
308                     }
309                 },
310                 "inputs": {
311                     "resolution-key": {
312                         "required": true,
313                         "type": "string"
314                     },
315                     "config-deploy-properties": {
316                         "description": "Dynamic PropertyDefinition for workflow(config-deploy).",
317                         "required": true,
318                         "type": "dt-config-deploy-properties"
319                     }
320                 }
321             }
322         },
323         "node_templates": {
324             "resource-assignment": {
325                 "type": "component-resource-resolution",
326                 "interfaces": {
327                     "ResourceResolutionComponent": {
328                         "operations": {
329                             "process": {
330                                 "inputs": {
331                                     "artifact-prefix-names": {
332                                         "get_input": "template-prefix"
333                                     }
334                                 }
335                             }
336                         }
337                     }
338                 },
339                 "artifacts": {
340                     "helm_base_template-template": {
341                         "type": "artifact-template-velocity",
342                         "file": "Templates/base_template-template.vtl"
343                     },
344                     "helm_base_template-mapping": {
345                         "type": "artifact-mapping-resource",
346                         "file": "Templates/base_template-mapping.json"
347                     },
348                     "helm_vpkg-template": {
349                         "type": "artifact-template-velocity",
350                         "file": "Templates/vpkg-template.vtl"
351                     },
352                     "helm_vpkg-mapping": {
353                         "type": "artifact-mapping-resource",
354                         "file": "Templates/vpkg-mapping.json"
355                     },
356                     "helm_vfw-template": {
357                         "type": "artifact-template-velocity",
358                         "file": "Templates/vfw-template.vtl"
359                     },
360                     "helm_vfw-mapping": {
361                         "type": "artifact-mapping-resource",
362                         "file": "Templates/vfw-mapping.json"
363                     },
364                     "vnf-template": {
365                         "type": "artifact-template-velocity",
366                         "file": "Templates/vnf-template.vtl"
367                     },
368                     "vnf-mapping": {
369                         "type": "artifact-mapping-resource",
370                         "file": "Templates/vnf-mapping.json"
371                     },
372                     "helm_vsn-template": {
373                         "type": "artifact-template-velocity",
374                         "file": "Templates/vsn-template.vtl"
375                     },
376                     "helm_vsn-mapping": {
377                         "type": "artifact-mapping-resource",
378                         "file": "Templates/vsn-mapping.json"
379                     }
380                 }
381             },
382             "k8s-profile-upload": {
383                 "type": "component-k8s-profile-upload",
384                 "interfaces": {
385                     "K8sProfileUploadComponent": {
386                         "operations": {
387                             "process": {
388                                 "inputs": {
389                                     "artifact-prefix-names": {
390                                         "get_input": "template-prefix"
391                                     },
392                                     "resource-assignment-map": {
393                                         "get_attribute": [
394                                             "resource-assignment",
395                                             "assignment-map"
396                                         ]
397                                     }
398                                 }
399                             }
400                         }
401                     }
402                 },
403                 "artifacts": {
404                     "vfw-cnf-cds-base-profile": {
405                         "type": "artifact-k8sprofile-content",
406                         "file": "Templates/k8s-profiles/vfw-cnf-cds-base-profile.tar.gz"
407                     },
408                     "vfw-cnf-cds-vpkg-profile": {
409                         "type": "artifact-k8sprofile-content",
410                         "file": "Templates/k8s-profiles/vfw-cnf-cds-vpkg-profile"
411                     },
412                     "vfw-cnf-cds-vpkg-profile-mapping": {
413                         "type": "artifact-mapping-resource",
414                         "file": "Templates/k8s-profiles/vfw-cnf-cds-vpkg-profile/ssh-service-mapping.json"
415                     }
416                 }
417             },
418             "k8s-config-template": {
419                 "type": "component-k8s-config-template",
420                 "interfaces": {
421                     "K8sConfigTemplateComponent": {
422                         "operations": {
423                             "process": {
424                                 "inputs": {
425                                     "artifact-prefix-names": [
426                                         "helm_vpkg"
427                                     ],
428                                     "resource-assignment-map": {
429                                         "get_attribute": [
430                                             "config-setup-process",
431                                             "",
432                                             "assignment-map",
433                                             "config-deploy",
434                                             "config-deploy-setup"
435                                         ]
436                                     }
437                                 }
438                             }
439                         }
440                     }
441                 },
442                 "artifacts": {
443                     "ssh-service-config": {
444                         "type": "artifact-k8sconfig-content",
445                         "file": "Templates/k8s-configs/ssh-service.tar.gz"
446                     },
447                     "ssh-service-config-customizable": {
448                         "type": "artifact-k8sconfig-content",
449                         "file": "Templates/k8s-configs/ssh-service-config"
450                     },
451                     "ssh-service-config-customizable-mapping": {
452                         "type": "artifact-mapping-resource",
453                         "file": "Templates/k8s-configs/ssh-service-config/ssh-service-mapping.json"
454                     }
455                 }
456             },
457             "k8s-config-apply": {
458                 "type": "component-k8s-config-value",
459                 "interfaces": {
460                     "K8sConfigValueComponent": {
461                         "operations": {
462                             "process": {
463                                 "inputs": {
464                                     "artifact-prefix-names": [
465                                         "helm_vpkg"
466                                     ],
467                                     "k8s-config-operation-type": "create",
468                                     "resource-assignment-map": {
469                                         "get_attribute": [
470                                             "config-setup-process",
471                                             "",
472                                             "assignment-map",
473                                             "config-deploy",
474                                             "config-deploy-setup"
475                                         ]
476                                     }
477                                 }
478                             }
479                         }
480                     }
481                 },
482                 "artifacts": {
483                     "ssh-service-default": {
484                         "type": "artifact-k8sconfig-content",
485                         "file": "Templates/k8s-configs/ssh-service-config/values.yaml"
486                     },
487                     "ssh-service-config": {
488                         "type": "artifact-k8sconfig-content",
489                         "file": "Templates/k8s-configs/ssh-service-values/values.yaml.vtl"
490                     },
491                     "ssh-service-config-mapping": {
492                         "type": "artifact-mapping-resource",
493                         "file": "Templates/k8s-configs/ssh-service-values/ssh-service-mapping.json"
494                     }
495                 }
496             },
497             "simple-status-check": {
498                 "type": "component-script-executor",
499                 "interfaces": {
500                     "ComponentScriptExecutor": {
501                         "operations": {
502                             "process": {
503                                 "inputs": {
504                                     "script-type": "kotlin",
505                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.SimpleStatusCheck",
506                                     "instance-dependencies": [
507                                         "bluePrintPropertiesService"
508                                     ],
509                                     "dynamic-properties": "*simple-status-properties"
510                                 }
511                             }
512                         }
513                     }
514                 }
515             },
516             "simple-error-check": {
517                 "type": "component-script-executor",
518                 "interfaces": {
519                     "ComponentScriptExecutor": {
520                         "operations": {
521                             "process": {
522                                 "inputs": {
523                                     "script-type": "kotlin",
524                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.SimpleErrorCheck",
525                                     "instance-dependencies": [
526                                         "bluePrintPropertiesService"
527                                     ],
528                                     "dynamic-properties": "*simple-status-properties"
529                                 }
530                             }
531                         }
532                     }
533                 }
534             },
535             "health-check-script": {
536                 "type": "component-script-executor",
537                 "interfaces": {
538                     "ComponentScriptExecutor": {
539                         "operations": {
540                             "process": {
541                                 "inputs": {
542                                     "script-type": "kotlin",
543                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.K8sHealthCheck",
544                                     "instance-dependencies": [
545                                         "bluePrintPropertiesService"
546                                     ],
547                                     "dynamic-properties": "*simple-status-properties"
548                                 }
549                             }
550                         }
551                     }
552                 }
553             },
554             "config-setup-process": {
555                 "type": "component-resource-resolution",
556                 "interfaces": {
557                     "ResourceResolutionComponent": {
558                         "operations": {
559                             "process": {
560                                 "inputs": {
561                                     "resolution-key": {
562                                         "get_input": "resolution-key"
563                                     },
564                                     "store-result": false,
565                                     "artifact-prefix-names": [
566                                         "config-deploy"
567                                     ]
568                                 },
569                                 "outputs": {
570                                     "resource-assignment-params": {
571                                         "get_attribute": [
572                                             "SELF",
573                                             "assignment-params"
574                                         ]
575                                     },
576                                     "status": "success"
577                                 }
578                             }
579                         }
580                     }
581                 },
582                 "artifacts": {
583                     "config-deploy-template": {
584                         "type": "artifact-template-velocity",
585                         "file": "Templates/config-setup-template.vtl"
586                     },
587                     "config-deploy-mapping": {
588                         "type": "artifact-mapping-resource",
589                         "file": "Templates/config-setup-mapping.json"
590                     }
591                 }
592             },
593             "config-deploy-process": {
594                 "type": "component-script-executor",
595                 "interfaces": {
596                     "ComponentScriptExecutor": {
597                         "operations": {
598                             "process": {
599                                 "inputs": {
600                                     "script-type": "kotlin",
601                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.ConfigDeploy",
602                                     "dynamic-properties": "*config-deploy-properties"
603                                 }
604                             }
605                         }
606                     }
607                 }
608             },
609             "collect-results": {
610                 "type": "component-script-executor",
611                 "interfaces": {
612                     "ComponentScriptExecutor": {
613                         "operations": {
614                             "process": {
615                                 "implementation": {
616                                     "primary": "component-script",
617                                     "timeout": 180,
618                                     "operation_host": "SELF"
619                                 },
620                                 "inputs": {
621                                     "script-type": "kotlin",
622                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.CollectorScript"
623                                 },
624                                 "outputs": {}
625                             }
626                         }
627                     }
628                 }
629             }
630         }
631     }
632 }