aboutsummaryrefslogtreecommitdiffstats
path: root/src/onapsdk
diff options
context:
space:
mode:
authorLukasz Rajewski <lukasz.rajewski@t-mobile.pl>2023-10-27 06:53:14 +0000
committerGerrit Code Review <gerrit@onap.org>2023-10-27 06:53:14 +0000
commitee44099b708e456d24d8b34afa9a0ee2d97507b8 (patch)
tree9988568f792b3767d4deeaf7d60b81e84187b0aa /src/onapsdk
parentfaab89966e16d0e085b94efbc685f5e814952758 (diff)
parent9fc6a07149040ea57876b17fa6bca123f03ce15c (diff)
Merge "Formatting fixes on NBI module"
Diffstat (limited to 'src/onapsdk')
-rw-r--r--src/onapsdk/nbi/nbi.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/onapsdk/nbi/nbi.py b/src/onapsdk/nbi/nbi.py
index 17356cb..7afc718 100644
--- a/src/onapsdk/nbi/nbi.py
+++ b/src/onapsdk/nbi/nbi.py
@@ -184,8 +184,11 @@ class Service(Nbi):
"""
return (f"Service(name={self.name}, service_id={self.service_id}, "
- f"service_specification={self.service_specification}, customer={self.customer}, "
- f"customer_role={self.customer_role})")
+ f"service_specification_id={self._service_specification_id}, "
+ f"service_specification_name={self._service_specification_name}, "
+ f"customer_id={self._customer_id}, "
+ f"customer_role={self.customer_role}, "
+ f"href={self.href})")
@classmethod
def get_all(cls, customer_id: str = 'generic') -> Iterator["Service"]:
@@ -199,9 +202,11 @@ class Service(Nbi):
"""
for service in cls.send_message_json("GET",
- "Get service instances from NBI",
- f"{cls.base_url}{cls.api_version}/service?"
- f"relatedParty.id={customer_id}"):
+ f"Get service instances from NBI {customer_id}"
+ f" ID from NBI",
+ f"{cls.base_url}{cls.api_version}/"
+ f"service/?relatedParty.id={customer_id}"
+ ):
yield cls(service.get("name"),
service.get("id"),
service.get("serviceSpecification", {}).get("name"),
@@ -343,8 +348,8 @@ class ServiceOrder(Nbi, WaitForFinishMixin): # pylint: disable=too-many-instanc
if not self._service_specification_id:
self._logger.error("No service specification")
return None
- self._service_specification = ServiceSpecification.\
- get_by_id(self._service_specification_id)
+ self._service_specification = ServiceSpecification.get_by_id(
+ self._service_specification_id)
return self._service_specification
@classmethod
@@ -371,9 +376,9 @@ class ServiceOrder(Nbi, WaitForFinishMixin): # pylint: disable=too-many-instanc
description=service_order.get("description"),
external_id=service_order.get("externalId"),
customer_id=service_order_related_party,
- service_specification_id=service_order.get("orderItem", [{}])[0].get("service")\
+ service_specification_id=service_order.get("orderItem", [{}])[0].get("service") \
.get("serviceSpecification").get("id"),
- service_instance_name=service_order.get("orderItem", [{}])[0].\
+ service_instance_name=service_order.get("orderItem", [{}])[0]. \
get("service", {}).get("name"),
state=service_order.get("state")
)