From 5fde98c7b2cf8242156ff2f7ef98fe11f88baf6d Mon Sep 17 00:00:00 2001 From: maopengzhang Date: Wed, 11 Oct 2017 18:41:33 +0800 Subject: [PATCH] Add global-customer-id and service-type parameter Add global-customer-id and service-type parameter in the NSLCM Change-Id: I2b12e9c9bc0f94b7d09d62afcc1e71f243dad327 Issue-ID: VFC-35 Signed-off-by: maopengzhang --- docs/APIs/NSLCM_API/NSLCM_API_Specification_v0.1.rst | 14 +++++++++++++- lcm/ns/const.py | 3 +++ lcm/ns/ns_create.py | 7 ++++--- lcm/swagger/vfc.vnfdriver.swagger.json | 2 +- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/APIs/NSLCM_API/NSLCM_API_Specification_v0.1.rst b/docs/APIs/NSLCM_API/NSLCM_API_Specification_v0.1.rst index 16b52b9c..66df2f41 100644 --- a/docs/APIs/NSLCM_API/NSLCM_API_Specification_v0.1.rst +++ b/docs/APIs/NSLCM_API/NSLCM_API_Specification_v0.1.rst @@ -566,7 +566,19 @@ NS LCM API "type": "object", "properties": { - + "context":{ + "type": "object", + "properties": { + "global-customer-id":{ + "type": "string", + "description": "the global customer id" + }, + "service-type":{ + "type": "string", + "description": "service type" + } + } + }, "csarId": { "type": "string", diff --git a/lcm/ns/const.py b/lcm/ns/const.py index b4165e5e..2527efdf 100644 --- a/lcm/ns/const.py +++ b/lcm/ns/const.py @@ -18,3 +18,6 @@ OWNER_TYPE = enum(VNF=0, VNFM=1, NS=2) NS_INST_STATUS = enum(EMPTY='empty', INSTANTIATING='instantiating', TERMINATING='terminating', ACTIVE='active', FAILED='failed', INACTIVE='inactive', UPDATING='updating', SCALING='scaling', HEALING='healing') + +SERVICE_TYPE = 'NetworkService' +SERVICE_ROLE = 'NetworkService' diff --git a/lcm/ns/ns_create.py b/lcm/ns/ns_create.py index ade97621..c7f4a684 100644 --- a/lcm/ns/ns_create.py +++ b/lcm/ns/ns_create.py @@ -22,6 +22,7 @@ from lcm.pub.msapi.aai import create_ns_aai from lcm.pub.msapi.sdc_run_catalog import query_nspackage_by_id from lcm.pub.utils.timeutil import now_time from lcm.pub.utils.values import ignore_case_get +from lcm.ns.const import SERVICE_ROLE, SERVICE_TYPE logger = logging.getLogger(__name__) @@ -104,10 +105,10 @@ class CreateNSService(object): data = { "service-instance-id": self.ns_inst_id, "service-instance-name": self.ns_name, - "service-type": "Network", - "service-role": "service-role-" + self.ns_inst_id + "service-type": SERVICE_TYPE, + "service-role": SERVICE_ROLE } - resp_data, resp_status = create_ns_aai(self.global_customer_id, self.service_type, self.ns_inst_id, data) + resp_data, resp_status = create_ns_aai(self.global_customer_id, SERVICE_TYPE, self.ns_inst_id, data) if resp_data: logger.debug("Fail to create ns[%s] to aai: [%s].", self.ns_inst_id, resp_status) else: diff --git a/lcm/swagger/vfc.vnfdriver.swagger.json b/lcm/swagger/vfc.vnfdriver.swagger.json index c9c47c01..6fa7bb09 100644 --- a/lcm/swagger/vfc.vnfdriver.swagger.json +++ b/lcm/swagger/vfc.vnfdriver.swagger.json @@ -538,7 +538,7 @@ } } } - }, + } }, "definitions": { "jobResponseInfo": { -- 2.16.6