File tree Expand file tree Collapse file tree 8 files changed +64
-0
lines changed
scaleway-async/scaleway_async/instance/v1
scaleway/scaleway/instance/v1 Expand file tree Collapse file tree 8 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 1717from .types import ServerAction
1818from .types import ServerIpIpFamily
1919from .types import ServerIpProvisioningMode
20+ from .types import ServerIpState
2021from .types import ServerState
2122from .types import ServerTypesAvailability
2223from .types import SnapshotState
114115from .content import IP_TRANSIENT_STATUSES
115116from .content import PRIVATE_NIC_TRANSIENT_STATUSES
116117from .content import SECURITY_GROUP_TRANSIENT_STATUSES
118+ from .content import SERVER_IP_TRANSIENT_STATUSES
117119from .content import SERVER_TRANSIENT_STATUSES
118120from .content import SNAPSHOT_TRANSIENT_STATUSES
119121from .content import TASK_TRANSIENT_STATUSES
139141 "ServerAction" ,
140142 "ServerIpIpFamily" ,
141143 "ServerIpProvisioningMode" ,
144+ "ServerIpState" ,
142145 "ServerState" ,
143146 "ServerTypesAvailability" ,
144147 "SnapshotState" ,
236239 "IP_TRANSIENT_STATUSES" ,
237240 "PRIVATE_NIC_TRANSIENT_STATUSES" ,
238241 "SECURITY_GROUP_TRANSIENT_STATUSES" ,
242+ "SERVER_IP_TRANSIENT_STATUSES" ,
239243 "SERVER_TRANSIENT_STATUSES" ,
240244 "SNAPSHOT_TRANSIENT_STATUSES" ,
241245 "TASK_TRANSIENT_STATUSES" ,
Original file line number Diff line number Diff line change 77 IpState ,
88 PrivateNICState ,
99 SecurityGroupState ,
10+ ServerIpState ,
1011 ServerState ,
1112 SnapshotState ,
1213 TaskStatus ,
4344Lists transient statutes of the enum :class:`SecurityGroupState <SecurityGroupState>`.
4445"""
4546
47+ SERVER_IP_TRANSIENT_STATUSES : List [ServerIpState ] = [
48+ ServerIpState .PENDING ,
49+ ]
50+ """
51+ Lists transient statutes of the enum :class:`ServerIpState <ServerIpState>`.
52+ """
53+
4654SERVER_TRANSIENT_STATUSES : List [ServerState ] = [
4755 ServerState .STARTING ,
4856 ServerState .STOPPING ,
Original file line number Diff line number Diff line change 2424 ServerAction ,
2525 ServerIpIpFamily ,
2626 ServerIpProvisioningMode ,
27+ ServerIpState ,
2728 ServerState ,
2829 SnapshotState ,
2930 SnapshotVolumeType ,
@@ -498,6 +499,9 @@ def unmarshal_ServerIp(data: Any) -> ServerIp:
498499 field = data .get ("provisioning_mode" , None )
499500 args ["provisioning_mode" ] = field
500501
502+ field = data .get ("state" , None )
503+ args ["state" ] = field
504+
501505 field = data .get ("tags" , None )
502506 args ["tags" ] = field
503507
@@ -2428,6 +2432,9 @@ def marshal_ServerIp(
24282432 request .provisioning_mode
24292433 )
24302434
2435+ if request .state is not None :
2436+ output ["state" ] = ServerIpState (request .state )
2437+
24312438 if request .tags is not None :
24322439 output ["tags" ] = request .tags
24332440
Original file line number Diff line number Diff line change @@ -171,6 +171,17 @@ def __str__(self) -> str:
171171 return str (self .value )
172172
173173
174+ class ServerIpState (str , Enum , metaclass = StrEnumMeta ):
175+ UNKNOWN_STATE = "unknown_state"
176+ DETACHED = "detached"
177+ ATTACHED = "attached"
178+ PENDING = "pending"
179+ ERROR = "error"
180+
181+ def __str__ (self ) -> str :
182+ return str (self .value )
183+
184+
174185class ServerState (str , Enum , metaclass = StrEnumMeta ):
175186 RUNNING = "running"
176187 STOPPED = "stopped"
@@ -1272,6 +1283,8 @@ class ServerIp:
12721283 Tags associated with the IP.
12731284 """
12741285
1286+ state : ServerIpState
1287+
12751288
12761289@dataclass
12771290class ServerIpv6 :
Original file line number Diff line number Diff line change 1717from .types import ServerAction
1818from .types import ServerIpIpFamily
1919from .types import ServerIpProvisioningMode
20+ from .types import ServerIpState
2021from .types import ServerState
2122from .types import ServerTypesAvailability
2223from .types import SnapshotState
114115from .content import IP_TRANSIENT_STATUSES
115116from .content import PRIVATE_NIC_TRANSIENT_STATUSES
116117from .content import SECURITY_GROUP_TRANSIENT_STATUSES
118+ from .content import SERVER_IP_TRANSIENT_STATUSES
117119from .content import SERVER_TRANSIENT_STATUSES
118120from .content import SNAPSHOT_TRANSIENT_STATUSES
119121from .content import TASK_TRANSIENT_STATUSES
139141 "ServerAction" ,
140142 "ServerIpIpFamily" ,
141143 "ServerIpProvisioningMode" ,
144+ "ServerIpState" ,
142145 "ServerState" ,
143146 "ServerTypesAvailability" ,
144147 "SnapshotState" ,
236239 "IP_TRANSIENT_STATUSES" ,
237240 "PRIVATE_NIC_TRANSIENT_STATUSES" ,
238241 "SECURITY_GROUP_TRANSIENT_STATUSES" ,
242+ "SERVER_IP_TRANSIENT_STATUSES" ,
239243 "SERVER_TRANSIENT_STATUSES" ,
240244 "SNAPSHOT_TRANSIENT_STATUSES" ,
241245 "TASK_TRANSIENT_STATUSES" ,
Original file line number Diff line number Diff line change 77 IpState ,
88 PrivateNICState ,
99 SecurityGroupState ,
10+ ServerIpState ,
1011 ServerState ,
1112 SnapshotState ,
1213 TaskStatus ,
4344Lists transient statutes of the enum :class:`SecurityGroupState <SecurityGroupState>`.
4445"""
4546
47+ SERVER_IP_TRANSIENT_STATUSES : List [ServerIpState ] = [
48+ ServerIpState .PENDING ,
49+ ]
50+ """
51+ Lists transient statutes of the enum :class:`ServerIpState <ServerIpState>`.
52+ """
53+
4654SERVER_TRANSIENT_STATUSES : List [ServerState ] = [
4755 ServerState .STARTING ,
4856 ServerState .STOPPING ,
Original file line number Diff line number Diff line change 2424 ServerAction ,
2525 ServerIpIpFamily ,
2626 ServerIpProvisioningMode ,
27+ ServerIpState ,
2728 ServerState ,
2829 SnapshotState ,
2930 SnapshotVolumeType ,
@@ -498,6 +499,9 @@ def unmarshal_ServerIp(data: Any) -> ServerIp:
498499 field = data .get ("provisioning_mode" , None )
499500 args ["provisioning_mode" ] = field
500501
502+ field = data .get ("state" , None )
503+ args ["state" ] = field
504+
501505 field = data .get ("tags" , None )
502506 args ["tags" ] = field
503507
@@ -2428,6 +2432,9 @@ def marshal_ServerIp(
24282432 request .provisioning_mode
24292433 )
24302434
2435+ if request .state is not None :
2436+ output ["state" ] = ServerIpState (request .state )
2437+
24312438 if request .tags is not None :
24322439 output ["tags" ] = request .tags
24332440
Original file line number Diff line number Diff line change @@ -171,6 +171,17 @@ def __str__(self) -> str:
171171 return str (self .value )
172172
173173
174+ class ServerIpState (str , Enum , metaclass = StrEnumMeta ):
175+ UNKNOWN_STATE = "unknown_state"
176+ DETACHED = "detached"
177+ ATTACHED = "attached"
178+ PENDING = "pending"
179+ ERROR = "error"
180+
181+ def __str__ (self ) -> str :
182+ return str (self .value )
183+
184+
174185class ServerState (str , Enum , metaclass = StrEnumMeta ):
175186 RUNNING = "running"
176187 STOPPED = "stopped"
@@ -1272,6 +1283,8 @@ class ServerIp:
12721283 Tags associated with the IP.
12731284 """
12741285
1286+ state : ServerIpState
1287+
12751288
12761289@dataclass
12771290class ServerIpv6 :
You can’t perform that action at this time.
0 commit comments