Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions scaleway-async/scaleway_async/instance/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from .types import ServerAction
from .types import ServerIpIpFamily
from .types import ServerIpProvisioningMode
from .types import ServerIpState
from .types import ServerState
from .types import ServerTypesAvailability
from .types import SnapshotState
Expand Down Expand Up @@ -114,6 +115,7 @@
from .content import IP_TRANSIENT_STATUSES
from .content import PRIVATE_NIC_TRANSIENT_STATUSES
from .content import SECURITY_GROUP_TRANSIENT_STATUSES
from .content import SERVER_IP_TRANSIENT_STATUSES
from .content import SERVER_TRANSIENT_STATUSES
from .content import SNAPSHOT_TRANSIENT_STATUSES
from .content import TASK_TRANSIENT_STATUSES
Expand All @@ -139,6 +141,7 @@
"ServerAction",
"ServerIpIpFamily",
"ServerIpProvisioningMode",
"ServerIpState",
"ServerState",
"ServerTypesAvailability",
"SnapshotState",
Expand Down Expand Up @@ -236,6 +239,7 @@
"IP_TRANSIENT_STATUSES",
"PRIVATE_NIC_TRANSIENT_STATUSES",
"SECURITY_GROUP_TRANSIENT_STATUSES",
"SERVER_IP_TRANSIENT_STATUSES",
"SERVER_TRANSIENT_STATUSES",
"SNAPSHOT_TRANSIENT_STATUSES",
"TASK_TRANSIENT_STATUSES",
Expand Down
8 changes: 8 additions & 0 deletions scaleway-async/scaleway_async/instance/v1/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
IpState,
PrivateNICState,
SecurityGroupState,
ServerIpState,
ServerState,
SnapshotState,
TaskStatus,
Expand Down Expand Up @@ -43,6 +44,13 @@
Lists transient statutes of the enum :class:`SecurityGroupState <SecurityGroupState>`.
"""

SERVER_IP_TRANSIENT_STATUSES: List[ServerIpState] = [
ServerIpState.PENDING,
]
"""
Lists transient statutes of the enum :class:`ServerIpState <ServerIpState>`.
"""

SERVER_TRANSIENT_STATUSES: List[ServerState] = [
ServerState.STARTING,
ServerState.STOPPING,
Expand Down
7 changes: 7 additions & 0 deletions scaleway-async/scaleway_async/instance/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
ServerAction,
ServerIpIpFamily,
ServerIpProvisioningMode,
ServerIpState,
ServerState,
SnapshotState,
SnapshotVolumeType,
Expand Down Expand Up @@ -498,6 +499,9 @@ def unmarshal_ServerIp(data: Any) -> ServerIp:
field = data.get("provisioning_mode", None)
args["provisioning_mode"] = field

field = data.get("state", None)
args["state"] = field

field = data.get("tags", None)
args["tags"] = field

Expand Down Expand Up @@ -2428,6 +2432,9 @@ def marshal_ServerIp(
request.provisioning_mode
)

if request.state is not None:
output["state"] = ServerIpState(request.state)

if request.tags is not None:
output["tags"] = request.tags

Expand Down
13 changes: 13 additions & 0 deletions scaleway-async/scaleway_async/instance/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,17 @@ def __str__(self) -> str:
return str(self.value)


class ServerIpState(str, Enum, metaclass=StrEnumMeta):
UNKNOWN_STATE = "unknown_state"
DETACHED = "detached"
ATTACHED = "attached"
PENDING = "pending"
ERROR = "error"

def __str__(self) -> str:
return str(self.value)


class ServerState(str, Enum, metaclass=StrEnumMeta):
RUNNING = "running"
STOPPED = "stopped"
Expand Down Expand Up @@ -1272,6 +1283,8 @@ class ServerIp:
Tags associated with the IP.
"""

state: ServerIpState


