summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2017-08-29 11:17:36 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2017-08-29 11:17:36 +0800
commit3c30a6fe0eb4a4fb10d86b826102779b08a26dc9 (patch)
tree19477b6d3058e1f0f9cb812144d13d344b63a102
parent60a959810864b38012e31a9ba85ced721318fbc0 (diff)
implement ns instance relationship
implement put and delete ns instance relationship function. Change-Id: I1ce6d38ea3219acb316413adc78f98b2efd418ad Issue-ID: VFC-170 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r--lcm/lcm/pub/aaiapi/aai.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/lcm/lcm/pub/aaiapi/aai.py b/lcm/lcm/pub/aaiapi/aai.py
index bd51f63b..36ed2bfb 100644
--- a/lcm/lcm/pub/aaiapi/aai.py
+++ b/lcm/lcm/pub/aaiapi/aai.py
@@ -142,3 +142,23 @@ def delete_vnf_relationship(vnf_id, data):
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])
+
+def put_ns_relationship(global_customer_id, service_type, service_instance_id, data):
+ resource = "/business/customers/customer/%s/service-subscriptions/service-subscription/" \
+ "%s/service-instances/service-instance/%s/relationship-list/relationship" % \
+ (global_customer_id, service_type, service_instance_id)
+ ret = call_req_aai(AAI_BASE_URL, AAI_USER, AAI_PASSWORD, rest_no_auth, resource, "PUT", data)
+ 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])
+
+def delete_ns_relationship(global_customer_id, service_type, service_instance_id, data):
+ resource = "/business/customers/customer/%s/service-subscriptions/service-subscription/" \
+ "%s/service-instances/service-instance/%s/relationship-list/relationship" % \
+ (global_customer_id, service_type, service_instance_id)
+ ret = call_req_aai(AAI_BASE_URL, AAI_USER, AAI_PASSWORD, rest_no_auth, resource, "DELETE", data)
+ 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]) \ No newline at end of file