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
217 class GetNsRecordInput
:
219 Input dataclass for getting NS record activity.
224 The UUID of the NS record which is stored in the OSM nsrs
233 class GetNsRecordOutput
:
235 Output dataclass for getting NS record activity.
240 NS record retrieved from Database..
247 #######################################################################################
248 # Activity Dataclasses
252 class UpdateLcmOperationStateInput
:
254 Input dataclass for updating LCM Operations in the Mongo nslcmops
255 collection. The following attributes will be updated automatically
262 The operation (task) id for this activity. This is the key
263 to the record in nslcmops collection that will be updated.
265 op_state : LcmOperationState
266 A representation of the state of the specified operation id,
267 such as PROCESSING, COMPLETED, or FAILED.
270 Human readable checkpoint message, intended only to give the
274 Human readable error message if any failure occurred.
276 detailed_status : str
277 Human readable message providing additional details to the
278 operation state, such as the error message explaining why
279 the operation failed.
283 op_state
: LcmOperationState
290 class TestVimConnectivityInput
:
292 Input dataclass for the Test Vim Connectivity Ativity
297 The UUID of the VIM account as stored in the OSM vim
305 class UpdateVimStateInput
:
307 Input dataclass for updating VIM state in the DB
312 The UUID of the VIM account as stored in the OSM vim
315 operational_state : VimState
316 A representation of the operational state (ENABLED or ERROR)
320 Human readable message providing additional details to the
321 operational state, such as the error message associated
322 with the ERROR operational_state.
326 operational_state
: VimState
331 class UpdateVimOperationStateInput
:
333 Input dataclass for updating VIM Operations in the Mongo VIM
339 The UUID of the VIM account as stored in the OSM vim
343 The operation (task) id for this workflow. This is used
344 to update the status of the operation in Mongo vim collection.
346 op_state : VimOperationState
347 A representation of the state of the specified operation id,
348 such as COMPLETED, or FAILED.
351 Human readable message providing additional details to the
352 operation state, such as the error message explaining why
353 the operation failed.
358 op_state
: VimOperationState
363 class DeleteVimInput
:
365 Input dataclass for deleting vim record from the database
370 The UUID of the VIM account as stored in the OSM vim
386 The UUID of the NS as stored in the OSM nsr
394 class UpdateNsStateInput
:
396 Input dataclass for updating NS state in the DB
401 The UUID of the NS as stored in the OSM ns
404 operational_state : NsState
405 A representation of the operational state (ENABLED or ERROR)
409 Human readable message providing additional details to the
410 operational state, such as the error message associated
411 with the ERROR operational_state.
422 Contains the information related to a model.
427 The UUID of the VIM as stored in the OSM vim_accounts
431 Name of the Juju model used to deploy charms.
439 class CheckCharmStatusInput
:
441 Input dataclass for checking on a specific charm's deployment
447 The UUID of the VIM as stored in the OSM vim_accounts
451 Name of the model to create in Juju.
453 application_name : str
454 Name of the application that the state is going to be
457 poll_interval : int (optional)
458 Time, in seconds, to wait between status checks.
463 application_name
: str
464 poll_interval
: int = 1
468 class ChangeVnfStateInput
:
470 Input dataclass for changing VNF State.
475 The UUID of the VNF which is stored in the OSM vnfrs
479 A representation of the VNF state (STOPPED or STARTED).
487 class ChangeVnfInstantiationStateInput
:
489 Input dataclass for changing VNF Instantiation State.
494 The UUID of the VNF which is stored in the OSM vnfrs
497 state : VnfInstantiationState
498 A representation of the VNF instantiation state (NOT_INSTANTIATED or INSTANTIATED).
503 state
: VnfInstantiationState
507 class GetTaskQueueInput
:
509 Input dataclass for get task queue activity.
514 The UUID of the VNF which is stored in the OSM vnfrs
523 class GetTaskQueueOutput
:
525 Output dataclass for get task queue activity.
530 Name of the queue which is used to Deploy VNF.
537 class GetVnfDetailsInput
:
539 Input dataclass for get vnf details activity.
544 The UUID of the VNF which is stored in the OSM vnfrs
552 class GetVnfDetailsOutput
:
554 Output dataclass for get vnf details activity.
559 VNF record retrieved from Database.
562 VNF descriptor retrieved from Database.
570 class GetVnfRecordIdsInput
:
575 The UUID of the NS from which to retrieve the VNF records.
582 class GetVnfRecordIdsOutput
:
587 List of the VNF record IDs associated with the NS.