Skip to content

feat(instance): activate filesystems integration #1021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2025
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
6 changes: 6 additions & 0 deletions scaleway-async/scaleway_async/instance/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
from .types import SecurityGroupState
from .content import SECURITY_GROUP_TRANSIENT_STATUSES
from .types import ServerAction
from .types import ServerFilesystemState
from .content import SERVER_FILESYSTEM_TRANSIENT_STATUSES
from .types import ServerIpIpFamily
from .types import ServerIpProvisioningMode
from .types import ServerIpState
Expand Down Expand Up @@ -48,6 +50,7 @@
from .types import PlacementGroup
from .types import PrivateNIC
from .types import SecurityGroupSummary
from .types import ServerFilesystem
from .types import ServerIp
from .types import ServerIpv6
from .types import ServerLocation
Expand Down Expand Up @@ -223,6 +226,8 @@
"SecurityGroupState",
"SECURITY_GROUP_TRANSIENT_STATUSES",
"ServerAction",
"ServerFilesystemState",
"SERVER_FILESYSTEM_TRANSIENT_STATUSES",
"ServerIpIpFamily",
"ServerIpProvisioningMode",
"ServerIpState",
Expand Down Expand Up @@ -251,6 +256,7 @@
"PlacementGroup",
"PrivateNIC",
"SecurityGroupSummary",
"ServerFilesystem",
"ServerIp",
"ServerIpv6",
"ServerLocation",
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,
ServerFilesystemState,
ServerIpState,
ServerState,
SnapshotState,
Expand Down Expand Up @@ -39,6 +40,13 @@
"""
Lists transient statutes of the enum :class:`SecurityGroupState <SecurityGroupState>`.
"""
SERVER_FILESYSTEM_TRANSIENT_STATUSES: List[ServerFilesystemState] = [
ServerFilesystemState.ATTACHING,
ServerFilesystemState.DETACHING,
]
"""
Lists transient statutes of the enum :class:`ServerFilesystemState <ServerFilesystemState>`.
"""
SERVER_IP_TRANSIENT_STATUSES: List[ServerIpState] = [
ServerIpState.PENDING,
]
Expand Down
28 changes: 28 additions & 0 deletions scaleway-async/scaleway_async/instance/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
Image,
PlacementGroup,
SecurityGroupSummary,
ServerFilesystem,
ServerIp,
ServerIpv6,
ServerLocation,
Expand Down Expand Up @@ -519,6 +520,25 @@ def unmarshal_SecurityGroupSummary(data: Any) -> SecurityGroupSummary:
return SecurityGroupSummary(**args)


