diff options
author | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-08-26 10:59:37 +0800 |
---|---|---|
committer | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-08-26 10:59:37 +0800 |
commit | 60a959810864b38012e31a9ba85ced721318fbc0 (patch) | |
tree | cdfb566fae335154fc9f67e25a9491f7c8553f6a /lcm | |
parent | 00566ce913cc37d5da5d1ec23cb24739f5eee3f0 (diff) |
implement vnf instance relationship
implement put and delete vnf
instance relationship function.
Change-Id: I11419e0825c06e9b09505afd91b82d599249dcd3
Issue-ID: VFC-169
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'lcm')
-rw-r--r-- | lcm/lcm/pub/aaiapi/aai.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lcm/lcm/pub/aaiapi/aai.py b/lcm/lcm/pub/aaiapi/aai.py index b952be5f..bd51f63b 100644 --- a/lcm/lcm/pub/aaiapi/aai.py +++ b/lcm/lcm/pub/aaiapi/aai.py @@ -126,3 +126,19 @@ def delete_vserver_relationship(cloud_owner, cloud_region_id, tenant_id, vserver 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])
+
+def put_vnf_relationship(vnf_id, data):
+ resource = "/network/generic-vnfs/generic-vnf/%s/relationship-list/relationship" % vnf_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 vnf instance relationship exception in AAI")
+ return json.JSONDecoder().decode(ret[1])
+
+def delete_vnf_relationship(vnf_id, data):
+ resource = "/network/generic-vnfs/generic-vnf/%s/relationship-list/relationship" % vnf_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 vnf instance relationship exception in AAI")
+ return json.JSONDecoder().decode(ret[1])
|