Update pip dependencies
[osm/common.git] / dataclasses / temporal_dataclasses.py
1 #######################################################################################
2 # Copyright ETSI Contributors and Others.
3 #
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
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
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
13 # implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #######################################################################################
17
18 from dataclasses import dataclass
19 from enum import auto, IntEnum
20
21 #######################################################################################
22 # Workflow Dataclasses
23
24
25 @dataclass
26 class VimOperationInput:
27 """
28 Input dataclass for workflows that perform operations
29 (create, update, delete) on VIMs.
30
31 Attributes:
32 -----------
33 vim_uuid : str
34 The UUID of the VIM account as stored in the OSM vim
35 collection in Mongo
36
37 op_id: str
38 The operation (task) id for this workflow. This is used
39 by the workflow at the end to update the status of the
40 operation in Mongo vim collection.
41 """
42
43 vim_uuid: str
44 op_id: str
45
46
47 #######################################################################################
48 # Activity Dataclasses
49
50
51 @dataclass
52 class TestVimConnectivityInput:
53 """
54 Input dataclass for the Test Vim Connectivity Ativity
55
56 Attributes:
57 -----------
58 vim_uuid : str
59 The UUID of the VIM account as stored in the OSM vim
60 collection in Mongo
61 """
62
63 vim_uuid: str
64
65
66 class VimState(IntEnum):
67 PROCESSING = auto()
68 ENABLED = auto()
69 ERROR = auto()
70
71
72 @dataclass
73 class UpdateVimStateInput:
74 """
75 Input dataclass for updating VIM state in the DB
76
77 Attributes:
78 -----------
79 vim_uuid : str
80 The UUID of the VIM account as stored in the OSM vim
81 collection in Mongo
82
83 operational_state : VimState
84 A representation of the operational state (ENABLED or ERROR)
85 of the VIM.
86
87 message : str
88 Human readable message providing additional details to the
89 operational state, such as the error message associated
90 with the ERROR operational_state.
91 """
92
93 vim_uuid: str
94 operational_state: VimState
95 message: str
96
97
98 class VimOperationState(IntEnum):
99 COMPLETED = auto()
100 FAILED = auto()
101
102
103 @dataclass
104 class UpdateVimOperationStateInput:
105 """
106 Input dataclass for updating VIM Operations in the Mongo VIM
107 collection.
108
109 Attributes:
110 -----------
111 vim_uuid : str
112 The UUID of the VIM account as stored in the OSM vim
113 collection in Mongo
114
115 op_id: str
116 The operation (task) id for this workflow. This is used
117 to update the status of the operation in Mongo vim collection.
118
119 op_state : VimOperationState
120 A representation of the state of the specified operation id,
121 such as COMPLETED, or FAILED.
122
123 message : str
124 Human readable message providing additional details to the
125 operation state, such as the error message explaining why
126 the operation failed.
127 """
128
129 vim_uuid: str
130 op_id: str
131 op_state: VimOperationState
132 message: str
133
134
135 @dataclass
136 class DeleteVimInput:
137 """
138 Input dataclass for deleting vim record from the database
139
140 Attributes:
141 -----------
142 vim_uuid : str
143 The UUID of the VIM account as stored in the OSM vim
144 collection in Mongo
145
146 """
147
148 vim_uuid: str