def unmarshal_ServerFilesystem(data: Any) -> ServerFilesystem:
if not isinstance(data, dict):
raise TypeError(
"Unmarshalling the type 'ServerFilesystem' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}

field = data.get("filesystem_id", None)
if field is not None:
args["filesystem_id"] = field

field = data.get("state", None)
if field is not None:
args["state"] = field

return ServerFilesystem(**args)


def unmarshal_ServerIp(data: Any) -> ServerIp:
if not isinstance(data, dict):
raise TypeError(
Expand Down Expand Up @@ -902,6 +922,14 @@ def unmarshal_Server(data: Any) -> Server:
if field is not None:
args["zone"] = field

field = data.get("filesystems", None)
if field is not None:
args["filesystems"] = (
[unmarshal_ServerFilesystem(v) for v in field]
if field is not None
else None
)

field = data.get("end_of_service", None)
if field is not None:
args["end_of_service"] = field
Expand Down
22 changes: 22 additions & 0 deletions scaleway-async/scaleway_async/instance/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ def __str__(self) -> str:
return str(self.value)


class ServerFilesystemState(str, Enum, metaclass=StrEnumMeta):
UNKNOWN_STATE = "unknown_state"
ATTACHING = "attaching"
AVAILABLE = "available"
DETACHING = "detaching"

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


class ServerIpIpFamily(str, Enum, metaclass=StrEnumMeta):
INET = "inet"
INET6 = "inet6"
Expand Down Expand Up @@ -565,6 +575,13 @@ class SecurityGroupSummary:
name: str


@dataclass
class ServerFilesystem:
filesystem_id: str

state: ServerFilesystemState


@dataclass
class ServerIp:
id: str
Expand Down Expand Up @@ -887,6 +904,11 @@ class Server:
Zone in which the Instance is located.
"""

filesystems: List[ServerFilesystem]
"""
List of attached filesystems.
"""

end_of_service: bool
"""
True if the Instance type has reached end of service.
Expand Down
6 changes: 6 additions & 0 deletions scaleway/scaleway/instance/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
from .types import SecurityGroupState
from .content import SECURITY_GROUP_TRANSIENT_STATUSES
from .types import ServerAction
from .types import ServerFilesystemState
from .content import SERVER_FILESYSTEM_TRANSIENT_STATUSES
from .types import ServerIpIpFamily
from .types import ServerIpProvisioningMode
from .types import ServerIpState
Expand Down Expand Up @@ -48,6 +50,7 @@
from .types import PlacementGroup
from .types import PrivateNIC
from .types import SecurityGroupSummary
from .types import ServerFilesystem
from .types import ServerIp
from .types import ServerIpv6
from .types import ServerLocation
Expand Down Expand Up @@ -223,6 +226,8 @@
"SecurityGroupState",
"SECURITY_GROUP_TRANSIENT_STATUSES",
"ServerAction",
"ServerFilesystemState",
"SERVER_FILESYSTEM_TRANSIENT_STATUSES",
"ServerIpIpFamily",
"ServerIpProvisioningMode",
"ServerIpState",
Expand Down Expand Up @@ -251,6 +256,7 @@
"PlacementGroup",
"PrivateNIC",
"SecurityGroupSummary",
"ServerFilesystem",
"ServerIp",
"ServerIpv6",
"ServerLocation",
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,
ServerFilesystemState,
ServerIpState,
ServerState,
SnapshotState,
Expand Down Expand Up @@ -39,6 +40,13 @@
"""
Lists transient statutes of the enum :class:`SecurityGroupState <SecurityGroupState>`.
"""
SERVER_FILESYSTEM_TRANSIENT_STATUSES: List[ServerFilesystemState] = [
ServerFilesystemState.ATTACHING,
ServerFilesystemState.DETACHING,
]
"""
Lists transient statutes of the enum :class:`ServerFilesystemState <ServerFilesystemState>`.
"""
SERVER_IP_TRANSIENT_STATUSES: List[ServerIpState] = [
ServerIpState.PENDING,
]
Expand Down
28 changes: 28 additions & 0 deletions scaleway/scaleway/instance/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
Image,
PlacementGroup,
SecurityGroupSummary,
ServerFilesystem,
ServerIp,
ServerIpv6,
ServerLocation,
Expand Down Expand Up @@ -519,6 +520,25 @@ def unmarshal_SecurityGroupSummary(data: Any) -> SecurityGroupSummary:
return SecurityGroupSummary(**args)


def unmarshal_ServerFilesystem(data: Any) -> ServerFilesystem:
if not isinstance(data, dict):
raise TypeError(
"Unmarshalling the type 'ServerFilesystem' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}

field = data.get("filesystem_id", None)
if field is not None:
args["filesystem_id"] = field

field = data.get("state", None)
if field is not None:
args["state"] = field

return ServerFilesystem(**args)


def unmarshal_ServerIp(data: Any) -> ServerIp:
if not isinstance(data, dict):
raise TypeError(
Expand Down Expand Up @@ -902,6 +922,14 @@ def unmarshal_Server(data: Any) -> Server:
if field is not None:
args["zone"] = field

field = data.get("filesystems", None)
if field is not None:
args["filesystems"] = (
[unmarshal_ServerFilesystem(v) for v in field]
if field is not None
else None
)

field = data.get("end_of_service", None)
if field is not None:
args["end_of_service"] = field
Expand Down
22 changes: 22 additions & 0 deletions scaleway/scaleway/instance/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ def __str__(self) -> str:
return str(self.value)


class ServerFilesystemState(str, Enum, metaclass=StrEnumMeta):
UNKNOWN_STATE = "unknown_state"
ATTACHING = "attaching"
AVAILABLE = "available"
DETACHING = "detaching"

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


class ServerIpIpFamily(str, Enum, metaclass=StrEnumMeta):
INET = "inet"
INET6 = "inet6"
Expand Down Expand Up @@ -565,6 +575,13 @@ class SecurityGroupSummary:
name: str


@dataclass
class ServerFilesystem:
filesystem_id: str

state: ServerFilesystemState


@dataclass
class ServerIp:
id: str
Expand Down Expand Up @@ -887,6 +904,11 @@ class Server:
Zone in which the Instance is located.
"""

filesystems: List[ServerFilesystem]
"""
List of attached filesystems.
"""

end_of_service: bool
"""
True if the Instance type has reached end of service.
Expand Down