diff options
author | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-10-10 14:29:36 +0800 |
---|---|---|
committer | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-10-10 14:29:36 +0800 |
commit | 65473759b53e4a8fb775181a0530a4115925b6f1 (patch) | |
tree | d549aefc828e2b419d25855495f2232d28f3769b | |
parent | b6391122760a19419f421de132cf4217bf932c59 (diff) |
Create/delete network relationship
Create/delete network relationship to aai in vfc-nfvo-lcm
Change-Id: Icb437266d6febc0b7089d59aa6ea4b2326148e37
Issue-ID: VFC-504
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r-- | lcm/pub/msapi/aai.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lcm/pub/msapi/aai.py b/lcm/pub/msapi/aai.py index 2548ac39..ec0bee93 100644 --- a/lcm/pub/msapi/aai.py +++ b/lcm/pub/msapi/aai.py @@ -275,3 +275,21 @@ def delete_network_aai(network_id, resource_version=""): logger.error("Status code is %s, detail is %s.", ret[2], ret[1]) raise NSLCMException("Network delete exception in AAI") return json.JSONDecoder().decode(ret[1]), ret[2] + + +def put_network_relationship(network_id, data): + resource = "/network/l3-networks/l3-network/%s/relationship-list/relationship" % network_id + ret = call_aai(resource, "PUT", data) + if ret[0] != 0: + logger.error("Status code is %s, detail is %s.", ret[2], ret[1]) + raise NSLCMException("Put or update network relationship exception in AAI") + return json.JSONDecoder().decode(ret[1]), ret[2] + + +def delete_network_relationship(network_id): + resource = "/network/l3-networks/l3-network/%s/relationship-list/relationship" % network_id + ret = call_aai(resource, "DELETE") + if ret[0] != 0: + logger.error("Status code is %s, detail is %s.", ret[2], ret[1]) + raise NSLCMException("Delete network relationship exception in AAI") + return json.JSONDecoder().decode(ret[1]), ret[2] |