diff options
author | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-10-13 10:57:51 +0800 |
---|---|---|
committer | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-10-13 10:57:51 +0800 |
commit | 7a1f286dd4046238573d4738b63638fefbadb130 (patch) | |
tree | 25e7fffdf2551a6bb7d88353c05c601a4f321471 | |
parent | 2617c135ce28823ff6192f22fb1f8dc9214c597b (diff) |
Report vfc-lcm subnet resource to aai
Change-Id: I30b805fb5f16727f571159672cd443757b6dc4ec
Issue-ID: VFC-532
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r-- | lcm/ns/vls/create_vls.py | 12 | ||||
-rw-r--r-- | lcm/ns/vls/delete_vls.py | 4 | ||||
-rw-r--r-- | resources/dbscripts/mysql/vfc-nfvo-lcm-createobj.sql | 2 |
3 files changed, 13 insertions, 5 deletions
diff --git a/lcm/ns/vls/create_vls.py b/lcm/ns/vls/create_vls.py index 15dee547..dc721018 100644 --- a/lcm/ns/vls/create_vls.py +++ b/lcm/ns/vls/create_vls.py @@ -57,7 +57,7 @@ class CreateVls(object): self.create_vl_to_resmgr() self.save_vl_to_db() if REPORT_TO_AAI: - self.create_network_in_aai() + self.create_network_and_subnet_in_aai() return {"result": 0, "detail": "instantiation vl success", "vlId": self.vl_inst_id} except NSLCMException as e: return self.exception_handle(e) @@ -194,7 +194,7 @@ class CreateVls(object): # do_biz_with_share_lock("create-vllist-in-vnffg-%s" % self.owner_id, self.create_vl_inst_id_in_vnffg) self.create_vl_inst_id_in_vnffg() - def create_network_in_aai(self): + def create_network_and_subnet_in_aai(self): logger.debug("CreateVls::create_network_in_aai::report network[%s] to aai." % self.vl_inst_id) data = { "network-id": self.vl_inst_id, @@ -203,6 +203,14 @@ class CreateVls(object): "is-provider-network": True, "is-shared-network": True, "is-external-network": True, + "subnets": { + "subnet": [ + { + "subnet-id": self.related_subnetwork_id, + "dhcp-enabled": False + } + ] + }, "relationship-list": { "relationship": [ { diff --git a/lcm/ns/vls/delete_vls.py b/lcm/ns/vls/delete_vls.py index 4ed7bc8c..8c089b1c 100644 --- a/lcm/ns/vls/delete_vls.py +++ b/lcm/ns/vls/delete_vls.py @@ -43,7 +43,7 @@ class DeleteVls(object): self.delete_vl_from_vim(vim_id, subnetwork_id_list, network_id) self.delete_vl_from_resmgr() if REPORT_TO_AAI: - self.delete_network_in_aai() + self.delete_network_and_subnet_in_aai() self.delete_vl_from_db(vl_inst_info) return {"result": 0, "detail": "delete vl success"} except NSLCMException as e: @@ -83,7 +83,7 @@ class DeleteVls(object): new_vl_id_list = new_vl_id_list[:-1] VNFFGInstModel.objects.filter(vnffginstid=vnffg_info.vnffginstid).update(vllist=new_vl_id_list) - def delete_network_in_aai(self): + def delete_network_and_subnet_in_aai(self): logger.debug("DeleteVls::delete_network_in_aai::delete network[%s] in aai." % self.vl_inst_id) # query network in aai, get resource_version diff --git a/resources/dbscripts/mysql/vfc-nfvo-lcm-createobj.sql b/resources/dbscripts/mysql/vfc-nfvo-lcm-createobj.sql index 79c48509..f42915fb 100644 --- a/resources/dbscripts/mysql/vfc-nfvo-lcm-createobj.sql +++ b/resources/dbscripts/mysql/vfc-nfvo-lcm-createobj.sql @@ -145,7 +145,7 @@ CREATE TABLE NFVO_NSINST ( `CREATETIME` varchar(200) NULL, `LASTUPTIME` varchar(200) NULL, `GLOBALCUSTOMERID` varchar(50) NULL, - `SERVICETYPE` varchar(50) NULL + `SERVICETYPE` varchar(50) NULL ); DROP TABLE IF EXISTS NFVO_PORTINST; |