OSMENG-1092 Base Class for Delete NS Record Activity
Change-Id: If54a11d9c899dac57577fdbec436e0c15986e6c3
Signed-off-by: gatici <gulsum.atici@canonical.com>
diff --git a/osm_common/temporal/activities/ns.py b/osm_common/temporal/activities/ns.py
index 4f1f4fe..265a9c1 100644
--- a/osm_common/temporal/activities/ns.py
+++ b/osm_common/temporal/activities/ns.py
@@ -178,3 +178,46 @@
async def __call__(self, activity_input: Input) -> None:
raise NotImplementedError()
+
+
+class DeleteNsRecord(BaseActivity):
+ """Delete a NS record from DB.
+
+ Collaborators:
+ DB Write: nsrs
+
+ Raises (retryable):
+ DbException: If DB access fails, the collection does not exist.
+
+ Activity Lifecycle:
+ This activity should complete relatively quickly (less than a
+ second). However, it would be reasonable to wait up to 10
+ seconds.
+
+ This activity will not report a heartbeat due to its
+ short-running nature.
+
+ This operation is idempotent.
+
+ """
+
+ @dataclass
+ class Input:
+ """
+ Input dataclass for activity that deletes a NS record.
+
+ Attributes:
+ -----------
+ ns_uuid : str
+ The UUID of the NS to be deleted from the nsrs
+ collection in Mongo.
+ """
+
+ ns_uuid: str
+
+ def __init__(self, db: DbBase):
+ super().__init__()
+ self.db: DbBase = db
+
+ async def __call__(self, activity_input: Input) -> None:
+ raise NotImplementedError()