aboutsummaryrefslogtreecommitdiffstats
path: root/src/onapsdk
diff options
context:
space:
mode:
authorpeukerl@telekom.de <peukerl@telekom.de>2023-06-21 15:25:40 +0200
committerLukasz Rajewski <lukasz.rajewski@t-mobile.pl>2023-06-26 09:11:27 +0000
commitc1cf91e41376e9b9dbf13013a3f79fb09debaf09 (patch)
tree8fecbf62cd35de17d4a46230fe906e27ca3c1ac1 /src/onapsdk
parentc7c8f1d804748462f6d4614984eea591c8528909 (diff)
Orchestration request changes
status-message added to orchestration-request pnfRegistrationFields added to service-instantiation Issue-ID: INT-2253 Signed-off-by: peukerl@telekom.de <peukerl@telekom.de> Change-Id: I8dd1ee326d63c915591829ceaca2e0f8247afdde
Diffstat (limited to 'src/onapsdk')
-rw-r--r--src/onapsdk/so/so_element.py23
-rw-r--r--src/onapsdk/so/templates/instantiate_multi_vnf_service_macro.json.j211
2 files changed, 34 insertions, 0 deletions
diff --git a/src/onapsdk/so/so_element.py b/src/onapsdk/so/so_element.py
index fca6ba7..68866ae 100644
--- a/src/onapsdk/so/so_element.py
+++ b/src/onapsdk/so/so_element.py
@@ -221,3 +221,26 @@ class OrchestrationRequest(SoElement, WaitForFinishMixin, ABC):
"""
return self.finished and self.status == self.StatusEnum.FAILED
+
+ @property
+ def status_message(self) -> str:
+ """Object instantiation status information.
+
+ It's populated by call SO orchestation request endpoint.
+
+ Returns:
+ str: status message of orchestration request.
+
+ """
+ response: dict = self.send_message_json(
+ "GET",
+ f"Check {self.request_id} orchestration request status",
+ (f"{self.base_url}/onap/so/infra/"
+ f"orchestrationRequests/{self.api_version}/{self.request_id}"),
+ headers=headers_so_creator(OnapService.headers)
+ )
+ try:
+ return response["request"]["requestStatus"]["statusMessage"]
+ except (KeyError, ValueError):
+ self._logger.exception("Invalid statusMessage.")
+ return "Unknown request state"
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
index 32e1b68..93ef79c 100644
--- a/src/onapsdk/so/templates/instantiate_multi_vnf_service_macro.json.j2
+++ b/src/onapsdk/so/templates/instantiate_multi_vnf_service_macro.json.j2
@@ -30,6 +30,17 @@
},
"productFamilyId":"{{ aai_service.service_id }}",
"instanceParams":[],
+ {% if pnf.registration_parameters %}
+ "pnfRegistrationFields": {
+ "modelNumber": "{{ pnf.registration_parameters.model_number }}",
+ "oamV4IpAddress": "{{ pnf.registration_parameters.oam_v4_ip_address }}",
+ "oamV6IpAddress": "{{ pnf.registration_parameters.oam_v6_ip_address }}",
+ "serialNumber": "{{ pnf.registration_parameters.serial_number }}",
+ "softwareVersion": "{{ pnf.registration_parameters.software_version }}",
+ "unitType": "{{ pnf.registration_parameters.unit_type }}",
+ "vendorName": "{{ pnf.registration_parameters.vendor_name }}"
+ },
+ {% endif %}
{% if pnf.processing_priority %}
"processingPriority": "{{ pnf.processing_priority }}",
{% endif %}