From: gatici Date: Thu, 27 Jul 2023 10:32:48 +0000 (+0300) Subject: OSMENG-1171 NsDeleteRecords Workflow X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F51%2F13751%2F2;p=osm%2Fcommon.git OSMENG-1171 NsDeleteRecords Workflow Change-Id: I05690ba6566e509bd652917f2a5dd69e3798e2bd Signed-off-by: gatici --- diff --git a/osm_common/temporal/states.py b/osm_common/temporal/states.py index 1c4c896..ded7845 100644 --- a/osm_common/temporal/states.py +++ b/osm_common/temporal/states.py @@ -32,6 +32,7 @@ class VimOperationState(IntEnum): class NsState(IntEnum): PROCESSING = auto() INSTANTIATED = auto() + NOT_INSTANTIATED = auto() ERROR = auto() diff --git a/osm_common/temporal/workflows/ns.py b/osm_common/temporal/workflows/ns.py index acd2670..70e1e3d 100644 --- a/osm_common/temporal/workflows/ns.py +++ b/osm_common/temporal/workflows/ns.py @@ -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