X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_common%2Fdataclasses%2Ftemporal_dataclasses.py;h=de541f2e9592af45d0c6f9766e9a9e5d754d732b;hb=4407a0e03c999f5729874d48fe6dd6013e4e5812;hp=8694fa7d941d02cef2a69a5f37fba68e0aaf3ffb;hpb=42c4ba280bb6132bfb501df58d0f0b7e14d3abb1;p=osm%2Fcommon.git diff --git a/osm_common/dataclasses/temporal_dataclasses.py b/osm_common/dataclasses/temporal_dataclasses.py index 8694fa7..de541f2 100644 --- a/osm_common/dataclasses/temporal_dataclasses.py +++ b/osm_common/dataclasses/temporal_dataclasses.py @@ -17,6 +17,7 @@ from dataclasses import dataclass from enum import auto, IntEnum +from typing import List ####################################################################################### @@ -103,43 +104,68 @@ class NsLcmOperationInput: @dataclass -class NsInstantiateInput: +class CharmInfo: """ - Input dataclass for workflow that instantiate NS. + Input dataclass for Attributes: ----------- - ns_uuid : str - The UUID of the NS as stored in the OSM nsr - collection in Mongo + app_name : str - op_id: str - The operation (task) id for this workflow. This is used - by the workflow at the end to update the status of the - operation in Mongo vim collection. + channel: str + + entity_url: str """ - ns_uuid: str - op_id: str + app_name: str + channel: str + entity_url: str @dataclass -class CharmInfo: +class GetVimCloudInput: """ - Input dataclass for + Input dataclass for get vim cloud activity. Attributes: ----------- - app_name : str + vnfr_uuid : str + The UUID of the VNF which is stored in the OSM vnfrs + collection in Mongo. - channel: str + """ - entity_url: str + vnfr_uuid: str + + +@dataclass +class GetVimCloudOutput: """ + Output dataclass for get vim cloud activity. - app_name: str - channel: str - entity_url: str + Attributes: + ----------- + cloud : str + Type of the cloud which is used to Deploy VNF. + """ + + cloud: str + + +@dataclass +class VduComputeConstraints: + """ + Input dataclass for VDU constraints + + Attributes: + ----------- + cores : int (Number of virtual CPUs) + + mem: int (GB) + """ + + cores: int + mem: int @dataclass @@ -153,11 +179,19 @@ class VduInstantiateInput: charm_info : CharmInfo + constraints: VduComputeConstraints + + cloud: VIM cloud type + + config: Config details of application """ vim_uuid: str model_name: str charm_info: CharmInfo + constraints: VduComputeConstraints + cloud: str + config: dict @dataclass @@ -171,25 +205,43 @@ class VnfInstantiateInput: The UUID of the VNF which is stored in the OSM vnfrs collection in Mongo. + model_name: str + """ vnfr_uuid: str + model_name: str @dataclass -class PrepareVnfInput: +class GetNsRecordInput: """ - Input dataclass for workflow that instantiates a VNF. + Input dataclass for getting NS record activity. Attributes: ----------- - vnfr_uuid : str - The UUID of the VNF which is stored in the OSM vnfrs + nsr_uuid : + The UUID of the NS record which is stored in the OSM nsrs collection in Mongo. """ - vnfr_uuid: str + nsr_uuid: str + + +@dataclass +class GetNsRecordOutput: + """ + Output dataclass for getting NS record activity. + + Attributes: + ----------- + nsr : dict + NS record retrieved from Database.. + + """ + + nsr: dict ####################################################################################### @@ -383,10 +435,39 @@ class ModelInfo: model_name: str +@dataclass +class CheckCharmStatusInput: + """ + Input dataclass for checking on a specific charm's deployment + status + + Attributes: + ----------- + vim_uuid : str + The UUID of the VIM as stored in the OSM vim_accounts + collection in Mongo. + + model_name : str + Name of the model to create in Juju. + + application_name : str + Name of the application that the state is going to be + awaited. + + poll_interval : int (optional) + Time, in seconds, to wait between status checks. + """ + + vim_uuid: str + model_name: str + application_name: str + poll_interval: int = 1 + + @dataclass class ChangeVnfStateInput: """ - Input dataclass for changing NF State. + Input dataclass for changing VNF State. Attributes: ----------- @@ -405,7 +486,7 @@ class ChangeVnfStateInput: @dataclass class ChangeVnfInstantiationStateInput: """ - Input dataclass for changing NF Instantiation State. + Input dataclass for changing VNF Instantiation State. Attributes: ----------- @@ -425,7 +506,7 @@ class ChangeVnfInstantiationStateInput: @dataclass class GetTaskQueueInput: """ - Input dataclass for creating a Juju Model. + Input dataclass for get task queue activity. Attributes: ----------- @@ -450,3 +531,60 @@ class GetTaskQueueOutput: """ 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 + + +@dataclass +class GetVnfRecordIdsInput: + """ + Attributes: + ----------- + ns_uuid : str + The UUID of the NS from which to retrieve the VNF records. + """ + + ns_uuid: str + + +@dataclass +class GetVnfRecordIdsOutput: + """ + Attributes: + ----------- + vnfr_ids : list[str] + List of the VNF record IDs associated with the NS. + """ + + vnfr_ids: List[str]