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
20 from typing
import List
23 #######################################################################################
25 class VimState(IntEnum
):
31 class VimOperationState(IntEnum
):
36 class NsState(IntEnum
):
42 class VnfLcmOperationState(IntEnum
):
48 class VnfInstantiationState(IntEnum
):
49 NOT_INSTANTIATED
= auto()
53 class VnfState(IntEnum
):
58 class LcmOperationState(IntEnum
):
64 #######################################################################################
65 # Workflow Dataclasses
69 class VimOperationInput
:
71 Input dataclass for workflows that perform operations
72 (create, update, delete) on VIMs.
77 The UUID of the VIM account as stored in the OSM vim
81 The operation (task) id for this workflow. This is used
82 by the workflow at the end to update the status of the
83 operation in Mongo vim collection.
91 class NsLcmOperationInput
:
93 Input dataclass for workflows that run as LCM operations.
99 A dictionary representing the nslcmop record from the
126 class VduInstantiateInput
:
128 Input dataclass for workflow that instantiates a VDU.
134 charm_info : CharmInfo
140 charm_info
: CharmInfo
144 class VnfInstantiateInput
:
146 Input dataclass for workflow that instantiates a VNF.
151 The UUID of the VNF which is stored in the OSM vnfrs
162 #######################################################################################
163 # Activity Dataclasses
167 class UpdateLcmOperationStateInput
:
169 Input dataclass for updating LCM Operations in the Mongo nslcmops
170 collection. The following attributes will be updated automatically
177 The operation (task) id for this activity. This is the key
178 to the record in nslcmops collection that will be updated.
180 op_state : LcmOperationState
181 A representation of the state of the specified operation id,
182 such as PROCESSING, COMPLETED, or FAILED.
185 Human readable checkpoint message, intended only to give the
189 Human readable error message if any failure occurred.
191 detailed_status : str
192 Human readable message providing additional details to the
193 operation state, such as the error message explaining why
194 the operation failed.
198 op_state
: LcmOperationState
205 class TestVimConnectivityInput
:
207 Input dataclass for the Test Vim Connectivity Ativity
212 The UUID of the VIM account as stored in the OSM vim
220 class UpdateVimStateInput
:
222 Input dataclass for updating VIM state in the DB
227 The UUID of the VIM account as stored in the OSM vim
230 operational_state : VimState
231 A representation of the operational state (ENABLED or ERROR)
235 Human readable message providing additional details to the
236 operational state, such as the error message associated
237 with the ERROR operational_state.
241 operational_state
: VimState
246 class UpdateVimOperationStateInput
:
248 Input dataclass for updating VIM Operations in the Mongo VIM
254 The UUID of the VIM account as stored in the OSM vim
258 The operation (task) id for this workflow. This is used
259 to update the status of the operation in Mongo vim collection.
261 op_state : VimOperationState
262 A representation of the state of the specified operation id,
263 such as COMPLETED, or FAILED.
266 Human readable message providing additional details to the
267 operation state, such as the error message explaining why
268 the operation failed.
273 op_state
: VimOperationState
278 class DeleteVimInput
:
280 Input dataclass for deleting vim record from the database
285 The UUID of the VIM account as stored in the OSM vim
301 The UUID of the NS as stored in the OSM nsr
309 class UpdateNsStateInput
:
311 Input dataclass for updating NS state in the DB
316 The UUID of the NS as stored in the OSM ns
319 operational_state : NsState
320 A representation of the operational state (ENABLED or ERROR)
324 Human readable message providing additional details to the
325 operational state, such as the error message associated
326 with the ERROR operational_state.
337 Contains the information related to a model.
342 The UUID of the VIM as stored in the OSM vim_accounts
346 Name of the Juju model used to deploy charms.
354 class CheckCharmStatusInput
:
356 Input dataclass for checking on a specific charm's deployment
362 The UUID of the VIM as stored in the OSM vim_accounts
366 Name of the model to create in Juju.
368 application_name : str
369 Name of the application that the state is going to be
372 poll_interval : int (optional)
373 Time, in seconds, to wait between status checks.
378 application_name
: str
379 poll_interval
: int = 1
383 class ChangeVnfStateInput
:
385 Input dataclass for changing VNF State.
390 The UUID of the VNF which is stored in the OSM vnfrs
394 A representation of the VNF state (STOPPED or STARTED).
402 class ChangeVnfInstantiationStateInput
:
404 Input dataclass for changing VNF Instantiation State.
409 The UUID of the VNF which is stored in the OSM vnfrs
412 state : VnfInstantiationState
413 A representation of the VNF instantiation state (NOT_INSTANTIATED or INSTANTIATED).
418 state
: VnfInstantiationState
422 class GetTaskQueueInput
:
424 Input dataclass for get task queue activity.
429 The UUID of the VNF which is stored in the OSM vnfrs
438 class GetTaskQueueOutput
:
440 Output dataclass for get task queue activity.
445 Name of the queue which is used to Deploy VNF.
452 class GetVnfDetailsInput
:
454 Input dataclass for get vnf details activity.
459 The UUID of the VNF which is stored in the OSM vnfrs
467 class GetVnfDetailsOutput
:
469 Output dataclass for get vnf details activity.
474 VNF record retrieved from Database.
477 VNF descriptor retrieved from Database.
485 class GetVnfRecordIdsInput
:
490 The UUID of the NS from which to retrieve the VNF records.
497 class GetVnfRecordIdsOutput
:
502 List of the VNF record IDs associated with the NS.