From 36d0fea1ac380a74327d083262d2cb52787fe77b Mon Sep 17 00:00:00 2001 From: "ying.yunlong" Date: Tue, 19 Sep 2017 15:37:53 +0800 Subject: Add lcm customer relationship operation Change-Id: Iecbc5831fbcd189ca24a2333b8eb92841dff9f41 Issue-ID: VFC-383 Signed-off-by: ying.yunlong --- lcm/lcm/pub/msapi/aai.py | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'lcm') diff --git a/lcm/lcm/pub/msapi/aai.py b/lcm/lcm/pub/msapi/aai.py index e63cfb6c..150303c3 100644 --- a/lcm/lcm/pub/msapi/aai.py +++ b/lcm/lcm/pub/msapi/aai.py @@ -47,13 +47,13 @@ def create_customer_aai(global_customer_id, data): return json.JSONDecoder().decode(ret[1]), ret[2] -def get_customer_aai(global_customer_id): +def query_customer_aai(global_customer_id): resource = "/business/customers/customer/%s?depth=all" % global_customer_id ret = call_aai(resource, "GET") if ret[0] != 0: logger.error("Status code is %s, detail is %s.", ret[2], ret[1]) raise NFLCMException("Get customer info exception in AAI") - return json.JSONDecoder().decode(ret[1]) + return json.JSONDecoder().decode(ret[1]), ret[2] def delete_customer_aai(global_customer_id, resource_version=""): @@ -73,7 +73,7 @@ def put_customer_relationship(global_customer_id, data): if ret[0] != 0: logger.error("Status code is %s, detail is %s.", ret[2], ret[1]) raise NFLCMException("Put or update customer relationship exception in AAI") - return json.JSONDecoder().decode(ret[1]) + return json.JSONDecoder().decode(ret[1]), ret[2] def delete_customer_relationship(global_customer_id): @@ -82,7 +82,7 @@ def delete_customer_relationship(global_customer_id): if ret[0] != 0: logger.error("Status code is %s, detail is %s.", ret[2], ret[1]) raise NFLCMException("Delete customer relationship exception in AAI") - return json.JSONDecoder().decode(ret[1]) + return json.JSONDecoder().decode(ret[1]), ret[2] def create_ns_aai(global_customer_id, service_type, service_instance_id, data): @@ -128,7 +128,7 @@ def put_ns_relationship(global_customer_id, service_type, service_instance_id, d if ret[0] != 0: logger.error("Status code is %s, detail is %s.", ret[2], ret[1]) raise NFLCMException("Put or update ns instance relationship exception in AAI") - return json.JSONDecoder().decode(ret[1]) + return json.JSONDecoder().decode(ret[1]), ret[2] def delete_ns_relationship(global_customer_id, service_type, service_instance_id): @@ -139,7 +139,7 @@ def delete_ns_relationship(global_customer_id, service_type, service_instance_id if ret[0] != 0: logger.error("Status code is %s, detail is %s.", ret[2], ret[1]) raise NFLCMException("Delete ns instance relationship exception in AAI") - return json.JSONDecoder().decode(ret[1]) + return json.JSONDecoder().decode(ret[1]), ret[2] def create_vnf_aai(vnf_id, data): @@ -177,7 +177,7 @@ def put_vnf_relationship(vnf_id, data): if ret[0] != 0: logger.error("Status code is %s, detail is %s.", ret[2], ret[1]) raise NFLCMException("Put or update vnf instance relationship exception in AAI") - return json.JSONDecoder().decode(ret[1]) + return json.JSONDecoder().decode(ret[1]), ret[2] def delete_vnf_relationship(vnf_id): @@ -186,7 +186,7 @@ def delete_vnf_relationship(vnf_id): if ret[0] != 0: logger.error("Status code is %s, detail is %s.", ret[2], ret[1]) raise NFLCMException("Delete vnf instance relationship exception in AAI") - return json.JSONDecoder().decode(ret[1]) + return json.JSONDecoder().decode(ret[1]), ret[2] def create_vserver_aai(cloud_owner, cloud_region_id, tenant_id, vserver_id, data): @@ -232,7 +232,7 @@ def put_vserver_relationship(cloud_owner, cloud_region_id, tenant_id, vserver_id if ret[0] != 0: logger.error("Status code is %s, detail is %s.", ret[2], ret[1]) raise NFLCMException("Put or update vserver relationship exception in AAI") - return json.JSONDecoder().decode(ret[1]) + return json.JSONDecoder().decode(ret[1]), ret[2] def delete_vserver_relationship(cloud_owner, cloud_region_id, tenant_id, vserver_id): @@ -243,10 +243,4 @@ def delete_vserver_relationship(cloud_owner, cloud_region_id, tenant_id, vserver if ret[0] != 0: logger.error("Status code is %s, detail is %s.", ret[2], ret[1]) raise NFLCMException("Delete vserver relationship exception in AAI") - return json.JSONDecoder().decode(ret[1]) - - - - - - + return json.JSONDecoder().decode(ret[1]), ret[2] -- cgit 1.2.3-korg