+
+ def save_vl_to_db(self):
+ VLInstModel(vlinstanceid=self.vl_inst_id, vldid=self.vld_id, vlinstancename=self.vl_inst_name,
+ ownertype=self.owner_type, ownerid=self.owner_id, relatednetworkid=self.related_network_id,
+ relatedsubnetworkid=self.related_subnetwork_id, vimid=self.vim_id, tenant=self.tenant).save()
+ # 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):
+ logger.debug("CreateVls::create_network_in_aai::report network[%s] to aai." % self.vl_inst_id)
+ data = {
+ "network-id": self.vl_inst_id,
+ "network-name": self.vl_inst_name,
+ "is-bound-to-vpn": "false",
+ "is-provider-network": "true",
+ "is-shared-network": "true",
+ "is-external-network": "true",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "generic-vnf",
+ "relationship-data": [
+ {
+ "relationship-key": "generic-vnf.vnf-id",
+ "relationship-value": self.owner_id
+ }
+ ]
+ }
+ ]
+ }
+ }
+ resp_data, resp_status = create_network_aai(self.vl_inst_id, data)
+ if resp_data:
+ logger.debug("Fail to create network[%s] to aai: [%s].", self.vl_inst_id, resp_status)
+ else:
+ logger.debug("Success to create network[%s] to aai: [%s].", self.vl_inst_id, resp_status)