Activity Delete VNF record
Change-Id: I8c557ebc00833a64041e1c70cc9c6fec4c1a769c
Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
Signed-off-by: Mark Beierl <mark.beierl@canonical.com>
diff --git a/osm_lcm/temporal/vnf_activities.py b/osm_lcm/temporal/vnf_activities.py
index 3ea8c64..dea0551 100644
--- a/osm_lcm/temporal/vnf_activities.py
+++ b/osm_lcm/temporal/vnf_activities.py
@@ -17,6 +17,7 @@
from typing import List, Any
from osm_common.temporal.activities.vnf import (
+ DeleteVnfRecord,
GetTaskQueue,
GetVimCloud,
GetVnfDescriptor,
@@ -174,6 +175,13 @@
self.logger.debug("Send notification for VNF not implemented.")
+@activity.defn(name=DeleteVnfRecord.__name__)
+class DeleteVnfRecordImpl(DeleteVnfRecord):
+ async def __call__(self, activity_input: DeleteVnfRecord.Input) -> None:
+ self.db.del_one("vnfrs", {"_id": activity_input.vnfr_uuid}, fail_on_empty=False)
+ self.logger.debug(f"VNF {activity_input.vnfr_uuid} record deleted from DB.")
+
+
@activity.defn(name=GetModelNames.__name__)
class GetModelNamesImpl(GetModelNames):
async def __call__(