3b8a8570792a1f3726f1ffdbc917213d52bc22cd
[osm/common.git] / osm_common / 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
20 # Workflow Dataclasses
21
22
23 @dataclass
24 class VimOperationInput:
25 """
26 Input dataclass for workflows that perform operations
27 (create, update, delete) on VIMs.
28
29 Attributes:
30 -----------
31 vim_uuid : str
32 The UUID of the VIM account as stored in the OSM vim
33 collection in Mongo
34
35 op_id: str
36 The operation (task) id for this workflow. This is used
37 by the workflow at the end to update the status of the
38 operation in Mongo vim collection.
39 """
40
41 vim_uuid: str
42 op_id: str
43
44
45 # Activity Dataclasses
46
47
48 @dataclass
49 class TestVimConnectivityInput:
50 """
51 Input dataclass for the Test Vim Connectivity Ativity
52
53 Attributes:
54 -----------
55 vim_uuid : str
56 The UUID of the VIM account as stored in the OSM vim
57 collection in Mongo
58 """
59
60 vim_uuid: str
61
62
63 @dataclass
64 class UpdateVimStateInput:
65 """
66 Input dataclass for updating VIM state in the DB
67
68 Attributes:
69 -----------
70 vim_uuid : str
71 The UUID of the VIM account as stored in the OSM vim
72 collection in Mongo
73
74 operational_state : str
75 A representation of the operational state (ENABLED or ERROR)
76 of the VIM.
77
78 message : str
79 Human readable message providing additional details to the
80 operational state, such as the error message associated
81 with the ERROR operational_state.
82 """
83
84 vim_uuid: str
85 operational_state: str
86 message: str
87
88
89 @dataclass
90 class UpdateVimOperationStateInput:
91 """
92 Input dataclass for updating VIM Operations in the Mongo VIM
93 collection.
94
95 Attributes:
96 -----------
97 vim_uuid : str
98 The UUID of the VIM account as stored in the OSM vim
99 collection in Mongo
100
101 op_id: str
102 The operation (task) id for this workflow. This is used
103 to update the status of the operation in Mongo vim collection.
104
105 op_state : str
106 A representation of the state of the specified operation id,
107 such as COMPLETED, or FAILED.
108
109 message : str
110 Human readable message providing additional details to the
111 operation state, such as the error message explaining why
112 the operation failed.
113 """
114
115 vim_uuid: str
116 op_id: str
117 op_state: str
118 message: str
119
120
121 @dataclass
122 class DeleteVimInput:
123 """
124 Input dataclass for deleting vim record from the database
125
126 Attributes:
127 -----------
128 vim_uuid : str
129 The UUID of the VIM account as stored in the OSM vim
130 collection in Mongo
131
132 """
133
134 vim_uuid: str