X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_common%2Fdataclasses%2Ftemporal_dataclasses.py;h=050ae9a1c829672efdf9af4645205fa6db0ed277;hb=refs%2Fchanges%2F70%2F13170%2F5;hp=9bd637808f9ba36b839b4c00d0e17fb3318581eb;hpb=36a62b88b9ad60b2355fab6ab2868c5f10b192c7;p=osm%2Fcommon.git diff --git a/osm_common/dataclasses/temporal_dataclasses.py b/osm_common/dataclasses/temporal_dataclasses.py index 9bd6378..050ae9a 100644 --- a/osm_common/dataclasses/temporal_dataclasses.py +++ b/osm_common/dataclasses/temporal_dataclasses.py @@ -18,6 +18,48 @@ from dataclasses import dataclass from enum import auto, IntEnum + +####################################################################################### +# Defining States +class VimState(IntEnum): + PROCESSING = auto() + ENABLED = auto() + ERROR = auto() + + +class VimOperationState(IntEnum): + COMPLETED = auto() + FAILED = auto() + + +class NsState(IntEnum): + PROCESSING = auto() + INSTANTIATED = auto() + ERROR = auto() + + +class VnfLcmOperationState(IntEnum): + PROCESSING = auto() + COMPLETED = auto() + FAILED = auto() + + +class VnfInstantiationState(IntEnum): + NOT_INSTANTIATED = auto() + INSTANTIATED = auto() + + +class VnfState(IntEnum): + STOPPED = auto() + STARTED = auto() + + +class LcmOperationState(IntEnum): + PROCESSING = auto() + COMPLETED = auto() + FAILED = auto() + + ####################################################################################### # Workflow Dataclasses @@ -118,14 +160,40 @@ class VduInstantiateInput: charm_info: CharmInfo -####################################################################################### -# Activity Dataclasses +@dataclass +class VnfInstantiateInput: + """ + Input dataclass for workflow that instantiates a VNF. + Attributes: + ----------- + vnfr_uuid : str + The UUID of the VNF which is stored in the OSM vnfrs + collection in Mongo. -class LcmOperationState(IntEnum): - PROCESSING = auto() - COMPLETED = auto() - FAILED = auto() + """ + + vnfr_uuid: str + + +@dataclass +class PrepareVnfInput: + """ + Input dataclass for workflow that prepares a VNF. + + Attributes: + ----------- + vnfr_uuid : str + The UUID of the VNF which is stored in the OSM vnfrs + collection in Mongo. + + """ + + vnfr_uuid: str + + +####################################################################################### +# Activity Dataclasses @dataclass @@ -181,12 +249,6 @@ class TestVimConnectivityInput: vim_uuid: str -class VimState(IntEnum): - PROCESSING = auto() - ENABLED = auto() - ERROR = auto() - - @dataclass class UpdateVimStateInput: """ @@ -213,11 +275,6 @@ class UpdateVimStateInput: message: str -class VimOperationState(IntEnum): - COMPLETED = auto() - FAILED = auto() - - @dataclass class UpdateVimOperationStateInput: """ @@ -281,12 +338,6 @@ class DeployNsInput: ns_uuid: str -class NsState(IntEnum): - PROCESSING = auto() - INSTANTIATED = auto() - ERROR = auto() - - @dataclass class UpdateNsStateInput: """ @@ -314,9 +365,9 @@ class UpdateNsStateInput: @dataclass -class CreateModelInput: +class ModelInfo: """ - Input dataclass for creating a Juju Model. + Contains the information related to a model. Attributes: ----------- @@ -325,8 +376,110 @@ class CreateModelInput: collection in Mongo. model_name : str - Name of the model to create in Juju. + Name of the Juju model used to deploy charms. """ vim_uuid: str model_name: str + + +@dataclass +class ChangeVnfStateInput: + """ + Input dataclass for changing VNF State. + + Attributes: + ----------- + vnfr_uuid : str + The UUID of the VNF which is stored in the OSM vnfrs + collection in Mongo. + + state : VnfState + A representation of the VNF state (STOPPED or STARTED). + """ + + vnfr_uuid: str + state: VnfState + + +@dataclass +class ChangeVnfInstantiationStateInput: + """ + Input dataclass for changing VNF Instantiation State. + + Attributes: + ----------- + vnfr_uuid : str + The UUID of the VNF which is stored in the OSM vnfrs + collection in Mongo. + + state : VnfInstantiationState + A representation of the VNF instantiation state (NOT_INSTANTIATED or INSTANTIATED). + + """ + + vnfr_uuid: str + state: VnfInstantiationState + + +@dataclass +class GetTaskQueueInput: + """ + Input dataclass for get task queue activity. + + Attributes: + ----------- + vnfr_uuid : str + The UUID of the VNF which is stored in the OSM vnfrs + collection in Mongo. + + """ + + vnfr_uuid: str + + +@dataclass +class GetTaskQueueOutput: + """ + Output dataclass for get task queue activity. + + Attributes: + ----------- + task_queue : str + Name of the queue which is used to Deploy VNF. + """ + + task_queue: str + + +@dataclass +class GetVnfDetailsInput: + """ + Input dataclass for get vnf details activity. + + Attributes: + ----------- + vnfr_uuid : str + The UUID of the VNF which is stored in the OSM vnfrs + collection in Mongo. + """ + + vnfr_uuid: str + + +@dataclass +class GetVnfDetailsOutput: + """ + Output dataclass for get vnf details activity. + + Attributes: + ----------- + vnfr : dict + VNF record retrieved from Database. + + vnfd : dict + VNF descriptor retrieved from Database. + """ + + vnfr: dict + vnfd: dict