diff options
author | Abhishek Patil <abhishek.patil@t-systems.com> | 2023-07-27 16:32:17 +0530 |
---|---|---|
committer | Abhishek Patil <abhishek.patil@t-systems.com> | 2023-07-27 19:17:15 +0530 |
commit | 3d3d3574f1012a7faa6cf86d55884cf0884decbf (patch) | |
tree | 2e74807f6258f496cd02ef0d9ca3915a23294953 /src/onapsdk/so/templates | |
parent | 48f63ef8e43f789cc6d364d387df289094edfc25 (diff) |
ONAP SDK to add new PNF functionality
Issue-ID: TEST-401
Change-Id: Ib603b9aaad43bb8c55ff5c2c23cd9a1a36475de9
Signed-off-by: Abhishek Patil <abhishek.patil@t-systems.com>
Diffstat (limited to 'src/onapsdk/so/templates')
5 files changed, 290 insertions, 26 deletions
diff --git a/src/onapsdk/so/templates/deletion_pnf.json.j2 b/src/onapsdk/so/templates/deletion_pnf.json.j2 index 852432a..4e8770d 100644 --- a/src/onapsdk/so/templates/deletion_pnf.json.j2 +++ b/src/onapsdk/so/templates/deletion_pnf.json.j2 @@ -16,12 +16,6 @@ "requestParameters": { "testApi": "GR_API", "aLaCarte": {{ a_la_carte | tojson }} - }, - {# the code below is needed to be refactored # - } - {# https: //gitlab.com/Orange-OpenSource/lfn/onap/python-onapsdk/-/issues/133 #} "cloudConfiguration": { "cloudOwner": "{{ pnf_instance.service_instance.service_subscription.cloud_region.cloud_owner }}", - "lcpCloudRegionId": "{{ pnf_instance.service_instance.service_subscription.cloud_region.cloud_region_id }}", - "tenantId": "{{ pnf_instance.service_instance.service_subscription.tenant.tenant_id }}" } } }
\ No newline at end of file diff --git a/src/onapsdk/so/templates/instantiate_pnf_macro.json.j2 b/src/onapsdk/so/templates/instantiate_pnf_macro.json.j2 index 6abfe84..1f9b3a2 100755 --- a/src/onapsdk/so/templates/instantiate_pnf_macro.json.j2 +++ b/src/onapsdk/so/templates/instantiate_pnf_macro.json.j2 @@ -16,11 +16,6 @@ "modelCustomizationId": "{{ pnf.model_customization_id }}",
"modelInstanceName": "{{ pnf.name }}"
},
- "cloudConfiguration": {
- "tenantId": "{{ tenant.tenant_id }}",
- "cloudOwner": "{{ cloud_region.cloud_owner }}",
- "lcpCloudRegionId": "{{ cloud_region.cloud_region_id }}"
- },
"platform": {
"platformName": "{{ platform }}"
},
@@ -53,11 +48,6 @@ "modelCustomizationId": "{{ pnf.model_customization_id }}",
"modelInstanceName": "{{ pnf.name }}"
},
- "cloudConfiguration": {
- "tenantId": "{{ tenant.tenant_id }}",
- "cloudOwner": "{{ cloud_region.cloud_owner }}",
- "lcpCloudRegionId": "{{ cloud_region.cloud_region_id }}"
- },
"platform": {
"platformName": "{{ platform }}"
},
diff --git a/src/onapsdk/so/templates/instantiate_pnf_macro_in_service.json.j2 b/src/onapsdk/so/templates/instantiate_pnf_macro_in_service.json.j2 new file mode 100644 index 0000000..b38c985 --- /dev/null +++ b/src/onapsdk/so/templates/instantiate_pnf_macro_in_service.json.j2 @@ -0,0 +1,109 @@ +instantiate_service_macro_skip_pnf_registration_event.json.j2{ + "requestDetails": { + "requestInfo": { + "instanceName": "{{ service_instance.instance_name }}", + "source": "VID", + "suppressRollback": false, + "requestorId": "demo", + "productFamilyId": "1234" + }, + "modelInfo": { + "modelType": "pnf", + "modelInvariantId": "{{ pnf.model_invariant_id }}", + "modelVersionId": "{{ pnf.model_version_id }}", + "modelName": "{{ pnf.model_name }}", + "modelVersion": "{{ pnf.model_version }}", + "modelCustomizationId": "{{ pnf.model_customization_id }}", + "modelInstanceName": "{{ pnf.name }}" + }, + "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 pnfs %} + "pnfs": [ + { + "modelInfo": { + "modelName": "{{ pnf.model_name }}", + "modelVersionId": "{{ pnf.model_version_id }}", + "modelInvariantUuid": "{{ pnf.model_invariant_id }}", + "modelVersion": "{{ pnf.model_version }}", + "modelCustomizationId": "{{ pnf.model_customization_id }}", + "modelInstanceName": "{{ pnf.name }}" + }, + "pnfRegistrationFields": { + "modelNumber": "Simulated Device Melacon", + "oamV4IpAddress": "10.42.6.245", + "oamV6IpAddress": "0:0:0:0:0:ffff:a0a:011", + "serialNumber": "ORAN_SIM-172.30.1.6-400600927-Simulated Device Melacon", + "softwareVersion": "2.3.5", + "unitType": "ntsim_oran", + "vendorName": "Melacon" + }, + "platform": { + "platformName": "{{ platform }}" + }, + "lineOfBusiness": { + "lineOfBusinessName": "{{ line_of_business }}" + }, + "productFamilyId": "1234", + "instanceName": "{{ instance_name }}" + } + ] + {% endblock %} + }, + "modelInfo": { + "modelType": "pnf", + "modelInvariantId": "{{ pnf.model_invariant_id }}", + "modelVersionId": "{{ pnf.model_version_id }}", + "modelName": "{{ pnf.model_name }}", + "modelVersion": "{{ pnf.model_version }}", + "modelCustomizationId": "{{ pnf.model_customization_id }}", + "modelCustomizationName": "{{ pnf.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 }}" +} diff --git a/src/onapsdk/so/templates/instantiate_pnf_macro_so_pnf.json.j2 b/src/onapsdk/so/templates/instantiate_pnf_macro_so_pnf.json.j2 index 5f1f22c..630d95e 100755 --- a/src/onapsdk/so/templates/instantiate_pnf_macro_so_pnf.json.j2 +++ b/src/onapsdk/so/templates/instantiate_pnf_macro_so_pnf.json.j2 @@ -16,11 +16,6 @@ "modelCustomizationId": "{{ pnf.model_customization_id }}",
"modelInstanceName": "{{ pnf.name }}"
},
- "cloudConfiguration": {
- "tenantId": "{{ tenant.tenant_id }}",
- "cloudOwner": "{{ cloud_region.cloud_owner }}",
- "lcpCloudRegionId": "{{ cloud_region.cloud_region_id }}"
- },
"platform": {
"platformName": "{{ platform }}"
},
@@ -53,11 +48,6 @@ "modelCustomizationId": "{{ pnf.model_customization_id }}",
"modelInstanceName": "{{ pnf.name }}"
},
- "cloudConfiguration": {
- "tenantId": "{{ tenant.tenant_id }}",
- "cloudOwner": "{{ cloud_region.cloud_owner }}",
- "lcpCloudRegionId": "{{ cloud_region.cloud_region_id }}"
- },
"platform": {
"platformName": "{{ platform }}"
},
diff --git a/src/onapsdk/so/templates/instantiate_service_macro_skip_pnf_registration_event.json.j2 b/src/onapsdk/so/templates/instantiate_service_macro_skip_pnf_registration_event.json.j2 new file mode 100644 index 0000000..caa0ab4 --- /dev/null +++ b/src/onapsdk/so/templates/instantiate_service_macro_skip_pnf_registration_event.json.j2 @@ -0,0 +1,181 @@ +{ + "requestDetails": { + "requestInfo": { + "suppressRollback": false, + {% if aai_service %} + "productFamilyId":"{{ aai_service.service_id }}", + {% else %} + "productFamilyId": "1234", + {% endif %} + "requestorId": "demo", + "instanceName": "{{ service_instance_name }}", + "source": "VID" + }, + "modelInfo": { + "modelType": "service", + "modelInvariantId": "{{ sdc_service.unique_uuid }}", + "modelVersionId": "{{ sdc_service.identifier }}", + "modelName": "{{ sdc_service.name }}", + "modelVersion": "1.0" + }, + {% if sdc_service.has_vnfs %} + "cloudConfiguration": { + "tenantId": "{{ tenant.tenant_id }}", + "cloudOwner": "{{ cloud_region.cloud_owner }}", + "lcpCloudRegionId": "{{ cloud_region.cloud_region_id }}" + }, + {% endif %} + "subscriberInfo": { + "globalSubscriberId": "{{ customer.global_customer_id }}" + }, + "requestParameters": { + {% block subscriptionServiceType %} + "subscriptionServiceType": "{{ service_subscription.service_type }}", + {% endblock %} + "userParams": [ + { + "Homing_Solution": "none" + }, + {% if enable_multicloud %} + { + "name":"orchestrator", + "value":"multicloud" + }, + {% endif %} + { + "service": { + "instanceParams": [], + "instanceName": "{{ service_instance_name }}", + "resources": { + {% block pnfs %} + {% if sdc_service.pnfs %} + "pnfs":[ + {% for pnf in sdc_service.pnfs %} + { + "modelInfo":{ + "modelCustomizationName":"{{ pnf.name }}", + "modelCustomizationId":"{{ pnf.model_customization_id }}", + "modelInvariantId":"{{ sdc_service.unique_uuid }}", + "modelVersionId":"{{ sdc_service.identifier }}", + "modelName":"{{ sdc_service.name }}", + "modelType":"pnf", + "modelVersion":"1.0" + },"pnfRegistrationFields": { + "modelNumber": "Simulated Device Melacon", + "oamV4IpAddress": "10.42.6.245", + "oamV6IpAddress": "0:0:0:0:0:ffff:a0a:011", + "serialNumber": "ORAN_SIM-172.30.1.6-400600927-Simulated Device Melacon", + "softwareVersion": "2.3.5", + "unitType": "ntsim_oran", + "vendorName": "Melacon" + }, + "platform":{ + "platformName":"{{ platform }}" + }, + "lineOfBusiness":{ + "lineOfBusinessName":"{{ line_of_business }}" + }, + "productFamilyId":"{{ aai_service.service_id }}", + "instanceParams":[], + "instanceName":"{{ service_instance_name }}" + }{% if not loop.last %},{% endif %} + {% endfor %} + ] + {% if sdc_service.vnfs %},{% endif %} + {% endif %} + {% endblock %} + {% block vnfs %} + {% if sdc_service.vnfs %} + "vnfs": [ + {% for vnf in sdc_service.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.model_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": "{{ vnf.model_name }}", + "instanceParams": [ + { + {% for vnf_parameter in vnf_parameters %} + {% if vnf_parameter.name == vnf.model_name %} + {% for parameter in vnf_parameter.vnf_parameters %} + "{{ parameter.name }}": "{{ parameter.value }}"{% if not loop.last %},{% endif %} + {% endfor %} + {% endif %} + {% endfor %} + } + ], + "vfModules": [ + {% for vf_module in vnf.vf_modules %} + { + "modelInfo": { + "modelName": "{{ vf_module.model_name }}", + "modelVersionId": "{{ vf_module.model_version_id }}", + "modelInvariantUuid": "{{ vf_module.model_invariant_uuid }}", + "modelVersion": "{{ vf_module.model_version }}", + "modelCustomizationId": "{{ vf_module.model_customization_id }}" + }, + "instanceName": "{{ service_instance_name }}_{{ vf_module.name }}", + "instanceParams": [ + { + {% for vnf_parameter in vnf_parameters %} + {% if vnf_parameter.name == vnf.model_name %} + {% set mylist = vf_module.name.split('..') %} + {% set item = mylist|length-2 %} + {% for vf_module_parameter in vnf_parameter.vfmodule_parameters %} + {% if vf_module_parameter.name == mylist[item] %} + {% for parameter in vf_module_parameter.vfmodule_parameters %} + "{{ parameter.name }}": "{{ parameter.value }}"{% if not loop.last %},{% endif %} + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + } + ] + }{% if not loop.last %},{% endif %} + {% endfor %} + ] + }{% if not loop.last %},{% endif %} + {% endfor %} + ] + {% endif %} + {% endblock %} + }, + "modelInfo": { + "modelVersion": "1.0", + "modelVersionId": "{{ sdc_service.identifier }}", + "modelInvariantId": "{{ sdc_service.unique_uuid }}", + "modelName": "{{ sdc_service.name }}", + "modelType": "service" + } + } + } + ], + "aLaCarte": false + }, + "project": { + "projectName": "{{ project }}" + }, + "owningEntity": { + "owningEntityId": "{{ owning_entity.owning_entity_id }}", + "owningEntityName": "{{ owning_entity.name }}" + } + } +} |