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
180 class PrepareVnfInput
:
182 Input dataclass for workflow that instantiates a VNF.
187 The UUID of the VNF which is stored in the OSM vnfrs
195 #######################################################################################
196 # Activity Dataclasses
200 class UpdateLcmOperationStateInput
:
202 Input dataclass for updating LCM Operations in the Mongo nslcmops
203 collection. The following attributes will be updated automatically
210 The operation (task) id for this activity. This is the key
211 to the record in nslcmops collection that will be updated.
213 op_state : LcmOperationState
214 A representation of the state of the specified operation id,
215 such as PROCESSING, COMPLETED, or FAILED.
218 Human readable checkpoint message, intended only to give the
222 Human readable error message if any failure occurred.
224 detailed_status : str
225 Human readable message providing additional details to the
226 operation state, such as the error message explaining why
227 the operation failed.
231 op_state
: LcmOperationState
238 class TestVimConnectivityInput
:
240 Input dataclass for the Test Vim Connectivity Ativity
245 The UUID of the VIM account as stored in the OSM vim
253 class UpdateVimStateInput
:
255 Input dataclass for updating VIM state in the DB
260 The UUID of the VIM account as stored in the OSM vim
263 operational_state : VimState
264 A representation of the operational state (ENABLED or ERROR)
268 Human readable message providing additional details to the
269 operational state, such as the error message associated
270 with the ERROR operational_state.
274 operational_state
: VimState
279 class UpdateVimOperationStateInput
:
281 Input dataclass for updating VIM Operations in the Mongo VIM
287 The UUID of the VIM account as stored in the OSM vim
291 The operation (task) id for this workflow. This is used
292 to update the status of the operation in Mongo vim collection.
294 op_state : VimOperationState
295 A representation of the state of the specified operation id,
296 such as COMPLETED, or FAILED.
299 Human readable message providing additional details to the
300 operation state, such as the error message explaining why
301 the operation failed.
306 op_state
: VimOperationState
311 class DeleteVimInput
:
313 Input dataclass for deleting vim record from the database
318 The UUID of the VIM account as stored in the OSM vim
334 The UUID of the NS as stored in the OSM nsr
342 class UpdateNsStateInput
:
344 Input dataclass for updating NS state in the DB
349 The UUID of the NS as stored in the OSM ns
352 operational_state : NsState
353 A representation of the operational state (ENABLED or ERROR)
357 Human readable message providing additional details to the
358 operational state, such as the error message associated
359 with the ERROR operational_state.
370 Contains the information related to a model.
375 The UUID of the VIM as stored in the OSM vim_accounts
379 Name of the Juju model used to deploy charms.
387 class ChangeVnfStateInput
:
389 Input dataclass for changing NF State.
394 The UUID of the VNF which is stored in the OSM vnfrs
398 A representation of the VNF state (STOPPED or STARTED).
406 class ChangeVnfInstantiationStateInput
:
408 Input dataclass for changing NF Instantiation State.
413 The UUID of the VNF which is stored in the OSM vnfrs
416 state : VnfInstantiationState
417 A representation of the VNF instantiation state (NOT_INSTANTIATED or INSTANTIATED).
422 state
: VnfInstantiationState
426 class GetTaskQueueInput
:
428 Input dataclass for creating a Juju Model.
433 The UUID of the VNF which is stored in the OSM vnfrs
442 class GetTaskQueueOutput
:
444 Output dataclass for get task queue activity.
449 Name of the queue which is used to Deploy VNF.