diff options
Diffstat (limited to 'lcm')
-rw-r--r-- | lcm/lcm/pub/aaiapi/aai.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lcm/lcm/pub/aaiapi/aai.py b/lcm/lcm/pub/aaiapi/aai.py index c42ead1b..b952be5f 100644 --- a/lcm/lcm/pub/aaiapi/aai.py +++ b/lcm/lcm/pub/aaiapi/aai.py @@ -106,3 +106,23 @@ def query_vserver(cloud_owner, cloud_region_id, tenant_id, vserver_id, data): logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
raise NFLCMException("Vserver query exception in AAI")
return json.JSONDecoder().decode(ret[1])
+
+def put_vserver_relationship(cloud_owner, cloud_region_id, tenant_id, vserver_id, data):
+ resource = "/cloud-infrastructure/cloud-regions/cloud-region/%s/" \
+ "%s/tenants/tenant/%s/vservers/vserver/%s/relationship-list/relationship" % \
+ (cloud_owner, cloud_region_id, tenant_id, vserver_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 vserver relationship exception in AAI")
+ return json.JSONDecoder().decode(ret[1])
+
+def delete_vserver_relationship(cloud_owner, cloud_region_id, tenant_id, vserver_id, data):
+ resource = "/cloud-infrastructure/cloud-regions/cloud-region/%s/" \
+ "%s/tenants/tenant/%s/vservers/vserver/%s/relationship-list/relationship" % \
+ (cloud_owner, cloud_region_id, tenant_id, vserver_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 vserver relationship exception in AAI")
+ return json.JSONDecoder().decode(ret[1])
|