aboutsummaryrefslogtreecommitdiffstats
path: root/src/onapsdk
diff options
context:
space:
mode:
Diffstat (limited to 'src/onapsdk')
-rw-r--r--src/onapsdk/so/templates/deletion_service.json.j22
-rw-r--r--src/onapsdk/so/templates/instantiate_service_macro.json.j226
2 files changed, 23 insertions, 5 deletions
diff --git a/src/onapsdk/so/templates/deletion_service.json.j2 b/src/onapsdk/so/templates/deletion_service.json.j2
index 1244e97..022c08e 100644
--- a/src/onapsdk/so/templates/deletion_service.json.j2
+++ b/src/onapsdk/so/templates/deletion_service.json.j2
@@ -14,7 +14,7 @@
"requestParameters": {
"testApi": "GR_API",
"aLaCarte": {{ a_la_carte | tojson }}
- }{% if service_instance.sdc_service.has_vnfs %},
+ }{% if service_instance.sdc_service.resources and 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": {
diff --git a/src/onapsdk/so/templates/instantiate_service_macro.json.j2 b/src/onapsdk/so/templates/instantiate_service_macro.json.j2
index b00a043..d33aea5 100644
--- a/src/onapsdk/so/templates/instantiate_service_macro.json.j2
+++ b/src/onapsdk/so/templates/instantiate_service_macro.json.j2
@@ -18,7 +18,7 @@
"modelName": "{{ sdc_service.name }}",
"modelVersion": "1.0"
},
- {% if sdc_service.has_vnfs %}
+ {% if sdc_service.resources and sdc_service.has_vnfs %}
"cloudConfiguration": {
"tenantId": "{{ tenant.tenant_id }}",
"cloudOwner": "{{ cloud_region.cloud_owner }}",
@@ -44,16 +44,32 @@
{% endif %}
{
"service": {
+ {% if not sdc_service.resources %}
+ "instanceParams": [],
+ {% else %}
"instanceParams": [
- {% if so_service %}
+ {% if so_service %}
{
{% for key, value in so_service.parameters.items() %}
- "{{ key }}": "{{ value }}"{% if not loop.last %},{% endif %}
+ "{{ key }}": "{{ value }}"{% if not loop.last %},
+ {% endif %}
{% endfor %}
}
{% endif %}
],
+ {% endif %}
"instanceName": "{{ service_instance_name }}",
+ {% if not sdc_service.resources %}
+ "resources": {},
+ "modelInfo": {
+ "modelVersion": "1.0",
+ "modelVersionId": "{{ sdc_service.identifier }}",
+ "modelInvariantId": "{{ sdc_service.unique_uuid }}",
+ "modelName": "{{ sdc_service.name }}",
+ "modelType": "service"
+ }
+ }
+ {% else %}
"resources": {
{% block pnfs %}
{% if sdc_service.pnfs %}
@@ -166,7 +182,9 @@
"modelType": "service"
}
}
+ {% endif %}
}
+
],
"aLaCarte": false
},
@@ -178,4 +196,4 @@
"owningEntityName": "{{ owning_entity.name }}"
}
}
-}
+} \ No newline at end of file