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)
172 class VduInstantiateInput
:
174 Input dataclass for workflow that instantiates a VDU.
180 charm_info : CharmInfo
182 constraints: VduComputeConstraints
184 cloud: VIM cloud type
186 config: Config details of application
191 charm_info
: CharmInfo
192 constraints
: VduComputeConstraints
198 class VnfInstantiateInput
:
200 Input dataclass for workflow that instantiates a VNF.
205 The UUID of the VNF which is stored in the OSM vnfrs
210 instantiation_config: dict
211 The instantiation configuration of the VNF
217 instantiation_config
: dict
221 class SetVnfModelInput
:
223 Input dataclass for activity that sets the VNF Model.
228 The UUID of the VNF which is stored in the OSM vnfrs
240 class VnfPrepareInput
:
242 Input dataclass for workflow that prepare a VNF.
247 The UUID of the VNF which is stored in the OSM vnfrs
259 class GetNsRecordInput
:
261 Input dataclass for getting NS record activity.
266 The UUID of the NS record which is stored in the OSM nsrs
275 class GetNsRecordOutput
:
277 Output dataclass for getting NS record activity.
282 NS record retrieved from Database..
289 #######################################################################################
290 # Activity Dataclasses
294 class UpdateLcmOperationStateInput
:
296 Input dataclass for updating LCM Operations in the Mongo nslcmops
297 collection. The following attributes will be updated automatically
304 The operation (task) id for this activity. This is the key
305 to the record in nslcmops collection that will be updated.
307 op_state : LcmOperationState
308 A representation of the state of the specified operation id,
309 such as PROCESSING, COMPLETED, or FAILED.
312 Human readable checkpoint message, intended only to give the
316 Human readable error message if any failure occurred.
318 detailed_status : str
319 Human readable message providing additional details to the
320 operation state, such as the error message explaining why
321 the operation failed.
325 op_state
: LcmOperationState
332 class TestVimConnectivityInput
:
334 Input dataclass for the Test Vim Connectivity Ativity
339 The UUID of the VIM account as stored in the OSM vim
347 class UpdateVimStateInput
:
349 Input dataclass for updating VIM state in the DB
354 The UUID of the VIM account as stored in the OSM vim
357 operational_state : VimState
358 A representation of the operational state (ENABLED or ERROR)
362 Human readable message providing additional details to the
363 operational state, such as the error message associated
364 with the ERROR operational_state.
368 operational_state
: VimState
373 class UpdateVimOperationStateInput
:
375 Input dataclass for updating VIM Operations in the Mongo VIM
381 The UUID of the VIM account as stored in the OSM vim
385 The operation (task) id for this workflow. This is used
386 to update the status of the operation in Mongo vim collection.
388 op_state : VimOperationState
389 A representation of the state of the specified operation id,
390 such as COMPLETED, or FAILED.
393 Human readable message providing additional details to the
394 operation state, such as the error message explaining why
395 the operation failed.
400 op_state
: VimOperationState
405 class DeleteVimInput
:
407 Input dataclass for deleting vim record from the database
412 The UUID of the VIM account as stored in the OSM vim
428 The UUID of the NS as stored in the OSM nsr
436 class UpdateNsStateInput
:
438 Input dataclass for updating NS state in the DB
443 The UUID of the NS as stored in the OSM ns
446 operational_state : NsState
447 A representation of the operational state (ENABLED or ERROR)
451 Human readable message providing additional details to the
452 operational state, such as the error message associated
453 with the ERROR operational_state.
464 Contains the information related to a model.
469 The UUID of the VIM as stored in the OSM vim_accounts
473 Name of the Juju model used to deploy charms.
481 class CheckCharmStatusInput
:
483 Input dataclass for checking on a specific charm's deployment
489 The UUID of the VIM as stored in the OSM vim_accounts
493 Name of the model to create in Juju.
495 application_name : str
496 Name of the application that the state is going to be
499 poll_interval : int (optional)
500 Time, in seconds, to wait between status checks.
505 application_name
: str
506 poll_interval
: int = 1
510 class ChangeVnfStateInput
:
512 Input dataclass for changing VNF State.
517 The UUID of the VNF which is stored in the OSM vnfrs
521 A representation of the VNF state (STOPPED or STARTED).
529 class ChangeVnfInstantiationStateInput
:
531 Input dataclass for changing VNF Instantiation State.
536 The UUID of the VNF which is stored in the OSM vnfrs
539 state : VnfInstantiationState
540 A representation of the VNF instantiation state (NOT_INSTANTIATED or INSTANTIATED).
545 state
: VnfInstantiationState
549 class GetTaskQueueInput
:
551 Input dataclass for get task queue activity.
556 The UUID of the VNF which is stored in the OSM vnfrs
565 class GetTaskQueueOutput
:
567 Output dataclass for get task queue activity.
572 Name of the queue which is used to Deploy VNF.
579 class GetVnfRecordInput
:
581 Input dataclass for get vnf details activity.
586 The UUID of the VNF which is stored in the OSM vnfrs
594 class GetVnfRecordOutput
:
596 Output dataclass for get vnf details activity.
601 VNF record retrieved from Database.
609 class GetVnfDescriptorInput
:
611 Input dataclass for get vnf details activity.
616 The UUID of the VNF descriptor which is stored in the OSM vnfds
624 class GetVnfDescriptorOutput
:
626 Output dataclass for get vnf details activity.
631 VNF descriptor retrieved from Database.
638 class GetVnfDetailsInput
:
643 The UUID of the NS from which to retrieve the VNF records.
650 class GetVnfDetailsOutput
:
654 vnf_details: list[(vnfr_ids: str, vnf_member_index_ref: str), .. ]
655 List of tuples including VNF details associated with the NS.
656 Tuple(VNF record IDs, vnf_member_index_ref)
659 vnf_details
: List
[tuple]