@dataclass
class ServerIpv6:
Expand Down
4 changes: 4 additions & 0 deletions scaleway/scaleway/instance/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from .types import ServerAction
from .types import ServerIpIpFamily
from .types import ServerIpProvisioningMode
from .types import ServerIpState
from .types import ServerState
from .types import ServerTypesAvailability
from .types import SnapshotState
Expand Down Expand Up @@ -114,6 +115,7 @@
from .content import IP_TRANSIENT_STATUSES
from .content import PRIVATE_NIC_TRANSIENT_STATUSES
from .content import SECURITY_GROUP_TRANSIENT_STATUSES
from .content import SERVER_IP_TRANSIENT_STATUSES
from .content import SERVER_TRANSIENT_STATUSES
from .content import SNAPSHOT_TRANSIENT_STATUSES
from .content import TASK_TRANSIENT_STATUSES
Expand All @@ -139,6 +141,7 @@
"ServerAction",
"ServerIpIpFamily",
"ServerIpProvisioningMode",
"ServerIpState",
"ServerState",
"ServerTypesAvailability",
"SnapshotState",
Expand Down Expand Up @@ -236,6 +239,7 @@
"IP_TRANSIENT_STATUSES",
"PRIVATE_NIC_TRANSIENT_STATUSES",
"SECURITY_GROUP_TRANSIENT_STATUSES",
"SERVER_IP_TRANSIENT_STATUSES",
"SERVER_TRANSIENT_STATUSES",
"SNAPSHOT_TRANSIENT_STATUSES",
"TASK_TRANSIENT_STATUSES",
Expand Down
8 changes: 8 additions & 0 deletions scaleway/scaleway/instance/v1/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
IpState,
PrivateNICState,
SecurityGroupState,
ServerIpState,
ServerState,
SnapshotState,
TaskStatus,
Expand Down Expand Up @@ -43,6 +44,13 @@
Lists transient statutes of the enum :class:`SecurityGroupState <SecurityGroupState>`.
"""

SERVER_IP_TRANSIENT_STATUSES: List[ServerIpState] = [
ServerIpState.PENDING,
]
"""
Lists transient statutes of the enum :class:`ServerIpState <ServerIpState>`.
"""

SERVER_TRANSIENT_STATUSES: List[ServerState] = [
ServerState.STARTING,
ServerState.STOPPING,
Expand Down
7 changes: 7 additions & 0 deletions scaleway/scaleway/instance/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
ServerAction,
ServerIpIpFamily,
ServerIpProvisioningMode,
ServerIpState,
ServerState,
SnapshotState,
SnapshotVolumeType,
Expand Down Expand Up @@ -498,6 +499,9 @@ def unmarshal_ServerIp(data: Any) -> ServerIp:
field = data.get("provisioning_mode", None)
args["provisioning_mode"] = field

field = data.get("state", None)
args["state"] = field

field = data.get("tags", None)
args["tags"] = field

Expand Down Expand Up @@ -2428,6 +2432,9 @@ def marshal_ServerIp(
request.provisioning_mode
)

if request.state is not None:
output["state"] = ServerIpState(request.state)

if request.tags is not None:
output["tags"] = request.tags

Expand Down
13 changes: 13 additions & 0 deletions scaleway/scaleway/instance/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,17 @@ def __str__(self) -> str:
return str(self.value)


class ServerIpState(str, Enum, metaclass=StrEnumMeta):
UNKNOWN_STATE = "unknown_state"
DETACHED = "detached"
ATTACHED = "attached"
PENDING = "pending"
ERROR = "error"

def __str__(self) -> str:
return str(self.value)


class ServerState(str, Enum, metaclass=StrEnumMeta):
RUNNING = "running"
STOPPED = "stopped"
Expand Down Expand Up @@ -1272,6 +1283,8 @@ class ServerIp:
Tags associated with the IP.
"""

state: ServerIpState


@dataclass
class ServerIpv6:
Expand Down