1 #######################################################################################
2 # Copyright ETSI Contributors and Others.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #######################################################################################
18 from dataclasses
import dataclass
19 from enum
import auto
, IntEnum
22 #######################################################################################
24 class VimState(IntEnum
):
30 class VimOperationState(IntEnum
):
35 class NsState(IntEnum
):
41 class VnfLcmOperationState(IntEnum
):
47 class VnfInstantiationState(IntEnum
):
48 NOT_INSTANTIATED
= auto()
52 class VnfState(IntEnum
):
57 class LcmOperationState(IntEnum
):
63 #######################################################################################
64 # Workflow Dataclasses
68 class VimOperationInput
:
70 Input dataclass for workflows that perform operations
71 (create, update, delete) on VIMs.
76 The UUID of the VIM account as stored in the OSM vim
80 The operation (task) id for this workflow. This is used
81 by the workflow at the end to update the status of the
82 operation in Mongo vim collection.
90 class NsLcmOperationInput
:
92 Input dataclass for workflows that run as LCM operations.
98 A dictionary representing the nslcmop record from the
106 class NsInstantiateInput
:
108 Input dataclass for workflow that instantiate NS.
113 The UUID of the NS as stored in the OSM nsr
117 The operation (task) id for this workflow. This is used
118 by the workflow at the end to update the status of the
119 operation in Mongo vim collection.
146 class VduInstantiateInput
:
148 Input dataclass for workflow that instantiates a VDU.
154 charm_info : CharmInfo
160 charm_info
: CharmInfo
164 class VnfInstantiateInput
:
166 Input dataclass for workflow that instantiates a VNF.
171 The UUID of the VNF which is stored in the OSM vnfrs
182 #######################################################################################
183 # Activity Dataclasses
187 class UpdateLcmOperationStateInput
:
189 Input dataclass for updating LCM Operations in the Mongo nslcmops
190 collection. The following attributes will be updated automatically
197 The operation (task) id for this activity. This is the key
198 to the record in nslcmops collection that will be updated.
200 op_state : LcmOperationState
201 A representation of the state of the specified operation id,
202 such as PROCESSING, COMPLETED, or FAILED.
205 Human readable checkpoint message, intended only to give the
209 Human readable error message if any failure occurred.
211 detailed_status : str
212 Human readable message providing additional details to the
213 operation state, such as the error message explaining why
214 the operation failed.
218 op_state
: LcmOperationState
225 class TestVimConnectivityInput
:
227 Input dataclass for the Test Vim Connectivity Ativity
232 The UUID of the VIM account as stored in the OSM vim
240 class UpdateVimStateInput
:
242 Input dataclass for updating VIM state in the DB
247 The UUID of the VIM account as stored in the OSM vim
250 operational_state : VimState
251 A representation of the operational state (ENABLED or ERROR)
255 Human readable message providing additional details to the
256 operational state, such as the error message associated
257 with the ERROR operational_state.
261 operational_state
: VimState
266 class UpdateVimOperationStateInput
:
268 Input dataclass for updating VIM Operations in the Mongo VIM
274 The UUID of the VIM account as stored in the OSM vim
278 The operation (task) id for this workflow. This is used
279 to update the status of the operation in Mongo vim collection.
281 op_state : VimOperationState
282 A representation of the state of the specified operation id,
283 such as COMPLETED, or FAILED.
286 Human readable message providing additional details to the
287 operation state, such as the error message explaining why
288 the operation failed.
293 op_state
: VimOperationState
298 class DeleteVimInput
:
300 Input dataclass for deleting vim record from the database
305 The UUID of the VIM account as stored in the OSM vim
321 The UUID of the NS as stored in the OSM nsr
329 class UpdateNsStateInput
:
331 Input dataclass for updating NS state in the DB
336 The UUID of the NS as stored in the OSM ns
339 operational_state : NsState
340 A representation of the operational state (ENABLED or ERROR)
344 Human readable message providing additional details to the
345 operational state, such as the error message associated
346 with the ERROR operational_state.
357 Contains the information related to a model.
362 The UUID of the VIM as stored in the OSM vim_accounts
366 Name of the Juju model used to deploy charms.
374 class CheckCharmStatusInput
:
376 Input dataclass for checking on a specific charm's deployment
382 The UUID of the VIM as stored in the OSM vim_accounts
386 Name of the model to create in Juju.
388 application_name : str
389 Name of the application that the state is going to be
392 poll_interval : int (optional)
393 Time, in seconds, to wait between status checks.
398 application_name
: str
399 poll_interval
: int = 1
403 class ChangeVnfStateInput
:
405 Input dataclass for changing VNF State.
410 The UUID of the VNF which is stored in the OSM vnfrs
414 A representation of the VNF state (STOPPED or STARTED).
422 class ChangeVnfInstantiationStateInput
:
424 Input dataclass for changing VNF Instantiation State.
429 The UUID of the VNF which is stored in the OSM vnfrs
432 state : VnfInstantiationState
433 A representation of the VNF instantiation state (NOT_INSTANTIATED or INSTANTIATED).
438 state
: VnfInstantiationState
442 class GetTaskQueueInput
:
444 Input dataclass for get task queue activity.
449 The UUID of the VNF which is stored in the OSM vnfrs
458 class GetTaskQueueOutput
:
460 Output dataclass for get task queue activity.
465 Name of the queue which is used to Deploy VNF.
472 class GetVnfDetailsInput
:
474 Input dataclass for get vnf details activity.
479 The UUID of the VNF which is stored in the OSM vnfrs
487 class GetVnfDetailsOutput
:
489 Output dataclass for get vnf details activity.
494 VNF record retrieved from Database.
497 VNF descriptor retrieved from Database.