aboutsummaryrefslogtreecommitdiffstats
path: root/src/onapsdk/aai/business/service.py
diff options
context:
space:
mode:
authorAbhishek Patil <abhishek.patil@t-systems.com>2023-07-27 16:32:17 +0530
committerAbhishek Patil <abhishek.patil@t-systems.com>2023-07-27 19:17:15 +0530
commit3d3d3574f1012a7faa6cf86d55884cf0884decbf (patch)
tree2e74807f6258f496cd02ef0d9ca3915a23294953 /src/onapsdk/aai/business/service.py
parent48f63ef8e43f789cc6d364d387df289094edfc25 (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/aai/business/service.py')
-rw-r--r--src/onapsdk/aai/business/service.py45
1 files changed, 44 insertions, 1 deletions
diff --git a/src/onapsdk/aai/business/service.py b/src/onapsdk/aai/business/service.py
index fe3b34d..4351a26 100644
--- a/src/onapsdk/aai/business/service.py
+++ b/src/onapsdk/aai/business/service.py
@@ -18,7 +18,7 @@ from typing import Iterator, Type, Union, Iterable, Optional
from onapsdk.exceptions import StatusError, ParameterError
from onapsdk.sdc.service import Service
from onapsdk.so.deletion import ServiceDeletionRequest
-from onapsdk.so.instantiation import NetworkInstantiation, VnfInstantiation
+from onapsdk.so.instantiation import NetworkInstantiation, VnfInstantiation, PnfInstantiation
from onapsdk.utils.jinja import jinja_env
from .instance import Instance
@@ -417,6 +417,49 @@ class ServiceInstance(Instance): # pylint: disable=too-many-instance-attributes
sdc_service=self.sdc_service
)
+ def add_pnf(self, # pylint: disable=too-many-arguments
+ pnf: "Pnf",
+ line_of_business: "LineOfBusiness",
+ platform: "Platform",
+ pnf_instance_name: str = None,
+ customer: "Customer" = None,
+ service_subscription: "ServiceSubscription" = None,
+ sdc_service: "SdcService" = None,
+ ) -> "PnfInstantiation":
+ """Add pnf into service instance.
+
+ Instantiate PNF.
+
+ Args:
+ pnf (Pnf): Pnf from service configuration to instantiate
+ line_of_business (LineOfBusiness): LineOfBusiness to use in instantiation request
+ platform (Platform): Platform to use in instantiation request
+ customer (Customer): Customer to use in instantiation request
+ service_subscription(ServiceSubscription): ServiceSubscription
+ pnf_instance_name (str): PNF instantiation name
+ sdc_service (SdcService): service model from sdc
+
+ Raises:
+ StatusError: Service orchestration status is not "Active".
+
+ Returns:
+ PnfInstantiation: PnfInstantiation request object
+
+ """
+ if not self.active:
+ raise StatusError('Service orchestration status must be "Active"')
+
+ return PnfInstantiation.instantiate_macro(
+ self,
+ pnf,
+ line_of_business,
+ customer,
+ service_subscription,
+ platform,
+ pnf_instance_name,
+ sdc_service
+ )
+
def add_network(self, # pylint: disable=too-many-arguments
network: "Network",
line_of_business: "LineOfBusiness",