aboutsummaryrefslogtreecommitdiffstats
path: root/src/onapsdk/so/templates/instantiate_vnf_macro_so_vnf.json.j2
blob: c7f43561cc9393afb27240d57349d0966acb7845 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
{
    "requestDetails": {
        "requestInfo": {
            "instanceName": "{{ service_instance.instance_name }}",
            "source": "VID",
            "suppressRollback": false,
            "requestorId": "demo",
            "productFamilyId": "1234"
        },
        "modelInfo": {
            "modelType": "vnf",
            "modelInvariantId": "{{ vnf.model_invariant_id }}",
            "modelVersionId": "{{ vnf.model_version_id }}",
            "modelName": "{{ vnf.model_name }}",
            "modelVersion": "{{ vnf.model_version }}",
            "modelCustomizationId": "{{ vnf.model_customization_id }}",
            "modelInstanceName": "{{ vnf.name }}"
        },
        "cloudConfiguration": {
            "tenantId": "{{ tenant.tenant_id }}",
            "cloudOwner": "{{ cloud_region.cloud_owner }}",
            "lcpCloudRegionId": "{{ cloud_region.cloud_region_id }}"
        },
        "platform": {
            "platformName": "{{ platform }}"
        },
        "lineOfBusiness": {
            "lineOfBusinessName": "{{ line_of_business }}"
        },
        "subscriberInfo": {
            "globalSubscriberId": "{{ service_instance.service_subscription.customer.global_customer_id }}"
        },
        "requestParameters": {
            {% block subscriptionServiceType %}
            "subscriptionServiceType": "{{ service.name }}",
            {% endblock %}
            "userParams": [
                {
                    "Homing_Solution": "none"
                },
                {
                    "service": {
                        "instanceParams": [],
                        "resources": {
                            {% block vnfs %}
                            "vnfs": [
                                {
                                    "modelInfo": {
                                        "modelName": "{{ vnf.model_name }}",
                                        "modelVersionId": "{{ vnf.model_version_id }}",
                                        "modelInvariantUuid": "{{ vnf.model_invariant_id }}",
                                        "modelVersion": "{{ vnf.model_version }}",
                                        "modelCustomizationId": "{{ vnf.model_customization_id }}",
                                        "modelInstanceName": "{{ vnf.name }}"
                                    },
                                    "cloudConfiguration": {
                                        "tenantId": "{{ tenant.tenant_id }}",
                                        "cloudOwner": "{{ cloud_region.cloud_owner }}",
                                        "lcpCloudRegionId": "{{ cloud_region.cloud_region_id }}"
                                    },
                                    "platform": {
                                        "platformName": "{{ platform }}"
                                    },
                                    "lineOfBusiness": {
                                        "lineOfBusinessName": "{{ line_of_business }}"
                                    },
                                    "productFamilyId": "1234",
                                    "instanceName": "{{ instance_name }}",
                                    "instanceParams": [
                                        {
                                            {% for key, value in so_vnf.parameters.items() %}
                                            "{{ key }}": "{{ value }}"{% if not loop.last %},{% endif %}
                                            {% endfor %}
                                        }
                                    ],
                                    "vfModules": [
                                        {% for vf_module in so_vnf.vf_modules %}
                                        {
                                            "modelInfo": {

                                                {% if vnf.model_name == so_vnf.model_name %}
                                                {% for sdc_vf_module in vnf.vf_modules %}
                                                {% set mylist = sdc_vf_module.name.split('..') %}
                                                {% set item = mylist|length-2 %}
                                                {% if vf_module.model_name == mylist[item] %}
                                                "modelName": "{{ sdc_vf_module.model_name }}",
                                                "modelVersionId": "{{ sdc_vf_module.model_version_id}}",
                                                "modelInvariantUuid": "{{ sdc_vf_module.model_invariant_uuid }}",
                                                "modelVersion": "{{ sdc_vf_module.model_version }}",
                                                "modelCustomizationId": "{{ sdc_vf_module.model_customization_id }}"
                                                {% endif %}
                                                {% endfor %}
                                                {% endif %}

                                            },
                                            "instanceName": "{{ vf_module.instance_name }}",
                                            {% if vf_module.processing_priority %}
                                            "processingPriority": "{{ vf_module.processing_priority }}",
                                            {% endif %}
                                            "instanceParams": [
                                                {
                                                    {% for key, value in vf_module.parameters.items() %}
                                                    "{{ key }}": "{{ value }}"{% if not loop.last %},{% endif %}
                                                    {% endfor %}
                                                }
                                            ]
                                        }{% if not loop.last %},{% endif %}
                                        {% endfor %}
                                    ]
                                }
                            ]
                            {% endblock %}
                        },
                        "modelInfo": {
                            "modelType": "vnf",
                            "modelInvariantId": "{{ vnf.model_invariant_id }}",
                            "modelVersionId": "{{ vnf.model_version_id }}",
                            "modelName": "{{ vnf.model_name }}",
                            "modelVersion": "{{ vnf.model_version }}",
                            "modelCustomizationId": "{{ vnf.model_customization_id }}",
                            "modelCustomizationName": "{{ vnf.name }}"
                        }
                    }
                }
            ],
            "aLaCarte": false
        },
        "project": {
            "projectName": "{{ project }}"
        },
        "owningEntity": {
            "owningEntityId": "{{ owning_entity.owning_entity_id }}",
            "owningEntityName": "{{ owning_entity.name }}"
        },
        "relatedInstanceList": [
            {
                "relatedInstance": {
                    "instanceId": "{{ service_instance.instance_id }}",
                    "modelInfo": {
                        "modelType": "service",
                        "modelInvariantId": "{{ service.unique_uuid }}",
                        "modelVersionId": "{{ service.identifier }}",
                        "modelName": "{{ service.name }}",
                        "modelVersion": "1.0"
                    }
                }
            }
        ]
    },
    "serviceInstanceId": "{{ service_instance.instance_id }}"
}