OSMENG-1171 NsDeleteRecords Workflow 51/13751/2
authorgatici <gulsum.atici@canonical.com>
Thu, 27 Jul 2023 10:32:48 +0000 (13:32 +0300)
committergatici <gulsum.atici@canonical.com>
Thu, 27 Jul 2023 18:10:57 +0000 (21:10 +0300)
Change-Id: I05690ba6566e509bd652917f2a5dd69e3798e2bd
Signed-off-by: gatici <gulsum.atici@canonical.com>
osm_common/temporal/states.py
osm_common/temporal/workflows/ns.py

index 1c4c896..ded7845 100644 (file)
@@ -32,6 +32,7 @@ class VimOperationState(IntEnum):
 class NsState(IntEnum):
     PROCESSING = auto()
     INSTANTIATED = auto()
+    NOT_INSTANTIATED = auto()
     ERROR = auto()
 
 
index acd2670..70e1e3d 100644 (file)
@@ -18,6 +18,7 @@
 from abc import abstractmethod
 from dataclasses import dataclass
 
+from osm_common.temporal.workflows.base import BaseWorkflow
 from osm_common.temporal.workflows.lcm import LcmOperationWorkflow
 
 
@@ -46,3 +47,31 @@ class NsInstantiateWorkflow(LcmOperationWorkflow):
     @abstractmethod
     async def run(self, workflow_input: Input) -> None:
         pass
+
+
+class NsDeleteRecordsWorkflow(BaseWorkflow):
+    """Delete the records belongs to NS from DB.
+
+    Workflow Identifier:
+        It is recommended that the ID for the NS is referred as a workflow
+        ID when invoking this workflow.
+    """
+
+    @dataclass
+    class Input:
+        """
+        Input dataclass for workflow that deletes a NS.
+
+        Attributes:
+        -----------
+        ns_uuid : str
+            The UUID of the VNF which is stored in the OSM nsrs
+            collection in Mongo.
+
+        """
+
+        ns_uuid: str
+
+    @abstractmethod
+    async def run(self, workflow_input: Input) -> None:
+        pass