bf1a423bc57494f0d32147170ca08bacdd986108
[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                 "artifacts": {
598                     "deployment-config": {
599                         "type": "artifact-k8sconfig-content",
600                         "file": "Templates/k8s-configs/deployment-config.tar.gz"
601                     }
602                 }
603             },
604             "k8s-config-apply": {
605                 "type": "component-k8s-config-value",
606                 "interfaces": {
607                     "K8sConfigValueComponent": {
608                         "operations": {
609                             "process": {
610                                 "inputs": {
611                                     "artifact-prefix-names": [
612                                         "helm_apache"
613                                     ],
614                                     "k8s-config-operation-type": "create",
615                                     "resource-assignment-map": {
616                                         "get_attribute": [
617                                             "config-setup-process",
618                                             "",
619                                             "assignment-map",
620                                             "config-deploy",
621                                             "config-deploy-setup"
622                                         ]
623                                     }
624                                 }
625                             }
626                         }
627                     }
628                 },
629                 "artifacts": {
630                     "default-values": {
631                         "type": "artifact-k8sconfig-content",
632                         "file": "Templates/k8s-configs/deployment-values/default-values.yaml"
633                     },
634                     "restore-values": {
635                         "type": "artifact-k8sconfig-content",
636                         "file": "Templates/k8s-configs/deployment-values/restore-values.yaml"
637                     },
638                     "custom-values": {
639                         "type": "artifact-k8sconfig-content",
640                         "file": "Templates/k8s-configs/deployment-values/values.yaml.vtl"
641                     },
642                     "custom-values-mapping": {
643                         "type": "artifact-mapping-resource",
644                         "file": "Templates/k8s-configs/deployment-values/values-mapping.json"
645                     }
646                 }
647             },
648             "k8s-config-restore": {
649                 "type": "component-k8s-config-value",
650                 "interfaces": {
651                     "K8sConfigValueComponent": {
652                         "operations": {
653                             "process": {
654                                 "inputs": {
655                                     "artifact-prefix-names": [
656                                         "helm_apache"
657                                     ],
658                                     "k8s-config-operation-type": "update",
659                                     "k8s-rb-config-value-source": "restore-values",
660                                     "resource-assignment-map": {
661                                         "get_attribute": [
662                                             "config-setup-process",
663                                             "",
664                                             "assignment-map",
665                                             "config-deploy",
666                                             "config-deploy-setup"
667                                         ]
668                                     }
669                                 }
670                             }
671                         }
672                     }
673                 },
674                 "artifacts": {
675                     "restore-values": {
676                         "type": "artifact-k8sconfig-content",
677                         "file": "Templates/k8s-configs/deployment-values/restore-values.yaml"
678                     }
679                 }
680             },
681             "k8s-config-update": {
682                 "type": "component-k8s-config-value",
683                 "interfaces": {
684                     "K8sConfigValueComponent": {
685                         "operations": {
686                             "process": {
687                                 "inputs": {
688                                     "artifact-prefix-names": [
689                                         "helm_apache"
690                                     ],
691                                     "k8s-config-operation-type": "update",
692                                     "k8s-rb-config-value-source": "custom-values",
693                                     "resource-assignment-map": {
694                                         "get_attribute": [
695                                             "config-setup-process",
696                                             "",
697                                             "assignment-map",
698                                             "config-deploy",
699                                             "config-deploy-setup"
700                                         ]
701                                     }
702                                 }
703                             }
704                         }
705                     }
706                 },
707                 "artifacts": {
708                     "custom-values": {
709                         "type": "artifact-k8sconfig-content",
710                         "file": "Templates/k8s-configs/deployment-values/values.yaml.vtl"
711                     },
712                     "custom-values-mapping": {
713                         "type": "artifact-mapping-resource",
714                         "file": "Templates/k8s-configs/deployment-values/values-mapping.json"
715                     }
716                 }
717             },
718             "simple-status-check": {
719                 "type": "component-script-executor",
720                 "interfaces": {
721                     "ComponentScriptExecutor": {
722                         "operations": {
723                             "process": {
724                                 "inputs": {
725                                     "script-type": "kotlin",
726                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.SimpleStatusCheck",
727                                     "instance-dependencies": [
728                                         "bluePrintPropertiesService"
729                                     ],
730                                     "dynamic-properties": "*simple-status-properties"
731                                 }
732                             }
733                         }
734                     }
735                 }
736             },
737             "simple-error-check": {
738                 "type": "component-script-executor",
739                 "interfaces": {
740                     "ComponentScriptExecutor": {
741                         "operations": {
742                             "process": {
743                                 "inputs": {
744                                     "script-type": "kotlin",
745                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.SimpleErrorCheck",
746                                     "instance-dependencies": [
747                                         "bluePrintPropertiesService"
748                                     ],
749                                     "dynamic-properties": "*simple-status-properties"
750                                 }
751                             }
752                         }
753                     }
754                 }
755             },
756             "health-check-script": {
757                 "type": "component-script-executor",
758                 "interfaces": {
759                     "ComponentScriptExecutor": {
760                         "operations": {
761                             "process": {
762                                 "inputs": {
763                                     "script-type": "kotlin",
764                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.K8sHealthCheck",
765                                     "instance-dependencies": [
766                                         "bluePrintPropertiesService"
767                                     ],
768                                     "dynamic-properties": "*simple-status-properties"
769                                 }
770                             }
771                         }
772                     }
773                 }
774             },
775             "config-setup-process": {
776                 "type": "component-resource-resolution",
777                 "interfaces": {
778                     "ResourceResolutionComponent": {
779                         "operations": {
780                             "process": {
781                                 "inputs": {
782                                     "resolution-key": {
783                                         "get_input": "resolution-key"
784                                     },
785                                     "store-result": false,
786                                     "artifact-prefix-names": [
787                                         "config-deploy"
788                                     ]
789                                 },
790                                 "outputs": {
791                                     "resource-assignment-params": {
792                                         "get_attribute": [
793                                             "SELF",
794                                             "assignment-params"
795                                         ]
796                                     },
797                                     "status": "success"
798                                 }
799                             }
800                         }
801                     }
802                 },
803                 "artifacts": {
804                     "config-deploy-template": {
805                         "type": "artifact-template-velocity",
806                         "file": "Templates/config-setup-template.vtl"
807                     },
808                     "config-deploy-mapping": {
809                         "type": "artifact-mapping-resource",
810                         "file": "Templates/config-setup-mapping.json"
811                     }
812                 }
813             },
814             "config-deploy-process": {
815                 "type": "component-script-executor",
816                 "interfaces": {
817                     "ComponentScriptExecutor": {
818                         "operations": {
819                             "process": {
820                                 "inputs": {
821                                     "script-type": "kotlin",
822                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.ConfigDeploy",
823                                     "dynamic-properties": "*config-deploy-properties"
824                                 }
825                             }
826                         }
827                     }
828                 }
829             },
830             "collect-results": {
831                 "type": "component-script-executor",
832                 "interfaces": {
833                     "ComponentScriptExecutor": {
834                         "operations": {
835                             "process": {
836                                 "implementation": {
837                                     "primary": "component-script",
838                                     "timeout": 180,
839                                     "operation_host": "SELF"
840                                 },
841                                 "inputs": {
842                                     "script-type": "kotlin",
843                                     "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.CollectorScript"
844                                 },
845                                 "outputs": {}
846                             }
847                         }
848                     }
849                 }
850             }
851         }
852     }
853 }