def create_ns_in_aai(self):
logger.debug("CreateNSService::create_ns_in_aai::report ns instance[%s] to aai." % self.ns_inst_id)
try:
- # global_customer_id = "global-customer-id-" + self.ns_inst_id
- # data = {
- # "global-customer-id": "global-customer-id-" + self.ns_inst_id,
- # "subscriber-name": "subscriber-name-" + self.ns_inst_id,
- # "subscriber-type": "subscriber-type-" + self.ns_inst_id,
- # "service-subscriptions": {
- # "service-subscription": [
- # {
- # "service-type": "Network",
- # "service-instances": {
- # "service-instance": [
- # {
- # "service-instance-id": self.ns_inst_id,
- # "service-instance-name": self.ns_name,
- # "service-type": "Network",
- # "service-role": "service-role-" + self.ns_inst_id
- # }
- # ]
- # }
- # }
- # ]
- # }
- # }
- # resp_data, resp_status = create_customer_aai(global_customer_id, data)
data = {
"service-instance-id": self.ns_inst_id,
"service-instance-name": self.ns_name,
"service-type": SERVICE_TYPE,
"service-role": SERVICE_ROLE
}
- 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:
- logger.debug("Success to create ns[%s] to aai: [%s].", self.ns_inst_id, resp_status)
+ resp_data, resp_status = create_ns_aai(self.global_customer_id, self.service_type, self.ns_inst_id, data)
+ logger.debug("Success to create ns[%s] to aai:[%s],[%s].", self.ns_inst_id, resp_data, resp_status)
except NSLCMException as e:
logger.debug("Fail to createns[%s] to aai, detail message: %s" % (self.ns_inst_id, e.message))
except: