[APACHECNF] Various updates of the demo
[demo.git] / tutorials / ApacheCNF / templates / cba / Definitions / CNF.json
1 {
2     "tosca_definitions_version": "controller_blueprint_1_0_0",
3     "metadata": {
4         "template_author": "Lukasz Rajewski <lukasz.rajewski@orange.com>",
5         "author-email": "lukasz.rajewski@orange.com",
6         "user-groups": "ADMIN, OPERATION",
7         "template_name": "APACHE",
8         "template_version": "1.0.0",
9         "template_tags": "Lukasz Rajewski, CNF",
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                             "status-verification-script"
173                         ]
174                     },
175                     "status-verification-script": {
176                         "description": "Simple status verification script",
177                         "target": "simple-status-check",
178                         "activities": [
179                             {
180                                 "call_operation": "ComponentScriptExecutor.process"
181                             }
182                         ],
183                         "on_success": [
184                             "config-apply"
185                         ]
186                     },
187                     "config-apply": {
188                         "description": "Activate K8s config template",
189                         "target": "k8s-config-apply",
190                         "activities": [
191                             {
192                                 "call_operation": "K8sConfigValueComponent.process"
193                             }
194                         ],
195                         "on_success": [
196                             "status-verification-script-after"
197                         ]
198                     },
199                     "status-verification-script-after": {
200                         "description": "Simple status verification script",
201                         "target": "simple-status-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             "scale-out": {
229                 "steps": {
230                     "config-setup": {
231                         "description": "Gather necessary input for config init and status verification",
232                         "target": "config-setup-process",
233                         "activities": [
234                             {
235                                 "call_operation": "ResourceResolutionComponent.process"
236                             }
237                         ],
238                         "on_success": [
239                             "config-template"
240                         ]
241                     },
242                     "config-template": {
243                         "description": "Generate and upload K8s config template",
244                         "target": "k8s-config-template",
245                         "activities": [
246                             {
247                                 "call_operation": "K8sConfigTemplateComponent.process"
248                             }
249                         ],
250                         "on_success": [
251                             "config-apply"
252                         ]
253                     },
254                     "config-apply": {
255                         "description": "Activate K8s config apply",
256                         "target": "k8s-config-apply",
257                         "activities": [
258                             {
259                                 "call_operation": "K8sConfigValueComponent.process"
260                             }
261                         ],
262                         "on_success": [
263                             "status-verification-script-after"
264                         ]
265                     },
266                     "status-verification-script-after": {
267                         "description": "Simple status verification script",
268                         "target": "simple-status-check",
269                         "activities": [
270                             {
271                                 "call_operation": "ComponentScriptExecutor.process"
272                             }
273                         ],
274                         "on_success": [
275                             "collect-results"
276                         ]
277                     },
278                     "collect-results": {
279                         "description": "Final collection of results",
280                         "target": "collect-results"
281                     }
282                 },
283                 "inputs": {
284                     "resolution-key": {
285                         "required": true,
286                         "type": "string"
287                     },
288                     "scale-out-properties": {
289                         "description": "Dynamic PropertyDefinition for workflow(scale-out).",
290                         "required": true,
291                         "type": "dt-scale-out-properties"
292                     }
293                 }
294             },
295             "scale": {
296                 "steps": {
297                     "config-setup": {
298                         "description": "Gather necessary input for config init and status verification",
299                         "target": "config-setup-process",
300                         "activities": [
301                             {
302                                 "call_operation": "ResourceResolutionComponent.process"
303                             }
304                         ],
305                         "on_success": [
306                             "config-template"
307                         ]
308                     },
309                     "config-template": {
310                         "description": "Generate and upload K8s config template",
311                         "target": "k8s-config-template",
312                         "activities": [
313                             {
314                                 "call_operation": "K8sConfigTemplateComponent.process"
315                             }
316                         ],
317                         "on_success": [
318                             "config-update"
319                         ]
320                     },
321                     "config-update": {
322                         "description": "Activate K8s config restore",
323                         "target": "k8s-config-update",
324                         "activities": [
325                             {
326                                 "call_operation": "K8sConfigValueComponent.process"
327                             }
328                         ],
329                         "on_success": [
330                             "status-verification-script-after"
331                         ]
332                     },
333                     "status-verification-script-after": {
334                         "description": "Simple status verification script",
335                         "target": "simple-status-check",
336                         "activities": [
337                             {
338                                 "call_operation": "ComponentScriptExecutor.process"
339                             }
340                         ],
341                         "on_success": [
342                             "collect-results"
343                         ]
344                     },
345                     "collect-results": {
346                         "description": "Final collection of results",
347                         "target": "collect-results"
348                     }
349                 },
350                 "inputs": {
351                     "resolution-key": {
352                         "required": true,
353                         "type": "string"
354                     },
355                     "scale-properties": {
356                         "description": "Dynamic PropertyDefinition for workflow(scale).",
357                         "required": true,
358                         "type": "dt-scale-properties"
359                     }
360                 }
361             },
362             "scale-in": {
363                 "steps": {
364                     "config-setup": {
365                         "description": "Gather necessary input for config init and status verification",
366                         "target": "config-setup-process",
367                         "activities": [
368                             {
369                                 "call_operation": "ResourceResolutionComponent.process"
370                             }
371                         ],
372                         "on_success": [
373                             "config-template"
374                         ]
375                     },
376                     "config-template": {
377                         "description": "Generate and upload K8s config template",
378                         "target": "k8s-config-template",
379                         "activities": [
380                             {
381                                 "call_operation": "K8sConfigTemplateComponent.process"
382                             }
383                         ],
384                         "on_success": [
385                             "config-restore"
386                         ]
387                     },
388                     "config-restore": {
389                         "description": "Activate K8s config restore",
390                         "target": "k8s-config-restore",
391                         "activities": [
392                             {
393                                 "call_operation": "K8sConfigValueComponent.process"
394                             }
395                         ],
396                         "on_success": [
397                             "status-verification-script-after"
398                         ]
399                     },
400                     "status-verification-script-after": {
401                         "description": "Simple status verification script",
402                         "target": "simple-status-check",
403                         "activities": [
404                             {
405                                 "call_operation": "ComponentScriptExecutor.process"
406                             }
407                         ],
408                         "on_success": [
409                             "collect-results"
410                         ]
411                     },
412                     "collect-results": {
413                         "description": "Final collection of results",
414                         "target": "collect-results"
415                     }
416                 },
417                 "inputs": {
418                     "resolution-key": {
419                         "required": true,
420                         "type": "string"
421                     },
422                     "scale-in-properties": {
423                         "description": "Dynamic PropertyDefinition for workflow(scale-in).",
424                         "required": true,
425                         "type": "dt-scale-in-properties"
426                     }
427                 }
428             },
429             "health-check": {
430                 "steps": {
431                     "config-setup": {
432                         "description": "Gather necessary input for config init and status verification",
433                         "target": "config-setup-process",
434                         "activities": [
435                             {
436                                 "call_operation": "ResourceResolutionComponent.process"
437                             }
438                         ],
439                         "on_success": [
440                             "status-verification-script"
441                         ],
442                         "on_failure": [
443                             "handle_error"
444                         ]
445                     },
446                     "status-verification-script": {
447                         "description": "Simple status verification script",
448                         "target": "simple-status-check",
449                         "activities": [
450                             {
451                                 "call_operation": "ComponentScriptExecutor.process"
452                             }
453                         ],
454                         "on_success": [
455                             "health-check-process"
456                         ],
457                         "on_failure": [
458                             "handle_error"
459                         ]
460                     },
461                     "health-check-process": {
462                         "description": "Start health check script",
463                         "target": "health-check-script",
464                         "activities": [
465                             {
466                                 "call_operation": "ComponentScriptExecutor.process"
467                             }
468                         ],
469                         "on_success": [
470                             "collect-results"
471                         ],
472                         "on_failure": [
473                             "handle_error"
474                         ]
475                     },
476                     "handle_error": {
477                         "description": "Simple error verification script",
478                         "target": "simple-error-check",
479                         "activities": [
480                             {
481                                 "call_operation": "ComponentScriptExecutor.process"
482                             }
483                         ],
484                         "on_success": [
485                             "collect-results"
486                         ]
487                     },
488                     "collect-results": {
489                         "description": "Final collection of results",
490                         "target": "collect-results"
491                     }
492                 },
493                 "inputs": {
494                     "resolution-key": {
495                         "required": true,
496                         "type": "string"
497                     },
498                     "health-check-properties": {
499                         "description": "Dynamic PropertyDefinition for workflow(health-check).",
500                         "required": true,
501                         "type": "dt-health-check-properties"
502                     }
503                 }
504             }
505         },
506         "node_templates": {
507             "resource-assignment": {
508                 "type": "component-resource-resolution",
509                 "interfaces": {
510                     "ResourceResolutionComponent": {
511                         "operations": {
512                             "process": {
513                                 "inputs": {
514                                     "artifact-prefix-names": {
515                                         "get_input": "template-prefix"
516                                     }
517                                 }
518                             }
519                         }
520                     }
521                 },
522                 "artifacts": {
523                     "helm_apache-template": {
524                         "type": "artifact-template-velocity",
525                         "file": "Templates/cnf-template.vtl"
526                     },
527                     "helm_apache-mapping": {
528                         "type": "artifact-mapping-resource",
529                         "file": "Templates/cnf-mapping.json"
530                     },
531                     "vnf-template": {
532                         "type": "artifact-template-velocity",
533                         "file": "Templates/vnf-template.vtl"
534                     },
535                     "vnf-mapping": {
536                         "type": "artifact-mapping-resource",
537                         "file": "Templates/vnf-mapping.json"
538                     }
539                 }
540             },
541             "k8s-profile-upload": {
542                 "type": "component-k8s-profile-upload",
543                 "interfaces": {
544                     "K8sProfileUploadComponent": {
545                         "operations": {
546                             "process": {
547                                 "inputs": {
548                                     "artifact-prefix-names": {
549                                         "get_input": "template-prefix"
550                                     },
551                                     "resource-assignment-map": {
552                                         "get_attribute": [
553                                             "resource-assignment",
554                                             "assignment-map"
555                                         ]
556                                     }
557                                 }
558                             }
559                         }
560                     }
561                 },
562                 "artifacts": {
563                     "cnf-cds-base-profile": {
564                         "type": "artifact-k8sprofile-content",
565                         "file": "Templates/k8s-profiles/cnf-cds-base-profile.tar.gz"
566                     },
567                     "node-port-profile": {
568                         "type": "artifact-k8sprofile-content",
569                         "file": "Templates/k8s-profiles/node-port-profile.tar.gz"
570                     }
571                 }
572             },
573             "k8s-config-template": {
574                 "type": "component-k8s-config-template",
575                 "interfaces": {
576                     "K8sConfigTemplateComponent": {
577                         "operations": {
578                             "process": {
579                                 "inputs": {
580                                     "artifact-prefix-names": [
581                                         "helm_apache"
582                                     ],
583                                     "resource-assignment-map": {
584                                         "get_attribute": [
585                                             "config-setup-process",
586                                             "",
587                                             "assignment-map",
588                                             "config-deploy",
589                                             "config-deploy-setup"
590                                         ]
591                                     }
592                                 }
593                             }
594                         }
595                     }
596                 }
597             },
598             "k8s-config-apply": {
599                 "type": "component-k8s-config-value",
600                 "interfaces": {
601                     "K8sConfigValueComponent": {
602                         "operations": {
603                             "process": {
604                                 "inputs": {
605                                     "artifact-prefix-names": [
606                                         "helm_apache"
607                                     ],
608                                     "k8s-config-operation-type": "create",
609                                     "resource-assignment-map": {
610                                         "get_attribute": [
611                                             "config-setup-process",
612                                             "",
613                                             "assignment-map",
614                                             "config-deploy",
615                                             "config-deploy-setup"
616                                         ]
617                                     }
618                                 }
619                             }
620                         }
621                     }
622                 },
623                 "artifacts": {
624                     "default-values": {
625                         "type": "artifact-k8sconfig-content",
626                         "file": "Templates/k8s-configs/deployment-values/default-values.yaml"
627                     },
628                     "restore-values": {
629                         "type": "artifact-k8sconfig-content",
630                         "file": "Templates/k8s-configs/deployment-values/restore-values.yaml"
631                     },
632                     "custom-values": {
633                         "type": "artifact-k8sconfig-content",
634                         "file": "Templates/k8s-configs/deployment-values/values.yaml.vtl"
635                     },
636                     "custom-values-mapping": {
637                         "type": "artifact-mapping-resource",
638                         "file": "Templates/k8s-configs/deployment-values/values-mapping.json"
639                     }
640                 }
641             },
642             "k8s-config-restore": {
643                 "type": "component-k8s-config-value",
644                 "interfaces": {
645                     "K8sConfigValueComponent": {
646                         "operations": {
647                             "process": {
648                                 "inputs": {
649                                     "artifact-prefix-names": [
650                                         "helm_apache"
651                                     ],
652                                     "k8s-config-operation-type": "update",
653                                     "k8s-rb-config-value-source": "restore-values",
654                                     "resource-assignment-map": {
655                                         "get_attribute": [
656                                             "config-setup-process",
657                                             "",
658                                             "assignment-map",
659                                             "config-deploy",
660                                             "config-deploy-setup"
661                                         ]
662                                     }
663                                 }
664                             }
665                         }
666                     }
667                 },
668                 "artifacts": {
669                     "restore-values": {
670                         "type": "artifact-k8sconfig-content",
671                         "file": "Templates/k8s-configs/deployment-values/restore-values.yaml"
672                     }
673                 }
674             },
675             "k8s-config-update": {
676                 "type": "component-k8s-config-value",
677                 "interfaces": {
678                     "K8sConfigValueComponent": {
679                         "operations": {
680                             "process": {
681                                 "inputs": {
682                                     "artifact-prefix-names": [
683                                         "helm_apache"
684                                     ],
685                                     "k8s-config-operation-type": "update",
686                                     "k8s-rb-config-value-source": "custom-values",
687                                     "resource-assignment-map": {
688                                         "get_attribute": [
689                                             "config-setup-process",
690                                             "",
691                                             "assignment-map",
692                                             "config-deploy",
693                                             "config-deploy-setup"
694                                         ]
695                                     }
696                                 }
697                             }
698                         }
699                     }
700                 },
701                 "artifacts": {
702                     "custom-values": {
703                         "type": "artifact-k8sconfig-content",
704                         "file": "Templates/k8s-configs/deployment-values/values.yaml.vtl"
705                     },
706                     "custom-values-mapping": {
707                         "type": "artifact-mapping-resource",
708                         "file": "Templates/k8s-configs/deployment-values/values-mapping.json"
709                     }
710                 }
711             },
712             "simple-status-check": {
713                 "type": "component-script-executor",
714                 "interfaces": {
715                     "ComponentScriptExecutor": {
716                         "operations": {
717                             "process": {
718                                 "inputs": {
719                                     "script-type": "kotlin",
720                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.SimpleStatusCheck",
721                                     "instance-dependencies": [
722                                         "bluePrintPropertiesService"
723                                     ],
724                                     "dynamic-properties": "*simple-status-properties"
725                                 }
726                             }
727                         }
728                     }
729                 }
730             },
731             "simple-error-check": {
732                 "type": "component-script-executor",
733                 "interfaces": {
734                     "ComponentScriptExecutor": {
735                         "operations": {
736                             "process": {
737                                 "inputs": {
738                                     "script-type": "kotlin",
739                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.SimpleErrorCheck",
740                                     "instance-dependencies": [
741                                         "bluePrintPropertiesService"
742                                     ],
743                                     "dynamic-properties": "*simple-status-properties"
744                                 }
745                             }
746                         }
747                     }
748                 }
749             },
750             "health-check-script": {
751                 "type": "component-script-executor",
752                 "interfaces": {
753                     "ComponentScriptExecutor": {
754                         "operations": {
755                             "process": {
756                                 "inputs": {
757                                     "script-type": "kotlin",
758                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.K8sHealthCheck",
759                                     "instance-dependencies": [
760                                         "bluePrintPropertiesService"
761                                     ],
762                                     "dynamic-properties": "*simple-status-properties"
763                                 }
764                             }
765                         }
766                     }
767                 }
768             },
769             "config-setup-process": {
770                 "type": "component-resource-resolution",
771                 "interfaces": {
772                     "ResourceResolutionComponent": {
773                         "operations": {
774                             "process": {
775                                 "inputs": {
776                                     "resolution-key": {
777                                         "get_input": "resolution-key"
778                                     },
779                                     "store-result": false,
780                                     "artifact-prefix-names": [
781                                         "config-deploy"
782                                     ]
783                                 },
784                                 "outputs": {
785                                     "resource-assignment-params": {
786                                         "get_attribute": [
787                                             "SELF",
788                                             "assignment-params"
789                                         ]
790                                     },
791                                     "status": "success"
792                                 }
793                             }
794                         }
795                     }
796                 },
797                 "artifacts": {
798                     "config-deploy-template": {
799                         "type": "artifact-template-velocity",
800                         "file": "Templates/config-setup-template.vtl"
801                     },
802                     "config-deploy-mapping": {
803                         "type": "artifact-mapping-resource",
804                         "file": "Templates/config-setup-mapping.json"
805                     }
806                 }
807             },
808             "config-deploy-process": {
809                 "type": "component-script-executor",
810                 "interfaces": {
811                     "ComponentScriptExecutor": {
812                         "operations": {
813                             "process": {
814                                 "inputs": {
815                                     "script-type": "kotlin",
816                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.ConfigDeploy",
817                                     "dynamic-properties": "*config-deploy-properties"
818                                 }
819                             }
820                         }
821                     }
822                 }
823             },
824             "collect-results": {
825                 "type": "component-script-executor",
826                 "interfaces": {
827                     "ComponentScriptExecutor": {
828                         "operations": {
829                             "process": {
830                                 "implementation": {
831                                     "primary": "component-script",
832                                     "timeout": 180,
833                                     "operation_host": "SELF"
834                                 },
835                                 "inputs": {
836                                     "script-type": "kotlin",
837                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.CollectorScript"
838                                 },
839                                 "outputs": {}
840                             }
841                         }
842                     }
843                 }
844             }
845         }
846     }
847 }