File tree Expand file tree Collapse file tree 8 files changed +128
-0
lines changed
scaleway/scaleway/instance/v1
scaleway-async/scaleway_async/instance/v1 Expand file tree Collapse file tree 8 files changed +128
-0
lines changed Original file line number Diff line number Diff line change 20
20
from .types import SecurityGroupState
21
21
from .content import SECURITY_GROUP_TRANSIENT_STATUSES
22
22
from .types import ServerAction
23
+ from .types import ServerFilesystemState
24
+ from .content import SERVER_FILESYSTEM_TRANSIENT_STATUSES
23
25
from .types import ServerIpIpFamily
24
26
from .types import ServerIpProvisioningMode
25
27
from .types import ServerIpState
48
50
from .types import PlacementGroup
49
51
from .types import PrivateNIC
50
52
from .types import SecurityGroupSummary
53
+ from .types import ServerFilesystem
51
54
from .types import ServerIp
52
55
from .types import ServerIpv6
53
56
from .types import ServerLocation
223
226
"SecurityGroupState" ,
224
227
"SECURITY_GROUP_TRANSIENT_STATUSES" ,
225
228
"ServerAction" ,
229
+ "ServerFilesystemState" ,
230
+ "SERVER_FILESYSTEM_TRANSIENT_STATUSES" ,
226
231
"ServerIpIpFamily" ,
227
232
"ServerIpProvisioningMode" ,
228
233
"ServerIpState" ,
251
256
"PlacementGroup" ,
252
257
"PrivateNIC" ,
253
258
"SecurityGroupSummary" ,
259
+ "ServerFilesystem" ,
254
260
"ServerIp" ,
255
261
"ServerIpv6" ,
256
262
"ServerLocation" ,
Original file line number Diff line number Diff line change 7
7
IpState ,
8
8
PrivateNICState ,
9
9
SecurityGroupState ,
10
+ ServerFilesystemState ,
10
11
ServerIpState ,
11
12
ServerState ,
12
13
SnapshotState ,
39
40
"""
40
41
Lists transient statutes of the enum :class:`SecurityGroupState <SecurityGroupState>`.
41
42
"""
43
+ SERVER_FILESYSTEM_TRANSIENT_STATUSES : List [ServerFilesystemState ] = [
44
+ ServerFilesystemState .ATTACHING ,
45
+ ServerFilesystemState .DETACHING ,
46
+ ]
47
+ """
48
+ Lists transient statutes of the enum :class:`ServerFilesystemState <ServerFilesystemState>`.
49
+ """
42
50
SERVER_IP_TRANSIENT_STATUSES : List [ServerIpState ] = [
43
51
ServerIpState .PENDING ,
44
52
]
Original file line number Diff line number Diff line change 31
31
Image ,
32
32
PlacementGroup ,
33
33
SecurityGroupSummary ,
34
+ ServerFilesystem ,
34
35
ServerIp ,
35
36
ServerIpv6 ,
36
37
ServerLocation ,
@@ -519,6 +520,25 @@ def unmarshal_SecurityGroupSummary(data: Any) -> SecurityGroupSummary:
519
520
return SecurityGroupSummary (** args )
520
521
521
522
523
+ def unmarshal_ServerFilesystem (data : Any ) -> ServerFilesystem :
524
+ if not isinstance (data , dict ):
525
+ raise TypeError (
526
+ "Unmarshalling the type 'ServerFilesystem' failed as data isn't a dictionary."
527
+ )
528
+
529
+ args : Dict [str , Any ] = {}
530
+
531
+ field = data .get ("filesystem_id" , None )
532
+ if field is not None :
533
+ args ["filesystem_id" ] = field
534
+
535
+ field = data .get ("state" , None )
536
+ if field is not None :
537
+ args ["state" ] = field
538
+
539
+ return ServerFilesystem (** args )
540
+
541
+
522
542
def unmarshal_ServerIp (data : Any ) -> ServerIp :
523
543
if not isinstance (data , dict ):
524
544
raise TypeError (
@@ -902,6 +922,14 @@ def unmarshal_Server(data: Any) -> Server:
902
922
if field is not None :
903
923
args ["zone" ] = field
904
924
925
+ field = data .get ("filesystems" , None )
926
+ if field is not None :
927
+ args ["filesystems" ] = (
928
+ [unmarshal_ServerFilesystem (v ) for v in field ]
929
+ if field is not None
930
+ else None
931
+ )
932
+
905
933
field = data .get ("end_of_service" , None )
906
934
if field is not None :
907
935
args ["end_of_service" ] = field
Original file line number Diff line number Diff line change @@ -168,6 +168,16 @@ def __str__(self) -> str:
168
168
return str (self .value )
169
169
170
170
171
+ class ServerFilesystemState (str , Enum , metaclass = StrEnumMeta ):
172
+ UNKNOWN_STATE = "unknown_state"
173
+ ATTACHING = "attaching"
174
+ AVAILABLE = "available"
175
+ DETACHING = "detaching"
176
+
177
+ def __str__ (self ) -> str :
178
+ return str (self .value )
179
+
180
+
171
181
class ServerIpIpFamily (str , Enum , metaclass = StrEnumMeta ):
172
182
INET = "inet"
173
183
INET6 = "inet6"
@@ -565,6 +575,13 @@ class SecurityGroupSummary:
565
575
name : str
566
576
567
577
578
+ @dataclass
579
+ class ServerFilesystem :
580
+ filesystem_id : str
581
+
582
+ state : ServerFilesystemState
583
+
584
+
568
585
@dataclass
569
586
class ServerIp :
570
587
id : str
@@ -887,6 +904,11 @@ class Server:
887
904
Zone in which the Instance is located.
888
905
"""
889
906
907
+ filesystems : List [ServerFilesystem ]
908
+ """
909
+ List of attached filesystems.
910
+ """
911
+
890
912
end_of_service : bool
891
913
"""
892
914
True if the Instance type has reached end of service.
Original file line number Diff line number Diff line change 20
20
from .types import SecurityGroupState
21
21
from .content import SECURITY_GROUP_TRANSIENT_STATUSES
22
22
from .types import ServerAction
23
+ from .types import ServerFilesystemState
24
+ from .content import SERVER_FILESYSTEM_TRANSIENT_STATUSES
23
25
from .types import ServerIpIpFamily
24
26
from .types import ServerIpProvisioningMode
25
27
from .types import ServerIpState
48
50
from .types import PlacementGroup
49
51
from .types import PrivateNIC
50
52
from .types import SecurityGroupSummary
53
+ from .types import ServerFilesystem
51
54
from .types import ServerIp
52
55
from .types import ServerIpv6
53
56
from .types import ServerLocation
223
226
"SecurityGroupState" ,
224
227
"SECURITY_GROUP_TRANSIENT_STATUSES" ,
225
228
"ServerAction" ,
229
+ "ServerFilesystemState" ,
230
+ "SERVER_FILESYSTEM_TRANSIENT_STATUSES" ,
226
231
"ServerIpIpFamily" ,
227
232
"ServerIpProvisioningMode" ,
228
233
"ServerIpState" ,
251
256
"PlacementGroup" ,
252
257
"PrivateNIC" ,
253
258
"SecurityGroupSummary" ,
259
+ "ServerFilesystem" ,
254
260
"ServerIp" ,
255
261
"ServerIpv6" ,
256
262
"ServerLocation" ,
Original file line number Diff line number Diff line change 7
7
IpState ,
8
8
PrivateNICState ,
9
9
SecurityGroupState ,
10
+ ServerFilesystemState ,
10
11
ServerIpState ,
11
12
ServerState ,
12
13
SnapshotState ,
39
40
"""
40
41
Lists transient statutes of the enum :class:`SecurityGroupState <SecurityGroupState>`.
41
42
"""
43
+ SERVER_FILESYSTEM_TRANSIENT_STATUSES : List [ServerFilesystemState ] = [
44
+ ServerFilesystemState .ATTACHING ,
45
+ ServerFilesystemState .DETACHING ,
46
+ ]
47
+ """
48
+ Lists transient statutes of the enum :class:`ServerFilesystemState <ServerFilesystemState>`.
49
+ """
42
50
SERVER_IP_TRANSIENT_STATUSES : List [ServerIpState ] = [
43
51
ServerIpState .PENDING ,
44
52
]
Original file line number Diff line number Diff line change 31
31
Image ,
32
32
PlacementGroup ,
33
33
SecurityGroupSummary ,
34
+ ServerFilesystem ,
34
35
ServerIp ,
35
36
ServerIpv6 ,
36
37
ServerLocation ,
@@ -519,6 +520,25 @@ def unmarshal_SecurityGroupSummary(data: Any) -> SecurityGroupSummary:
519
520
return SecurityGroupSummary (** args )
520
521
521
522
523
+ def unmarshal_ServerFilesystem (data : Any ) -> ServerFilesystem :
524
+ if not isinstance (data , dict ):
525
+ raise TypeError (
526
+ "Unmarshalling the type 'ServerFilesystem' failed as data isn't a dictionary."
527
+ )
528
+
529
+ args : Dict [str , Any ] = {}
530
+
531
+ field = data .get ("filesystem_id" , None )
532
+ if field is not None :
533
+ args ["filesystem_id" ] = field
534
+
535
+ field = data .get ("state" , None )
536
+ if field is not None :
537
+ args ["state" ] = field
538
+
539
+ return ServerFilesystem (** args )
540
+
541
+
522
542
def unmarshal_ServerIp (data : Any ) -> ServerIp :
523
543
if not isinstance (data , dict ):
524
544
raise TypeError (
@@ -902,6 +922,14 @@ def unmarshal_Server(data: Any) -> Server:
902
922
if field is not None :
903
923
args ["zone" ] = field
904
924
925
+ field = data .get ("filesystems" , None )
926
+ if field is not None :
927
+ args ["filesystems" ] = (
928
+ [unmarshal_ServerFilesystem (v ) for v in field ]
929
+ if field is not None
930
+ else None
931
+ )
932
+
905
933
field = data .get ("end_of_service" , None )
906
934
if field is not None :
907
935
args ["end_of_service" ] = field
Original file line number Diff line number Diff line change @@ -168,6 +168,16 @@ def __str__(self) -> str:
168
168
return str (self .value )
169
169
170
170
171
+ class ServerFilesystemState (str , Enum , metaclass = StrEnumMeta ):
172
+ UNKNOWN_STATE = "unknown_state"
173
+ ATTACHING = "attaching"
174
+ AVAILABLE = "available"
175
+ DETACHING = "detaching"
176
+
177
+ def __str__ (self ) -> str :
178
+ return str (self .value )
179
+
180
+
171
181
class ServerIpIpFamily (str , Enum , metaclass = StrEnumMeta ):
172
182
INET = "inet"
173
183
INET6 = "inet6"
@@ -565,6 +575,13 @@ class SecurityGroupSummary:
565
575
name : str
566
576
567
577
578
+ @dataclass
579
+ class ServerFilesystem :
580
+ filesystem_id : str
581
+
582
+ state : ServerFilesystemState
583
+
584
+
568
585
@dataclass
569
586
class ServerIp :
570
587
id : str
@@ -887,6 +904,11 @@ class Server:
887
904
Zone in which the Instance is located.
888
905
"""
889
906
907
+ filesystems : List [ServerFilesystem ]
908
+ """
909
+ List of attached filesystems.
910
+ """
911
+
890
912
end_of_service : bool
891
913
"""
892
914
True if the Instance type has reached end of service.
You can’t perform that action at this time.
0 commit comments