File tree Expand file tree Collapse file tree 8 files changed +128
-0
lines changed
scaleway-async/scaleway_async/instance/v1
scaleway/scaleway/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 2020from .types import SecurityGroupState
2121from .content import SECURITY_GROUP_TRANSIENT_STATUSES
2222from .types import ServerAction
23+ from .types import ServerFilesystemState
24+ from .content import SERVER_FILESYSTEM_TRANSIENT_STATUSES
2325from .types import ServerIpIpFamily
2426from .types import ServerIpProvisioningMode
2527from .types import ServerIpState
4850from .types import PlacementGroup
4951from .types import PrivateNIC
5052from .types import SecurityGroupSummary
53+ from .types import ServerFilesystem
5154from .types import ServerIp
5255from .types import ServerIpv6
5356from .types import ServerLocation
223226 "SecurityGroupState" ,
224227 "SECURITY_GROUP_TRANSIENT_STATUSES" ,
225228 "ServerAction" ,
229+ "ServerFilesystemState" ,
230+ "SERVER_FILESYSTEM_TRANSIENT_STATUSES" ,
226231 "ServerIpIpFamily" ,
227232 "ServerIpProvisioningMode" ,
228233 "ServerIpState" ,
251256 "PlacementGroup" ,
252257 "PrivateNIC" ,
253258 "SecurityGroupSummary" ,
259+ "ServerFilesystem" ,
254260 "ServerIp" ,
255261 "ServerIpv6" ,
256262 "ServerLocation" ,
Original file line number Diff line number Diff line change 77 IpState ,
88 PrivateNICState ,
99 SecurityGroupState ,
10+ ServerFilesystemState ,
1011 ServerIpState ,
1112 ServerState ,
1213 SnapshotState ,
3940"""
4041Lists transient statutes of the enum :class:`SecurityGroupState <SecurityGroupState>`.
4142"""
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+ """
4250SERVER_IP_TRANSIENT_STATUSES : List [ServerIpState ] = [
4351 ServerIpState .PENDING ,
4452]
Original file line number Diff line number Diff line change 3131 Image ,
3232 PlacementGroup ,
3333 SecurityGroupSummary ,
34+ ServerFilesystem ,
3435 ServerIp ,
3536 ServerIpv6 ,
3637 ServerLocation ,
@@ -519,6 +520,25 @@ def unmarshal_SecurityGroupSummary(data: Any) -> SecurityGroupSummary:
519520 return SecurityGroupSummary (** args )
520521
521522
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+
522542def unmarshal_ServerIp (data : Any ) -> ServerIp :
523543 if not isinstance (data , dict ):
524544 raise TypeError (
@@ -902,6 +922,14 @@ def unmarshal_Server(data: Any) -> Server:
902922 if field is not None :
903923 args ["zone" ] = field
904924
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+
905933 field = data .get ("end_of_service" , None )
906934 if field is not None :
907935 args ["end_of_service" ] = field
Original file line number Diff line number Diff line change @@ -168,6 +168,16 @@ def __str__(self) -> str:
168168 return str (self .value )
169169
170170
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+
171181class ServerIpIpFamily (str , Enum , metaclass = StrEnumMeta ):
172182 INET = "inet"
173183 INET6 = "inet6"
@@ -565,6 +575,13 @@ class SecurityGroupSummary:
565575 name : str
566576
567577
578+ @dataclass
579+ class ServerFilesystem :
580+ filesystem_id : str
581+
582+ state : ServerFilesystemState
583+
584+
568585@dataclass
569586class ServerIp :
570587 id : str
@@ -887,6 +904,11 @@ class Server:
887904 Zone in which the Instance is located.
888905 """
889906
907+ filesystems : List [ServerFilesystem ]
908+ """
909+ List of attached filesystems.
910+ """
911+
890912 end_of_service : bool
891913 """
892914 True if the Instance type has reached end of service.
Original file line number Diff line number Diff line change 2020from .types import SecurityGroupState
2121from .content import SECURITY_GROUP_TRANSIENT_STATUSES
2222from .types import ServerAction
23+ from .types import ServerFilesystemState
24+ from .content import SERVER_FILESYSTEM_TRANSIENT_STATUSES
2325from .types import ServerIpIpFamily
2426from .types import ServerIpProvisioningMode
2527from .types import ServerIpState
4850from .types import PlacementGroup
4951from .types import PrivateNIC
5052from .types import SecurityGroupSummary
53+ from .types import ServerFilesystem
5154from .types import ServerIp
5255from .types import ServerIpv6
5356from .types import ServerLocation
223226 "SecurityGroupState" ,
224227 "SECURITY_GROUP_TRANSIENT_STATUSES" ,
225228 "ServerAction" ,
229+ "ServerFilesystemState" ,
230+ "SERVER_FILESYSTEM_TRANSIENT_STATUSES" ,
226231 "ServerIpIpFamily" ,
227232 "ServerIpProvisioningMode" ,
228233 "ServerIpState" ,
251256 "PlacementGroup" ,
252257 "PrivateNIC" ,
253258 "SecurityGroupSummary" ,
259+ "ServerFilesystem" ,
254260 "ServerIp" ,
255261 "ServerIpv6" ,
256262 "ServerLocation" ,
Original file line number Diff line number Diff line change 77 IpState ,
88 PrivateNICState ,
99 SecurityGroupState ,
10+ ServerFilesystemState ,
1011 ServerIpState ,
1112 ServerState ,
1213 SnapshotState ,
3940"""
4041Lists transient statutes of the enum :class:`SecurityGroupState <SecurityGroupState>`.
4142"""
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+ """
4250SERVER_IP_TRANSIENT_STATUSES : List [ServerIpState ] = [
4351 ServerIpState .PENDING ,
4452]
Original file line number Diff line number Diff line change 3131 Image ,
3232 PlacementGroup ,
3333 SecurityGroupSummary ,
34+ ServerFilesystem ,
3435 ServerIp ,
3536 ServerIpv6 ,
3637 ServerLocation ,
@@ -519,6 +520,25 @@ def unmarshal_SecurityGroupSummary(data: Any) -> SecurityGroupSummary:
519520 return SecurityGroupSummary (** args )
520521
521522
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+
522542def unmarshal_ServerIp (data : Any ) -> ServerIp :
523543 if not isinstance (data , dict ):
524544 raise TypeError (
@@ -902,6 +922,14 @@ def unmarshal_Server(data: Any) -> Server:
902922 if field is not None :
903923 args ["zone" ] = field
904924
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+
905933 field = data .get ("end_of_service" , None )
906934 if field is not None :
907935 args ["end_of_service" ] = field
Original file line number Diff line number Diff line change @@ -168,6 +168,16 @@ def __str__(self) -> str:
168168 return str (self .value )
169169
170170
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+
171181class ServerIpIpFamily (str , Enum , metaclass = StrEnumMeta ):
172182 INET = "inet"
173183 INET6 = "inet6"
@@ -565,6 +575,13 @@ class SecurityGroupSummary:
565575 name : str
566576
567577
578+ @dataclass
579+ class ServerFilesystem :
580+ filesystem_id : str
581+
582+ state : ServerFilesystemState
583+
584+
568585@dataclass
569586class ServerIp :
570587 id : str
@@ -887,6 +904,11 @@ class Server:
887904 Zone in which the Instance is located.
888905 """
889906
907+ filesystems : List [ServerFilesystem ]
908+ """
909+ List of attached filesystems.
910+ """
911+
890912 end_of_service : bool
891913 """
892914 True if the Instance type has reached end of service.
You can’t perform that action at this time.
0 commit comments