From 5ce2c4054fea8bbc9a6197ee2f07376b833dd3a1 Mon Sep 17 00:00:00 2001 From: gatici Date: Thu, 27 Jul 2023 13:32:48 +0300 Subject: [PATCH] OSMENG-1171 NsDeleteRecords Workflow Change-Id: I05690ba6566e509bd652917f2a5dd69e3798e2bd Signed-off-by: gatici --- osm_common/temporal/states.py | 1 + osm_common/temporal/workflows/ns.py | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) 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 -- 2.25.1