aboutsummaryrefslogtreecommitdiffstats
path: root/src/onapsdk/so/templates
diff options
context:
space:
mode:
Diffstat (limited to 'src/onapsdk/so/templates')
-rw-r--r--src/onapsdk/so/templates/add_cloud_site_with_identity_service.json.j222
-rw-r--r--src/onapsdk/so/templates/deletion_network.json.j222
-rw-r--r--src/onapsdk/so/templates/deletion_service.json.j226
-rw-r--r--src/onapsdk/so/templates/deletion_vf_module.json.j227
-rw-r--r--src/onapsdk/so/templates/deletion_vnf.json.j228
-rw-r--r--src/onapsdk/so/templates/instantiate_multi_vnf_service_macro.json.j2121
-rw-r--r--src/onapsdk/so/templates/instantiate_network_ala_carte.json.j210
-rw-r--r--src/onapsdk/so/templates/instantiate_network_vnf_ala_carte_base.json.j244
-rw-r--r--src/onapsdk/so/templates/instantiate_service_ala_carte.json.j245
-rw-r--r--src/onapsdk/so/templates/instantiate_service_macro.json.j2173
-rw-r--r--src/onapsdk/so/templates/instantiate_vf_module_ala_carte.json.j266
-rw-r--r--src/onapsdk/so/templates/instantiate_vnf_ala_carte.json.j218
-rw-r--r--src/onapsdk/so/templates/instantiate_vnf_macro.json.j2153
-rw-r--r--src/onapsdk/so/templates/instantiate_vnf_macro_so_vnf.json.j2151
-rw-r--r--src/onapsdk/so/templates/service_instance_model_info.json.j27
-rw-r--r--src/onapsdk/so/templates/vf_model_info.json.j215
-rw-r--r--src/onapsdk/so/templates/vnf_model_info.json.j29
17 files changed, 937 insertions, 0 deletions
diff --git a/src/onapsdk/so/templates/add_cloud_site_with_identity_service.json.j2 b/src/onapsdk/so/templates/add_cloud_site_with_identity_service.json.j2
new file mode 100644
index 0000000..31599f5
--- /dev/null
+++ b/src/onapsdk/so/templates/add_cloud_site_with_identity_service.json.j2
@@ -0,0 +1,22 @@
+{
+ "id": "{{ cloud_region_id }}",
+ "region_id": "{{ cloud_region_id }}",
+ "aic_version": "2.5",
+ "clli": "{{ complex_id }}",
+ "orchestrator": "{{ orchestrator }}",
+ "identityService": {
+ "id": "{{ identity_service.identity_id }}",
+ "identityServerTypeAsString": "{{ identity_service.server_type_as_string }}",
+ "hibernateLazyInitializer": {{ identity_service.hibernate_lazy_initializer }},
+ "identity_url": "{{ identity_service.url }}",
+ "mso_id": "{{ identity_service.mso_id }}",
+ "mso_pass": "{{ identity_service.mso_pass }}",
+ "project_domain_name": "{{ identity_service.project_domain_name }}",
+ "user_domain_name": "{{ identity_service.user_domain_name }}",
+ "admin_tenant": "{{ identity_service.admin_tenant }}",
+ "member_role": "{{ identity_service.member_role }}",
+ "tenant_metadata": "{{ identity_service.tenant_metadata }}",
+ "identity_server_type": "{{ identity_service.identity_server_type }}",
+ "identity_authentication_type": "{{ identity_service.identity_authentication_type }}"
+ }
+} \ No newline at end of file
diff --git a/src/onapsdk/so/templates/deletion_network.json.j2 b/src/onapsdk/so/templates/deletion_network.json.j2
new file mode 100644
index 0000000..93f0990
--- /dev/null
+++ b/src/onapsdk/so/templates/deletion_network.json.j2
@@ -0,0 +1,22 @@
+{
+ "requestDetails": {
+ "requestInfo": {
+ "source": "VID",
+ "requestorId": "demo"
+ },
+ "modelInfo": {
+ "modelType": "network"
+ },
+ "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": "{{ network_instance.service_instance.service_subscription.cloud_region.cloud_owner }}",
+ "lcpCloudRegionId": "{{ network_instance.service_instance.service_subscription.cloud_region.cloud_region_id }}",
+ "tenantId": "{{ network_instance.service_instance.service_subscription.tenant.tenant_id }}"
+ }
+ }
+} \ No newline at end of file
diff --git a/src/onapsdk/so/templates/deletion_service.json.j2 b/src/onapsdk/so/templates/deletion_service.json.j2
new file mode 100644
index 0000000..1244e97
--- /dev/null
+++ b/src/onapsdk/so/templates/deletion_service.json.j2
@@ -0,0 +1,26 @@
+{
+ "requestDetails": {
+ "requestInfo": {
+ "source": "VID",
+ "requestorId": "demo"
+ },
+ "modelInfo": {
+ "modelType": "service",
+ "modelName": "{{ service_instance.sdc_service.name }}",
+ "modelInvariantId": "{{ service_instance.sdc_service.unique_uuid }}",
+ "modelVersion": "1.0",
+ "modelVersionId": "{{ service_instance.sdc_service.identifier }}"
+ },
+ "requestParameters": {
+ "testApi": "GR_API",
+ "aLaCarte": {{ a_la_carte | tojson }}
+ }{% if service_instance.sdc_service.has_vnfs %},
+ {# the code below is needed to be refactored #}
+ {# https://gitlab.com/Orange-OpenSource/lfn/onap/python-onapsdk/-/issues/133 #}
+ "cloudConfiguration": {
+ "cloudOwner": "{{ service_instance.service_subscription.cloud_region.cloud_owner }}",
+ "lcpCloudRegionId": "{{ service_instance.service_subscription.cloud_region.cloud_region_id }}",
+ "tenantId": "{{ service_instance.service_subscription.tenant.tenant_id }}"
+ }{% endif %}
+ }
+} \ No newline at end of file
diff --git a/src/onapsdk/so/templates/deletion_vf_module.json.j2 b/src/onapsdk/so/templates/deletion_vf_module.json.j2
new file mode 100644
index 0000000..8f83717
--- /dev/null
+++ b/src/onapsdk/so/templates/deletion_vf_module.json.j2
@@ -0,0 +1,27 @@
+{
+ "requestDetails": {
+ "requestInfo": {
+ "source": "VID",
+ "requestorId": "demo"
+ },
+ "modelInfo": {
+ "modelType": "vfModule",
+ "modelInvariantId": "{{ vf_module_instance.model_invariant_id }}",
+ "modelVersionId": "{{ vf_module_instance.model_version_id }}",
+ "modelName": "{{ vf_module_instance.vf_module_name }}",
+ "modelVersion": "{{ vf_module_instance.resource_version }}",
+ "modelCustomizationId": "{{ vf_module_instance.model_customization_id }}"
+ },
+ "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": "{{ vf_module_instance.vnf_instance.service_instance.service_subscription.cloud_region.cloud_owner }}",
+ "lcpCloudRegionId": "{{ vf_module_instance.vnf_instance.service_instance.service_subscription.cloud_region.cloud_region_id }}",
+ "tenantId": "{{ vf_module_instance.vnf_instance.service_instance.service_subscription.tenant.tenant_id }}"
+ }
+ }
+} \ No newline at end of file
diff --git a/src/onapsdk/so/templates/deletion_vnf.json.j2 b/src/onapsdk/so/templates/deletion_vnf.json.j2
new file mode 100644
index 0000000..fb640ec
--- /dev/null
+++ b/src/onapsdk/so/templates/deletion_vnf.json.j2
@@ -0,0 +1,28 @@
+{
+ "requestDetails": {
+ "requestInfo": {
+ "source": "VID",
+ "requestorId": "demo"
+ },
+ "modelInfo": {
+ "modelType": "vnf",
+ "modelName": "{{ vnf_instance.vnf.model_name }}",
+ "modelInvariantId": "{{ vnf_instance.vnf.model_invariant_id }}",
+ "modelVersion": "{{ vnf_instance.vnf.model_version }}",
+ "modelVersionId": "{{ vnf_instance.vnf.model_version_id }}",
+ "modelCustomizationId": "{{ vnf_instance.vnf.model_customization_id }}",
+ "modelCustomizationName": "{{ vnf_instance.vnf.name }}"
+ },
+ "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": "{{ vnf_instance.service_instance.service_subscription.cloud_region.cloud_owner }}",
+ "lcpCloudRegionId": "{{ vnf_instance.service_instance.service_subscription.cloud_region.cloud_region_id }}",
+ "tenantId": "{{ vnf_instance.service_instance.service_subscription.tenant.tenant_id }}"
+ }
+ }
+} \ No newline at end of file
diff --git a/src/onapsdk/so/templates/instantiate_multi_vnf_service_macro.json.j2 b/src/onapsdk/so/templates/instantiate_multi_vnf_service_macro.json.j2
new file mode 100644
index 0000000..32e1b68
--- /dev/null
+++ b/src/onapsdk/so/templates/instantiate_multi_vnf_service_macro.json.j2
@@ -0,0 +1,121 @@
+{% extends "instantiate_service_macro.json.j2" %}
+
+{% block subscriptionServiceType %}
+ "subscriptionServiceType": "{{ so_service.subscription_service_type }}",
+{% endblock %}
+
+{% block pnfs %}
+ {% if so_service.pnfs %}
+ "pnfs": [
+ {% for pnf in so_service.pnfs %}
+ {
+ "modelInfo":{
+ {% for sdc_pnf in sdc_service.pnfs %}
+ {% if sdc_pnf.model_name == pnf.model_name %}
+ "modelCustomizationName":"{{ sdc_pnf.name }}",
+ "modelCustomizationId":"{{ sdc_pnf.model_customization_id }}",
+ "modelInvariantId":"{{ sdc_service.unique_uuid }}",
+ "modelVersionId":"{{ sdc_service.identifier }}",
+ "modelName":"{{ sdc_service.name }}",
+ "modelType":"pnf",
+ "modelVersion":"{{ sdc_pnf.model_version }}"
+ {% endif %}
+ {% endfor %}
+ },
+ "platform":{
+ "platformName":"{{ platform }}"
+ },
+ "lineOfBusiness":{
+ "lineOfBusinessName":"{{ line_of_business }}"
+ },
+ "productFamilyId":"{{ aai_service.service_id }}",
+ "instanceParams":[],
+ {% if pnf.processing_priority %}
+ "processingPriority": "{{ pnf.processing_priority }}",
+ {% endif %}
+ "instanceName": "{{ pnf.instance_name }}"
+ }{% if not loop.last %},{% endif %}
+ {% endfor %}
+ ]{% if so_service.vnfs %},{% endif %}
+ {% endif %}
+{% endblock %}
+
+{% block vnfs %}
+ {% if so_service.vnfs %}
+ "vnfs": [
+ {% for vnf in so_service.vnfs %}
+ {
+ "modelInfo": {
+ {% for sdc_vnf in sdc_service.vnfs %}
+ {% if sdc_vnf.model_name == vnf.model_name %}
+ "modelName": "{{ sdc_vnf.model_name }}",
+ "modelVersionId": "{{ sdc_vnf.model_version_id }}",
+ "modelInvariantUuid": "{{ sdc_vnf.model_invariant_uuid }}",
+ "modelVersion": "{{ sdc_vnf.model_version }}",
+ "modelCustomizationId": "{{ sdc_vnf.model_customization_id }}",
+ "modelInstanceName": "{{ sdc_vnf.model_name }}"
+ {% endif %}
+ {% endfor %}
+ },
+ "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.instance_name }}",
+ "instanceParams": [
+ {
+ {% for key, value in vnf.parameters.items() %}
+ "{{ key }}": "{{ value }}"{% if not loop.last %},{% endif %}
+ {% endfor %}
+ }
+ ],
+ {% if vnf.processing_priority %}
+ "processingPriority": "{{ vnf.processing_priority }}",
+ {% endif %}
+ "vfModules": [
+ {% for vf_module in vnf.vf_modules %}
+ {
+ "modelInfo": {
+ {% for sdc_vnf in sdc_service.vnfs %}
+ {% if sdc_vnf.model_name == vnf.model_name %}
+ {% for sdc_vf_module in sdc_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 %}
+ {% endfor %}
+ },
+ "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 %}
+ ]
+ }{% if not loop.last %},{% endif %}
+ {% endfor %}
+ ]
+ {% endif %}
+{% endblock %}
diff --git a/src/onapsdk/so/templates/instantiate_network_ala_carte.json.j2 b/src/onapsdk/so/templates/instantiate_network_ala_carte.json.j2
new file mode 100644
index 0000000..90b3c16
--- /dev/null
+++ b/src/onapsdk/so/templates/instantiate_network_ala_carte.json.j2
@@ -0,0 +1,10 @@
+{% extends "instantiate_network_vnf_ala_carte_base.json.j2" %}
+{% block model_info %}
+ "modelType": "network",
+ "modelInvariantId": "{{ network.model_invariant_id }}",
+ "modelVersionId": "{{ network.model_version_id }}",
+ "modelName": "{{ network.model_name }}",
+ "modelVersion": "{{ network.model_version }}",
+ "modelCustomizationId": "{{ network.model_customization_id }}",
+ "modelCustomizationName": "{{ network.name }}"
+{% endblock %} \ No newline at end of file
diff --git a/src/onapsdk/so/templates/instantiate_network_vnf_ala_carte_base.json.j2 b/src/onapsdk/so/templates/instantiate_network_vnf_ala_carte_base.json.j2
new file mode 100644
index 0000000..757cdd8
--- /dev/null
+++ b/src/onapsdk/so/templates/instantiate_network_vnf_ala_carte_base.json.j2
@@ -0,0 +1,44 @@
+{
+ "requestDetails": {
+ "requestInfo": {
+ "instanceName": "{{ instance_name }}",
+ "source": "VID",
+ "suppressRollback": false,
+ "requestorId": "test",
+ "productFamilyId": "{{ service_instance.model_invariant_id }}"
+ },
+ "modelInfo": {
+ {% block model_info %}{% endblock %}
+ },
+ "requestParameters": {
+ "userParams": [
+ {% block user_params %}{% endblock %}
+ ],
+ "aLaCarte": true,
+ "testApi": "GR_API"
+ },
+ "cloudConfiguration": {
+ "tenantId": "{{ tenant.tenant_id }}",
+ "cloudOwner": "{{ cloud_region.cloud_owner }}",
+ "lcpCloudRegionId": "{{ cloud_region.cloud_region_id }}"
+ },
+ "lineOfBusiness": {
+ "lineOfBusinessName": "{{ line_of_business }}"
+ },
+ "platform": {
+ "platformName": "{{ platform }}"
+ },
+ "relatedInstanceList": [{
+ "relatedInstance": {
+ "instanceId": "{{ service_instance.instance_id }}",
+ "modelInfo": {
+ "modelType": "service",
+ "modelName": "{{ service.name }}",
+ "modelInvariantId": "{{ service.unique_uuid }}",
+ "modelVersion": "1.0",
+ "modelVersionId": "{{ service.identifier }}"
+ }
+ }
+ }]
+ }
+} \ No newline at end of file
diff --git a/src/onapsdk/so/templates/instantiate_service_ala_carte.json.j2 b/src/onapsdk/so/templates/instantiate_service_ala_carte.json.j2
new file mode 100644
index 0000000..4954cde
--- /dev/null
+++ b/src/onapsdk/so/templates/instantiate_service_ala_carte.json.j2
@@ -0,0 +1,45 @@
+{
+ "requestDetails": {
+ "requestInfo": {
+ "instanceName": "{{ service_instance_name }}",
+ "source": "VID",
+ "suppressRollback": false,
+ "requestorId": "demo"
+ },
+ "modelInfo": {
+ "modelType": "service",
+ "modelInvariantId": "{{ sdc_service.unique_uuid }}",
+ "modelVersionId": "{{ sdc_service.identifier }}",
+ "modelName": "{{ sdc_service.name }}",
+ "modelVersion": "1.0"
+ },
+ "cloudConfiguration": {
+ "tenantId": "{{ tenant.tenant_id }}",
+ "cloudOwner": "{{ cloud_region.cloud_owner }}",
+ "lcpCloudRegionId": "{{ cloud_region.cloud_region_id }}"
+ },
+ "requestParameters": {
+ "userParams": [
+ {% if enable_multicloud %}
+ {
+ "name":"orchestrator",
+ "value":"multicloud"
+ }
+ {% endif %}
+ ],
+ "testApi": "GR_API",
+ "subscriptionServiceType": "{{ service_subscription.service_type }}",
+ "aLaCarte": true
+ },
+ "subscriberInfo": {
+ "globalSubscriberId": "{{ customer.global_customer_id }}"
+ },
+ "project": {
+ "projectName": "{{ project }}"
+ },
+ "owningEntity": {
+ "owningEntityId": "{{ owning_entity.owning_entity_id }}",
+ "owningEntityName": "{{ owning_entity.name }}"
+ }
+ }
+} \ No newline at end of file
diff --git a/src/onapsdk/so/templates/instantiate_service_macro.json.j2 b/src/onapsdk/so/templates/instantiate_service_macro.json.j2
new file mode 100644
index 0000000..43b92ee
--- /dev/null
+++ b/src/onapsdk/so/templates/instantiate_service_macro.json.j2
@@ -0,0 +1,173 @@
+{
+ "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"
+ },
+ "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 }}"
+ }
+ }
+}
diff --git a/src/onapsdk/so/templates/instantiate_vf_module_ala_carte.json.j2 b/src/onapsdk/so/templates/instantiate_vf_module_ala_carte.json.j2
new file mode 100644
index 0000000..0738379
--- /dev/null
+++ b/src/onapsdk/so/templates/instantiate_vf_module_ala_carte.json.j2
@@ -0,0 +1,66 @@
+{
+ "requestDetails": {
+ "requestInfo":
+ {
+ "instanceName": "{{ vf_module_instance_name }}",
+ "source": "VID",
+ "suppressRollback": false,
+ "requestorId": "test"
+ },
+ "modelInfo": {
+ "modelType": "vfModule",
+ "modelInvariantId": "{{ vf_module.model_invariant_uuid }}",
+ "modelVersionId": "{{ vf_module.model_version_id }}",
+ "modelName": "{{ vf_module.model_name }}",
+ "modelVersion": "{{ vf_module.model_version }}",
+ "modelCustomizationId": "{{ vf_module.model_customization_id }}",
+ "modelCustomizationName": "{{ vf_module.model_name }}"
+ },
+ "requestParameters": {
+ "userParams": [
+ {% for parameter in vf_module_parameters %}
+ {
+ "name": "{{ parameter.name }}",
+ "value": "{{ parameter.value }}"
+ }{% if not loop.last %},{% endif %}
+ {% endfor %}
+ ],
+ "testApi": "GR_API",
+ "usePreload": true,
+ "aLaCarte": true
+ },
+ "cloudConfiguration": {
+ "tenantId": "{{ tenant.tenant_id }}",
+ "cloudOwner": "{{ cloud_region.cloud_owner }}",
+ "lcpCloudRegionId": "{{ cloud_region.cloud_region_id }}"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "{{ vnf_instance.service_instance.instance_id }}",
+ "modelInfo": {
+ "modelType": "service",
+ "modelName": "{{ service.name }}",
+ "modelInvariantId": "{{ service.unique_uuid }}",
+ "modelVersion": "1.0",
+ "modelVersionId": "{{ service.identifier }}"
+ }
+ }
+ },
+ {
+ "relatedInstance": {
+ "instanceId": "{{ vnf_instance.vnf_id }}",
+ "modelInfo": {
+ "modelType": "vnf",
+ "modelName": "{{ vnf_instance.vnf.model_name }}",
+ "modelInvariantId": "{{ vnf_instance.vnf.model_invariant_id }}",
+ "modelVersion": "{{ vnf_instance.vnf.model_version }}",
+ "modelVersionId": "{{ vnf_instance.vnf.model_version_id }}",
+ "modelCustomizationId": "{{ vnf_instance.vnf.model_customization_id }}",
+ "modelCustomizationName": "{{ vnf_instance.vnf.name }}"
+ }
+ }
+ }
+ ]
+ }
+}
diff --git a/src/onapsdk/so/templates/instantiate_vnf_ala_carte.json.j2 b/src/onapsdk/so/templates/instantiate_vnf_ala_carte.json.j2
new file mode 100644
index 0000000..9fbf989
--- /dev/null
+++ b/src/onapsdk/so/templates/instantiate_vnf_ala_carte.json.j2
@@ -0,0 +1,18 @@
+{% extends "instantiate_network_vnf_ala_carte_base.json.j2" %}
+{% block model_info %}
+ "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 }}"
+{% endblock %}
+{% block user_params %}
+{% for parameter in vnf_parameters %}
+{
+ "name": "{{ parameter.name }}",
+ "value": "{{ parameter.value }}"
+}{% if not loop.last %},{% endif %}
+{% endfor %}
+{% endblock %} \ No newline at end of file
diff --git a/src/onapsdk/so/templates/instantiate_vnf_macro.json.j2 b/src/onapsdk/so/templates/instantiate_vnf_macro.json.j2
new file mode 100644
index 0000000..2d7aeee
--- /dev/null
+++ b/src/onapsdk/so/templates/instantiate_vnf_macro.json.j2
@@ -0,0 +1,153 @@
+{
+ "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 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": "{{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 %}
+ ]
+ }
+ ]
+ {% 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 }}"
+}
diff --git a/src/onapsdk/so/templates/instantiate_vnf_macro_so_vnf.json.j2 b/src/onapsdk/so/templates/instantiate_vnf_macro_so_vnf.json.j2
new file mode 100644
index 0000000..c7f4356
--- /dev/null
+++ b/src/onapsdk/so/templates/instantiate_vnf_macro_so_vnf.json.j2
@@ -0,0 +1,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 }}"
+}
diff --git a/src/onapsdk/so/templates/service_instance_model_info.json.j2 b/src/onapsdk/so/templates/service_instance_model_info.json.j2
new file mode 100644
index 0000000..fc66de4
--- /dev/null
+++ b/src/onapsdk/so/templates/service_instance_model_info.json.j2
@@ -0,0 +1,7 @@
+{
+ "modelType": "service",
+ "modelInvariantId": "{{ model_invariant_id }}",
+ "modelName": "{{ model_name }}",
+ "modelVersion": "{{ model_version }}",
+ "modelVersionId": "{{ model_name_version_id }}"
+}
diff --git a/src/onapsdk/so/templates/vf_model_info.json.j2 b/src/onapsdk/so/templates/vf_model_info.json.j2
new file mode 100644
index 0000000..4b40898
--- /dev/null
+++ b/src/onapsdk/so/templates/vf_model_info.json.j2
@@ -0,0 +1,15 @@
+[
+{% for _, module in modules.items() %}
+ {
+ "modelInfo": {
+ "modelName": "{{ module["metadata"]["vfModuleModelName"] }}",
+ "modelVersion": "{{ module.metadata.vfModuleModelVersion }}",
+ "modelVersionId": "{{ module.metadata.vfModuleModelUUID }}",
+ "modelInvariantUuid": "{{ module.metadata.vfModuleInvariantUUID }}",
+ "modelCustomizationId": "{{ module.metadata.vfModuleModelCustomizationUUID }}"
+ },
+ "instanceName": "{{ module.metadata.vfModuleModelName }}",
+ "instanceParams": []
+ }{% if not loop.last %},{% endif %}
+{% endfor %}
+] \ No newline at end of file
diff --git a/src/onapsdk/so/templates/vnf_model_info.json.j2 b/src/onapsdk/so/templates/vnf_model_info.json.j2
new file mode 100644
index 0000000..ecc788b
--- /dev/null
+++ b/src/onapsdk/so/templates/vnf_model_info.json.j2
@@ -0,0 +1,9 @@
+{
+ "modelType": "vnf",
+ "modelName": "{{ vnf_model_name }}",
+ "modelVersion": "{{ vnf_model_version }}",
+ "modelVersionId": "{{ vnf_model_version_id }}",
+ "modelInvariantUuid": "{{ vnf_model_invariant_uuid }}",
+ "modelCustomizationId": "{{ vnf_model_customization_id }}",
+ "modelInstanceName": "{{ vnf_model_instance_name }}"
+}