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
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from .types import ServerTypeDisk
from .types import ServerTypeGPU
from .types import ServerTypeMemory
from .types import ServerTypeNPU
from .types import ServerTypeNetwork
from .types import BatchCreateServersRequestBatchInnerCreateServerRequest
from .types import Server
Expand Down Expand Up @@ -74,6 +75,7 @@
"ServerTypeDisk",
"ServerTypeGPU",
"ServerTypeMemory",
"ServerTypeNPU",
"ServerTypeNetwork",
"BatchCreateServersRequestBatchInnerCreateServerRequest",
"Server",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
ServerTypeDisk,
ServerTypeGPU,
ServerTypeMemory,
ServerTypeNPU,
ServerTypeNetwork,
ServerType,
BatchCreateServersResponse,
Expand Down Expand Up @@ -360,6 +361,18 @@ def unmarshal_ServerTypeCPU(data: Any) -> ServerTypeCPU:
else:
args["frequency"] = None

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

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

return ServerTypeCPU(**args)


Expand Down Expand Up @@ -426,6 +439,23 @@ def unmarshal_ServerTypeMemory(data: Any) -> ServerTypeMemory:
return ServerTypeMemory(**args)


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

args: dict[str, Any] = {}

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

return ServerTypeNPU(**args)


def unmarshal_ServerTypeNetwork(data: Any) -> ServerTypeNetwork:
if not isinstance(data, dict):
raise TypeError(
Expand All @@ -446,6 +476,12 @@ def unmarshal_ServerTypeNetwork(data: Any) -> ServerTypeNetwork:
else:
args["supported_bandwidth"] = None

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

return ServerTypeNetwork(**args)


Expand Down Expand Up @@ -511,6 +547,12 @@ def unmarshal_ServerType(data: Any) -> ServerType:
else:
args["default_os"] = None

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

return ServerType(**args)


Expand Down
13 changes: 13 additions & 0 deletions scaleway-async/scaleway_async/applesilicon/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ class ServerTypeCPU:
name: str
core_count: int
frequency: int
sockets: int
threads_per_core: int


@dataclass
Expand All @@ -187,10 +189,16 @@ class ServerTypeMemory:
type_: str


@dataclass
class ServerTypeNPU:
count: int


@dataclass
class ServerTypeNetwork:
public_bandwidth_bps: int
supported_bandwidth: list[int]
default_public_bandwidth: int


@dataclass
Expand Down Expand Up @@ -411,6 +419,11 @@ class ServerType:
The default OS for this server type.
"""

npu: Optional[ServerTypeNPU] = None
"""
NPU description.
"""


@dataclass
class CommitmentTypeValue:
Expand Down
2 changes: 2 additions & 0 deletions scaleway/scaleway/applesilicon/v1alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from .types import ServerTypeDisk
from .types import ServerTypeGPU
from .types import ServerTypeMemory
from .types import ServerTypeNPU
from .types import ServerTypeNetwork
from .types import BatchCreateServersRequestBatchInnerCreateServerRequest
from .types import Server
Expand Down Expand Up @@ -74,6 +75,7 @@
"ServerTypeDisk",
"ServerTypeGPU",
"ServerTypeMemory",
"ServerTypeNPU",
"ServerTypeNetwork",
"BatchCreateServersRequestBatchInnerCreateServerRequest",
"Server",
Expand Down
42 changes: 42 additions & 0 deletions scaleway/scaleway/applesilicon/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
ServerTypeDisk,
ServerTypeGPU,
ServerTypeMemory,
ServerTypeNPU,
ServerTypeNetwork,
ServerType,
BatchCreateServersResponse,
Expand Down Expand Up @@ -360,6 +361,18 @@ def unmarshal_ServerTypeCPU(data: Any) -> ServerTypeCPU:
else:
args["frequency"] = None

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

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

return ServerTypeCPU(**args)


Expand Down Expand Up @@ -426,6 +439,23 @@ def unmarshal_ServerTypeMemory(data: Any) -> ServerTypeMemory:
return ServerTypeMemory(**args)


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

args: dict[str, Any] = {}

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

return ServerTypeNPU(**args)


def unmarshal_ServerTypeNetwork(data: Any) -> ServerTypeNetwork:
if not isinstance(data, dict):
raise TypeError(
Expand All @@ -446,6 +476,12 @@ def unmarshal_ServerTypeNetwork(data: Any) -> ServerTypeNetwork:
else:
args["supported_bandwidth"] = None

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

return ServerTypeNetwork(**args)


Expand Down Expand Up @@ -511,6 +547,12 @@ def unmarshal_ServerType(data: Any) -> ServerType:
else:
args["default_os"] = None

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

return ServerType(**args)


Expand Down
13 changes: 13 additions & 0 deletions scaleway/scaleway/applesilicon/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ class ServerTypeCPU:
name: str
core_count: int
frequency: int
sockets: int
threads_per_core: int


@dataclass
Expand All @@ -187,10 +189,16 @@ class ServerTypeMemory:
type_: str


@dataclass
class ServerTypeNPU:
count: int


@dataclass
class ServerTypeNetwork:
public_bandwidth_bps: int
supported_bandwidth: list[int]
default_public_bandwidth: int


@dataclass
Expand Down Expand Up @@ -411,6 +419,11 @@ class ServerType:
The default OS for this server type.
"""

npu: Optional[ServerTypeNPU] = None
"""
NPU description.
"""


@dataclass
class CommitmentTypeValue:
Expand Down