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 GetVimCloudInput
:
128 Input dataclass for get vim cloud activity.
133 The UUID of the VNF which is stored in the OSM vnfrs
142 class GetVimCloudOutput
:
144 Output dataclass for get vim cloud activity.
149 Type of the cloud which is used to Deploy VNF.
156 class VduComputeConstraints
:
158 Input dataclass for VDU constraints
162 cores : int (Number of virtual CPUs)
166 cloud: str (VIM cloud type)
175 class VduInstantiateInput
:
177 Input dataclass for workflow that instantiates a VDU.
183 charm_info : CharmInfo
185 constraints: VduComputeConstraints
190 charm_info
: CharmInfo
191 constraints
: VduComputeConstraints
195 class VnfInstantiateInput
:
197 Input dataclass for workflow that instantiates a VNF.
202 The UUID of the VNF which is stored in the OSM vnfrs
213 #######################################################################################
214 # Activity Dataclasses
218 class UpdateLcmOperationStateInput
:
220 Input dataclass for updating LCM Operations in the Mongo nslcmops
221 collection. The following attributes will be updated automatically
228 The operation (task) id for this activity. This is the key
229 to the record in nslcmops collection that will be updated.
231 op_state : LcmOperationState
232 A representation of the state of the specified operation id,
233 such as PROCESSING, COMPLETED, or FAILED.
236 Human readable checkpoint message, intended only to give the
240 Human readable error message if any failure occurred.
242 detailed_status : str
243 Human readable message providing additional details to the
244 operation state, such as the error message explaining why
245 the operation failed.
249 op_state
: LcmOperationState
256 class TestVimConnectivityInput
:
258 Input dataclass for the Test Vim Connectivity Ativity
263 The UUID of the VIM account as stored in the OSM vim
271 class UpdateVimStateInput
:
273 Input dataclass for updating VIM state in the DB
278 The UUID of the VIM account as stored in the OSM vim
281 operational_state : VimState
282 A representation of the operational state (ENABLED or ERROR)
286 Human readable message providing additional details to the
287 operational state, such as the error message associated
288 with the ERROR operational_state.
292 operational_state
: VimState
297 class UpdateVimOperationStateInput
:
299 Input dataclass for updating VIM Operations in the Mongo VIM
305 The UUID of the VIM account as stored in the OSM vim
309 The operation (task) id for this workflow. This is used
310 to update the status of the operation in Mongo vim collection.
312 op_state : VimOperationState
313 A representation of the state of the specified operation id,
314 such as COMPLETED, or FAILED.
317 Human readable message providing additional details to the
318 operation state, such as the error message explaining why
319 the operation failed.
324 op_state
: VimOperationState
329 class DeleteVimInput
:
331 Input dataclass for deleting vim record from the database
336 The UUID of the VIM account as stored in the OSM vim
352 The UUID of the NS as stored in the OSM nsr
360 class UpdateNsStateInput
:
362 Input dataclass for updating NS state in the DB
367 The UUID of the NS as stored in the OSM ns
370 operational_state : NsState
371 A representation of the operational state (ENABLED or ERROR)
375 Human readable message providing additional details to the
376 operational state, such as the error message associated
377 with the ERROR operational_state.
388 Contains the information related to a model.
393 The UUID of the VIM as stored in the OSM vim_accounts
397 Name of the Juju model used to deploy charms.
405 class CheckCharmStatusInput
:
407 Input dataclass for checking on a specific charm's deployment
413 The UUID of the VIM as stored in the OSM vim_accounts
417 Name of the model to create in Juju.
419 application_name : str
420 Name of the application that the state is going to be
423 poll_interval : int (optional)
424 Time, in seconds, to wait between status checks.
429 application_name
: str
430 poll_interval
: int = 1
434 class ChangeVnfStateInput
:
436 Input dataclass for changing VNF State.
441 The UUID of the VNF which is stored in the OSM vnfrs
445 A representation of the VNF state (STOPPED or STARTED).
453 class ChangeVnfInstantiationStateInput
:
455 Input dataclass for changing VNF Instantiation State.
460 The UUID of the VNF which is stored in the OSM vnfrs
463 state : VnfInstantiationState
464 A representation of the VNF instantiation state (NOT_INSTANTIATED or INSTANTIATED).
469 state
: VnfInstantiationState
473 class GetTaskQueueInput
:
475 Input dataclass for get task queue activity.
480 The UUID of the VNF which is stored in the OSM vnfrs
489 class GetTaskQueueOutput
:
491 Output dataclass for get task queue activity.
496 Name of the queue which is used to Deploy VNF.
503 class GetVnfDetailsInput
:
505 Input dataclass for get vnf details activity.
510 The UUID of the VNF which is stored in the OSM vnfrs
518 class GetVnfDetailsOutput
:
520 Output dataclass for get vnf details activity.
525 VNF record retrieved from Database.
528 VNF descriptor retrieved from Database.
536 class GetVnfRecordIdsInput
:
541 The UUID of the NS from which to retrieve the VNF records.
548 class GetVnfRecordIdsOutput
:
553 List of the VNF record IDs associated with the NS.