diff --git a/scaleway-async/scaleway_async/instance/v1/__init__.py b/scaleway-async/scaleway_async/instance/v1/__init__.py index 686123bd6..a1bdc97a9 100644 --- a/scaleway-async/scaleway_async/instance/v1/__init__.py +++ b/scaleway-async/scaleway_async/instance/v1/__init__.py @@ -55,6 +55,7 @@ from .types import VolumeServer from .types import SnapshotBaseVolume from .types import ServerTypeCapabilities +from .types import ServerTypeGPUInfo from .types import ServerTypeNetwork from .types import ServerTypeVolumeConstraintsByType from .types import VolumeTypeCapabilities @@ -253,6 +254,7 @@ "VolumeServer", "SnapshotBaseVolume", "ServerTypeCapabilities", + "ServerTypeGPUInfo", "ServerTypeNetwork", "ServerTypeVolumeConstraintsByType", "VolumeTypeCapabilities", diff --git a/scaleway-async/scaleway_async/instance/v1/marshalling.py b/scaleway-async/scaleway_async/instance/v1/marshalling.py index 68deee034..419fa1dda 100644 --- a/scaleway-async/scaleway_async/instance/v1/marshalling.py +++ b/scaleway-async/scaleway_async/instance/v1/marshalling.py @@ -82,6 +82,7 @@ ServerTypeNetworkInterface, ServerTypeVolumeConstraintSizes, ServerTypeCapabilities, + ServerTypeGPUInfo, ServerTypeNetwork, ServerTypeVolumeConstraintsByType, ServerType, @@ -2060,6 +2061,29 @@ def unmarshal_ServerTypeCapabilities(data: Any) -> ServerTypeCapabilities: return ServerTypeCapabilities(**args) +def unmarshal_ServerTypeGPUInfo(data: Any) -> ServerTypeGPUInfo: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ServerTypeGPUInfo' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("gpu_manufacturer", None) + if field is not None: + args["gpu_manufacturer"] = field + + field = data.get("gpu_name", None) + if field is not None: + args["gpu_name"] = field + + field = data.get("gpu_memory", None) + if field is not None: + args["gpu_memory"] = field + + return ServerTypeGPUInfo(**args) + + def unmarshal_ServerTypeNetwork(data: Any) -> ServerTypeNetwork: if not isinstance(data, dict): raise TypeError( @@ -2152,10 +2176,6 @@ def unmarshal_ServerType(data: Any) -> ServerType: if field is not None: args["baremetal"] = field - field = data.get("end_of_service", None) - if field is not None: - args["end_of_service"] = field - field = data.get("per_volume_constraint", None) if field is not None: args["per_volume_constraint"] = unmarshal_ServerTypeVolumeConstraintsByType( @@ -2176,6 +2196,16 @@ def unmarshal_ServerType(data: Any) -> ServerType: else: args["gpu"] = None + field = data.get("end_of_service", None) + if field is not None: + args["end_of_service"] = field + + field = data.get("gpu_info", None) + if field is not None: + args["gpu_info"] = unmarshal_ServerTypeGPUInfo(field) + else: + args["gpu_info"] = None + field = data.get("network", None) if field is not None: args["network"] = unmarshal_ServerTypeNetwork(field) diff --git a/scaleway-async/scaleway_async/instance/v1/types.py b/scaleway-async/scaleway_async/instance/v1/types.py index bac61a4c7..fef8846e8 100644 --- a/scaleway-async/scaleway_async/instance/v1/types.py +++ b/scaleway-async/scaleway_async/instance/v1/types.py @@ -714,6 +714,24 @@ class ServerTypeCapabilities: """ +@dataclass +class ServerTypeGPUInfo: + gpu_manufacturer: str + """ + GPU manufacturer. + """ + + gpu_name: str + """ + GPU model name. + """ + + gpu_memory: int + """ + RAM of a single GPU, in bytes. + """ + + @dataclass class ServerTypeNetwork: interfaces: List[ServerTypeNetworkInterface] @@ -1342,11 +1360,6 @@ class ServerType: True if it is a baremetal Instance. """ - end_of_service: bool - """ - True if this Instance type has reached end of service. - """ - per_volume_constraint: Optional[ServerTypeVolumeConstraintsByType] """ Additional volume constraints. @@ -1362,6 +1375,16 @@ class ServerType: Number of GPU. """ + end_of_service: bool + """ + True if this Instance type has reached end of service. + """ + + gpu_info: Optional[ServerTypeGPUInfo] + """ + GPU information. + """ + network: Optional[ServerTypeNetwork] """ Network available for the Instance. diff --git a/scaleway/scaleway/instance/v1/__init__.py b/scaleway/scaleway/instance/v1/__init__.py index 686123bd6..a1bdc97a9 100644 --- a/scaleway/scaleway/instance/v1/__init__.py +++ b/scaleway/scaleway/instance/v1/__init__.py @@ -55,6 +55,7 @@ from .types import VolumeServer from .types import SnapshotBaseVolume from .types import ServerTypeCapabilities +from .types import ServerTypeGPUInfo from .types import ServerTypeNetwork from .types import ServerTypeVolumeConstraintsByType from .types import VolumeTypeCapabilities @@ -253,6 +254,7 @@ "VolumeServer", "SnapshotBaseVolume", "ServerTypeCapabilities", + "ServerTypeGPUInfo", "ServerTypeNetwork", "ServerTypeVolumeConstraintsByType", "VolumeTypeCapabilities", diff --git a/scaleway/scaleway/instance/v1/marshalling.py b/scaleway/scaleway/instance/v1/marshalling.py index 68deee034..419fa1dda 100644 --- a/scaleway/scaleway/instance/v1/marshalling.py +++ b/scaleway/scaleway/instance/v1/marshalling.py @@ -82,6 +82,7 @@ ServerTypeNetworkInterface, ServerTypeVolumeConstraintSizes, ServerTypeCapabilities, + ServerTypeGPUInfo, ServerTypeNetwork, ServerTypeVolumeConstraintsByType, ServerType, @@ -2060,6 +2061,29 @@ def unmarshal_ServerTypeCapabilities(data: Any) -> ServerTypeCapabilities: return ServerTypeCapabilities(**args) +def unmarshal_ServerTypeGPUInfo(data: Any) -> ServerTypeGPUInfo: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ServerTypeGPUInfo' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("gpu_manufacturer", None) + if field is not None: + args["gpu_manufacturer"] = field + + field = data.get("gpu_name", None) + if field is not None: + args["gpu_name"] = field + + field = data.get("gpu_memory", None) + if field is not None: + args["gpu_memory"] = field + + return ServerTypeGPUInfo(**args) + + def unmarshal_ServerTypeNetwork(data: Any) -> ServerTypeNetwork: if not isinstance(data, dict): raise TypeError( @@ -2152,10 +2176,6 @@ def unmarshal_ServerType(data: Any) -> ServerType: if field is not None: args["baremetal"] = field - field = data.get("end_of_service", None) - if field is not None: - args["end_of_service"] = field - field = data.get("per_volume_constraint", None) if field is not None: args["per_volume_constraint"] = unmarshal_ServerTypeVolumeConstraintsByType( @@ -2176,6 +2196,16 @@ def unmarshal_ServerType(data: Any) -> ServerType: else: args["gpu"] = None + field = data.get("end_of_service", None) + if field is not None: + args["end_of_service"] = field + + field = data.get("gpu_info", None) + if field is not None: + args["gpu_info"] = unmarshal_ServerTypeGPUInfo(field) + else: + args["gpu_info"] = None + field = data.get("network", None) if field is not None: args["network"] = unmarshal_ServerTypeNetwork(field) diff --git a/scaleway/scaleway/instance/v1/types.py b/scaleway/scaleway/instance/v1/types.py index bac61a4c7..fef8846e8 100644 --- a/scaleway/scaleway/instance/v1/types.py +++ b/scaleway/scaleway/instance/v1/types.py @@ -714,6 +714,24 @@ class ServerTypeCapabilities: """ +@dataclass +class ServerTypeGPUInfo: + gpu_manufacturer: str + """ + GPU manufacturer. + """ + + gpu_name: str + """ + GPU model name. + """ + + gpu_memory: int + """ + RAM of a single GPU, in bytes. + """ + + @dataclass class ServerTypeNetwork: interfaces: List[ServerTypeNetworkInterface] @@ -1342,11 +1360,6 @@ class ServerType: True if it is a baremetal Instance. """ - end_of_service: bool - """ - True if this Instance type has reached end of service. - """ - per_volume_constraint: Optional[ServerTypeVolumeConstraintsByType] """ Additional volume constraints. @@ -1362,6 +1375,16 @@ class ServerType: Number of GPU. """ + end_of_service: bool + """ + True if this Instance type has reached end of service. + """ + + gpu_info: Optional[ServerTypeGPUInfo] + """ + GPU information. + """ + network: Optional[ServerTypeNetwork] """ Network available for the Instance.