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