X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Finstance_topics.py;h=139ced72da3d638b8b3f63c6b159e62fa0575321;hp=986d4d3e062f83b75f7bcaabd5c77df0a4335977;hb=bee3bad8d15fe0893855d0dff92cef4351629edb;hpb=b091dc1758a3ac2838d5c6d324e8cacaa11be7d7 diff --git a/osm_nbi/instance_topics.py b/osm_nbi/instance_topics.py index 986d4d3..139ced7 100644 --- a/osm_nbi/instance_topics.py +++ b/osm_nbi/instance_topics.py @@ -74,13 +74,14 @@ class NsrTopic(BaseTopic): "Launch 'terminate' operation first; or force deletion".format(_id), http_code=HTTPStatus.CONFLICT) - def delete_extra(self, session, _id, db_content): + def delete_extra(self, session, _id, db_content, not_send_msg=None): """ Deletes associated nslcmops and vnfrs from database. Deletes associated filesystem. Set usageState of pdu, vnfd, nsd :param session: contains "username", "admin", "force", "public", "project_id", "set_project" :param _id: server internal id :param db_content: The database content of the descriptor + :param not_send_msg: To not send message (False) or store content (list) instead :return: None if ok or raises EngineException with the problem """ self.fs.file_delete(_id, ignore_non_exist=True) @@ -350,10 +351,10 @@ class NsrTopic(BaseTopic): kdur = {x: kdu[x] for x in kdu if x in ("helm-chart", "juju-bundle")} kdur["kdu-name"] = kdu["name"] # TODO "name": "" Name of the VDU in the VIM - kdur["ip-address"] = None, # mgmt-interface filled by LCM - kdur["k8s-cluster"] = {}, + kdur["ip-address"] = None # mgmt-interface filled by LCM + kdur["k8s-cluster"] = {} kdur["additionalParams"] = self._format_addional_params(ns_request, member_vnf["member-vnf-index"], - kdu_name=kdu["name"], descriptor=vnfd), + kdu_name=kdu["name"], descriptor=vnfd) if not vnfr_descriptor.get("kdur"): vnfr_descriptor["kdur"] = [] vnfr_descriptor["kdur"].append(kdur) @@ -367,7 +368,7 @@ class NsrTopic(BaseTopic): "internal-connection-point": [], "interfaces": [], "additionalParams": self._format_addional_params(ns_request, member_vnf["member-vnf-index"], - vdu_id=vdu["id"], descriptor=vnfd), + vdu_id=vdu["id"], descriptor=vnfd) } if vdu.get("pdu-type"): vdur["pdu-type"] = vdu["pdu-type"] @@ -458,7 +459,7 @@ class VnfrTopic(BaseTopic): def __init__(self, db, fs, msg, auth): BaseTopic.__init__(self, db, fs, msg, auth) - def delete(self, session, _id, dry_run=False): + def delete(self, session, _id, dry_run=False, not_send_msg=None): raise EngineException("Method delete called directly", HTTPStatus.INTERNAL_SERVER_ERROR) def edit(self, session, _id, indata=None, kwargs=None, content=None): @@ -675,7 +676,6 @@ class NsLcmOpTopic(BaseTopic): Look for a free PDU in the catalog matching vdur type and interfaces. Fills vnfr.vdur with the interface (ip_address, ...) information. Modifies PDU _admin.usageState to 'IN_USE' - :param session: contains "username", "admin", "force", "public", "project_id", "set_project" :param rollback: list with the database modifications to rollback if needed :param vnfr: vnfr to be updated. It is modified with pdu interface info if pdu is found @@ -1000,7 +1000,7 @@ class NsLcmOpTopic(BaseTopic): # except DbException as e: # raise EngineException("Cannot get ns_instance '{}': {}".format(e), HTTPStatus.NOT_FOUND) - def delete(self, session, _id, dry_run=False): + def delete(self, session, _id, dry_run=False, not_send_msg=None): raise EngineException("Method delete called directly", HTTPStatus.INTERNAL_SERVER_ERROR) def edit(self, session, _id, indata=None, kwargs=None, content=None): @@ -1071,13 +1071,14 @@ class NsiTopic(BaseTopic): "Launch 'terminate' operation first; or force deletion".format(_id), http_code=HTTPStatus.CONFLICT) - def delete_extra(self, session, _id, db_content): + def delete_extra(self, session, _id, db_content, not_send_msg=None): """ Deletes associated nsilcmops from database. Deletes associated filesystem. Set usageState of nst :param session: contains "username", "admin", "force", "public", "project_id", "set_project" :param _id: server internal id :param db_content: The database content of the descriptor + :param not_send_msg: To not send message (False) or store content (list) instead :return: None if ok or raises EngineException with the problem """ @@ -1093,7 +1094,7 @@ class NsiTopic(BaseTopic): if nsi: # last one using nsr continue try: - self.nsrTopic.delete(session, nsr_id, dry_run=False) + self.nsrTopic.delete(session, nsr_id, dry_run=False, not_send_msg=not_send_msg) except (DbException, EngineException) as e: if e.http_code == HTTPStatus.NOT_FOUND: pass @@ -1231,7 +1232,7 @@ class NsiTopic(BaseTopic): nsi_vlds.append(nsi_vld) nsi_descriptor["_admin"]["netslice-vld"] = nsi_vlds - # Creating netslice-subnet_record. + # Creating netslice-subnet_record. needed_nsds = {} services = [] @@ -1511,7 +1512,7 @@ class NsiLcmOpTopic(BaseTopic): except ValidationError as e: raise EngineException(e, HTTPStatus.UNPROCESSABLE_ENTITY) - def delete(self, session, _id, dry_run=False): + def delete(self, session, _id, dry_run=False, not_send_msg=None): raise EngineException("Method delete called directly", HTTPStatus.INTERNAL_SERVER_ERROR) def edit(self, session, _id, indata=None, kwargs=None, content=None):