self.db.del_list("vnfrs", {"nsr-id-ref": _id})
self.msg.write("ns", "deleted", {"_id": _id})
return v
- if item in ("vim_accounts", "sdns"):
- desc = self.db.get_one(item, filter)
- desc["_admin"]["to_delete"] = True
- self.db.replace(item, _id, desc) # TODO change to set_one
+ if item in ("vim_accounts", "sdns") and not force:
+ self.db.set_one(item, {"_id": _id}, {"_admin.to_delete": True}) # TODO change status
if item == "vim_accounts":
self.msg.write("vim_account", "delete", {"_id": _id})
elif item == "sdns":
return {"deleted": 1} # TODO indicate an offline operation to return 202 ACCEPTED
v = self.db.del_one(item, filter)
- self.fs.file_delete(_id, ignore_non_exist=True)
+ if item in ("vnfds", "nsds"):
+ self.fs.file_delete(_id, ignore_non_exist=True)
+ if item in ("vim_accounts", "sdns", "vnfds", "nsds"):
+ self.msg.write(item[:-1], "deleted", {"_id": _id})
return v
def prune(self):
/ns_instances_content O O
/<nsInstanceId> O O
/ns_instances 5 5
- /<nsInstanceId> 5 5
+ /<nsInstanceId> O5 O5
instantiate O5
terminate O5
action O
"<ID>": {"METHODS": ("GET", "DELETE")}
},
"ns_instances": {"METHODS": ("GET", "POST"),
- "<ID>": {"TODO": ("GET", "DELETE"),
+ "<ID>": {"METHODS": ("GET", "DELETE"),
"scale": {"TODO": "POST"},
"terminate": {"METHODS": "POST"},
"instantiate": {"METHODS": "POST"},