diff --git a/scaleway-async/scaleway_async/applesilicon/v1alpha1/__init__.py b/scaleway-async/scaleway_async/applesilicon/v1alpha1/__init__.py index e50c753f5..5ea0fe91b 100644 --- a/scaleway-async/scaleway_async/applesilicon/v1alpha1/__init__.py +++ b/scaleway-async/scaleway_async/applesilicon/v1alpha1/__init__.py @@ -12,17 +12,17 @@ from .types import ServerStatus from .content import SERVER_TRANSIENT_STATUSES from .types import ServerTypeStock +from .types import Commitment from .types import OS from .types import ServerTypeCPU from .types import ServerTypeDisk from .types import ServerTypeGPU from .types import ServerTypeMemory from .types import ServerTypeNetwork -from .types import Commitment +from .types import Server from .types import ConnectivityDiagnosticServerHealth from .types import ServerPrivateNetwork from .types import ServerType -from .types import Server from .types import CommitmentTypeValue from .types import ConnectivityDiagnostic from .types import CreateServerRequest @@ -65,17 +65,17 @@ "ServerStatus", "SERVER_TRANSIENT_STATUSES", "ServerTypeStock", + "Commitment", "OS", "ServerTypeCPU", "ServerTypeDisk", "ServerTypeGPU", "ServerTypeMemory", "ServerTypeNetwork", - "Commitment", + "Server", "ConnectivityDiagnosticServerHealth", "ServerPrivateNetwork", "ServerType", - "Server", "CommitmentTypeValue", "ConnectivityDiagnostic", "CreateServerRequest", diff --git a/scaleway-async/scaleway_async/applesilicon/v1alpha1/api.py b/scaleway-async/scaleway_async/applesilicon/v1alpha1/api.py index 07d5ce076..9ad901bdc 100644 --- a/scaleway-async/scaleway_async/applesilicon/v1alpha1/api.py +++ b/scaleway-async/scaleway_async/applesilicon/v1alpha1/api.py @@ -43,9 +43,9 @@ ) from .marshalling import ( unmarshal_OS, + unmarshal_Server, unmarshal_ServerPrivateNetwork, unmarshal_ServerType, - unmarshal_Server, unmarshal_ConnectivityDiagnostic, unmarshal_ListOSResponse, unmarshal_ListServerPrivateNetworksResponse, diff --git a/scaleway-async/scaleway_async/applesilicon/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/applesilicon/v1alpha1/marshalling.py index 08cc96238..b8f5ea4c4 100644 --- a/scaleway-async/scaleway_async/applesilicon/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/applesilicon/v1alpha1/marshalling.py @@ -8,6 +8,8 @@ from .types import ( ConnectivityDiagnosticActionType, OS, + Commitment, + Server, ServerPrivateNetwork, ServerTypeCPU, ServerTypeDisk, @@ -15,8 +17,6 @@ ServerTypeMemory, ServerTypeNetwork, ServerType, - Commitment, - Server, ConnectivityDiagnosticServerHealth, ConnectivityDiagnostic, ListOSResponse, @@ -82,6 +82,132 @@ def unmarshal_OS(data: Any) -> OS: return OS(**args) +def unmarshal_Commitment(data: Any) -> Commitment: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'Commitment' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("type", None) + if field is not None: + args["type_"] = field + + field = data.get("cancelled", None) + if field is not None: + args["cancelled"] = field + + return Commitment(**args) + + +def unmarshal_Server(data: Any) -> Server: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'Server' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + + field = data.get("type", None) + if field is not None: + args["type_"] = field + + field = data.get("name", None) + if field is not None: + args["name"] = field + + field = data.get("project_id", None) + if field is not None: + args["project_id"] = field + + field = data.get("organization_id", None) + if field is not None: + args["organization_id"] = field + + field = data.get("ip", None) + if field is not None: + args["ip"] = field + + field = data.get("vnc_url", None) + if field is not None: + args["vnc_url"] = field + + field = data.get("ssh_username", None) + if field is not None: + args["ssh_username"] = field + + field = data.get("sudo_password", None) + if field is not None: + args["sudo_password"] = field + + field = data.get("vnc_port", None) + if field is not None: + args["vnc_port"] = field + + field = data.get("status", None) + if field is not None: + args["status"] = field + + field = data.get("os", None) + if field is not None: + args["os"] = unmarshal_OS(field) + else: + args["os"] = None + + field = data.get("created_at", None) + if field is not None: + args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["created_at"] = None + + field = data.get("updated_at", None) + if field is not None: + args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["updated_at"] = None + + field = data.get("deletable_at", None) + if field is not None: + args["deletable_at"] = ( + parser.isoparse(field) if isinstance(field, str) else field + ) + else: + args["deletable_at"] = None + + field = data.get("deletion_scheduled", None) + if field is not None: + args["deletion_scheduled"] = field + + field = data.get("zone", None) + if field is not None: + args["zone"] = field + + field = data.get("delivered", None) + if field is not None: + args["delivered"] = field + + field = data.get("vpc_status", None) + if field is not None: + args["vpc_status"] = field + + field = data.get("public_bandwidth_bps", None) + if field is not None: + args["public_bandwidth_bps"] = field + + field = data.get("commitment", None) + if field is not None: + args["commitment"] = unmarshal_Commitment(field) + else: + args["commitment"] = None + + return Server(**args) + + def unmarshal_ServerPrivateNetwork(data: Any) -> ServerPrivateNetwork: if not isinstance(data, dict): raise TypeError( @@ -291,132 +417,6 @@ def unmarshal_ServerType(data: Any) -> ServerType: return ServerType(**args) -def unmarshal_Commitment(data: Any) -> Commitment: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'Commitment' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("type", None) - if field is not None: - args["type_"] = field - - field = data.get("cancelled", None) - if field is not None: - args["cancelled"] = field - - return Commitment(**args) - - -def unmarshal_Server(data: Any) -> Server: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'Server' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("id", None) - if field is not None: - args["id"] = field - - field = data.get("type", None) - if field is not None: - args["type_"] = field - - field = data.get("name", None) - if field is not None: - args["name"] = field - - field = data.get("project_id", None) - if field is not None: - args["project_id"] = field - - field = data.get("organization_id", None) - if field is not None: - args["organization_id"] = field - - field = data.get("ip", None) - if field is not None: - args["ip"] = field - - field = data.get("vnc_url", None) - if field is not None: - args["vnc_url"] = field - - field = data.get("ssh_username", None) - if field is not None: - args["ssh_username"] = field - - field = data.get("sudo_password", None) - if field is not None: - args["sudo_password"] = field - - field = data.get("vnc_port", None) - if field is not None: - args["vnc_port"] = field - - field = data.get("status", None) - if field is not None: - args["status"] = field - - field = data.get("os", None) - if field is not None: - args["os"] = unmarshal_OS(field) - else: - args["os"] = None - - field = data.get("created_at", None) - if field is not None: - args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field - else: - args["created_at"] = None - - field = data.get("updated_at", None) - if field is not None: - args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field - else: - args["updated_at"] = None - - field = data.get("deletable_at", None) - if field is not None: - args["deletable_at"] = ( - parser.isoparse(field) if isinstance(field, str) else field - ) - else: - args["deletable_at"] = None - - field = data.get("deletion_scheduled", None) - if field is not None: - args["deletion_scheduled"] = field - - field = data.get("zone", None) - if field is not None: - args["zone"] = field - - field = data.get("delivered", None) - if field is not None: - args["delivered"] = field - - field = data.get("vpc_status", None) - if field is not None: - args["vpc_status"] = field - - field = data.get("public_bandwidth_bps", None) - if field is not None: - args["public_bandwidth_bps"] = field - - field = data.get("commitment", None) - if field is not None: - args["commitment"] = unmarshal_Commitment(field) - else: - args["commitment"] = None - - return Server(**args) - - def unmarshal_ConnectivityDiagnosticServerHealth( data: Any, ) -> ConnectivityDiagnosticServerHealth: diff --git a/scaleway-async/scaleway_async/applesilicon/v1alpha1/types.py b/scaleway-async/scaleway_async/applesilicon/v1alpha1/types.py index f107199d0..5adbcb259 100644 --- a/scaleway-async/scaleway_async/applesilicon/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/applesilicon/v1alpha1/types.py @@ -109,6 +109,13 @@ def __str__(self) -> str: return str(self.value) +@dataclass +class Commitment: + type_: CommitmentType + + cancelled: bool + + @dataclass class OS: id: str @@ -193,228 +200,221 @@ class ServerTypeNetwork: @dataclass -class Commitment: - type_: CommitmentType - - cancelled: bool - - -@dataclass -class ConnectivityDiagnosticServerHealth: - is_server_alive: bool - - is_agent_alive: bool - - is_mdm_alive: bool - - is_ssh_port_up: bool - - is_vnc_port_up: bool - - last_checkin_date: Optional[datetime] - - -@dataclass -class ServerPrivateNetwork: +class Server: id: str """ - ID of the Server-to-Private Network mapping. + UUID of the server. """ - project_id: str + type_: str """ - Private Network Project ID. + Type of the server. """ - server_id: str + name: str """ - Apple silicon server ID. + Name of the server. """ - private_network_id: str + project_id: str """ - Private Network ID. + Project this server is associated with. """ - status: ServerPrivateNetworkServerStatus + organization_id: str """ - Configuration status of the Private Network. + Organization this server is associated with. """ - ipam_ip_ids: List[str] + ip: str """ - IPAM IP IDs of the server, if it has any. + IPv4 address of the server. """ - vlan: Optional[int] + vnc_url: str """ - ID of the VLAN associated with the Private Network. + Vnc:// URL to access Apple Remote Desktop. """ - created_at: Optional[datetime] + ssh_username: str """ - Private Network creation date. + SSH Username for remote shell. """ - updated_at: Optional[datetime] + sudo_password: str """ - Date the Private Network was last modified. + Admin password required to execute commands. """ - -@dataclass -class ServerType: - name: str + vnc_port: int """ - Name of the type. + VNC port to use for remote desktop connection. """ - stock: ServerTypeStock + status: ServerStatus """ - Current stock. + Current status of the server. """ - cpu: Optional[ServerTypeCPU] + os: Optional[OS] """ - CPU description. + Initially installed OS, this does not necessarily reflect the current OS version. """ - disk: Optional[ServerTypeDisk] + created_at: Optional[datetime] """ - Size of the local disk of the server. + Date on which the server was created. """ - memory: Optional[ServerTypeMemory] + updated_at: Optional[datetime] """ - Size of memory available. + Date on which the server was last updated. """ - minimum_lease_duration: Optional[str] + deletable_at: Optional[datetime] """ - Minimum duration of the lease in seconds (example. 3.4s). + Date from which the server can be deleted. """ - gpu: Optional[ServerTypeGPU] + deletion_scheduled: bool """ - GPU description. + Set to true to mark the server for automatic deletion depending on `deletable_at` date. Set to false to cancel an existing deletion schedule. Leave unset otherwise. """ - network: Optional[ServerTypeNetwork] + zone: ScwZone """ - Network description. + Zone of the server. """ - default_os: Optional[OS] + delivered: bool """ - The default OS for this server type. + Set to true once the server has completed its provisioning steps and is ready to use. Some OS configurations might require a reinstallation of the server before delivery depending on the available stock. A reinstallation after the initial delivery will not change this flag and can be tracked using the server status. """ - -@dataclass -class Server: - id: str + vpc_status: ServerPrivateNetworkStatus """ - UUID of the server. + Activation status of optional Private Network feature support for this server. """ - type_: str + public_bandwidth_bps: int """ - Type of the server. + Public bandwidth configured for this server. Expressed in bits per second. """ - name: str + commitment: Optional[Commitment] """ - Name of the server. + Commitment scheme applied to this server. """ - project_id: str + +@dataclass +class ConnectivityDiagnosticServerHealth: + is_server_alive: bool + + is_agent_alive: bool + + is_mdm_alive: bool + + is_ssh_port_up: bool + + is_vnc_port_up: bool + + last_checkin_date: Optional[datetime] + + +@dataclass +class ServerPrivateNetwork: + id: str """ - Project this server is associated with. + ID of the Server-to-Private Network mapping. """ - organization_id: str + project_id: str """ - Organization this server is associated with. + Private Network Project ID. """ - ip: str + server_id: str """ - IPv4 address of the server. + Apple silicon server ID. """ - vnc_url: str + private_network_id: str """ - Vnc:// URL to access Apple Remote Desktop. + Private Network ID. """ - ssh_username: str + status: ServerPrivateNetworkServerStatus """ - SSH Username for remote shell. + Configuration status of the Private Network. """ - sudo_password: str + ipam_ip_ids: List[str] """ - Admin password required to execute commands. + IPAM IP IDs of the server, if it has any. """ - vnc_port: int + vlan: Optional[int] """ - VNC port to use for remote desktop connection. + ID of the VLAN associated with the Private Network. """ - status: ServerStatus + created_at: Optional[datetime] """ - Current status of the server. + Private Network creation date. """ - os: Optional[OS] + updated_at: Optional[datetime] """ - Initially installed OS, this does not necessarily reflect the current OS version. + Date the Private Network was last modified. """ - created_at: Optional[datetime] + +@dataclass +class ServerType: + name: str """ - Date on which the server was created. + Name of the type. """ - updated_at: Optional[datetime] + stock: ServerTypeStock """ - Date on which the server was last updated. + Current stock. """ - deletable_at: Optional[datetime] + cpu: Optional[ServerTypeCPU] """ - Date from which the server can be deleted. + CPU description. """ - deletion_scheduled: bool + disk: Optional[ServerTypeDisk] """ - Set to true to mark the server for automatic deletion depending on `deletable_at` date. Set to false to cancel an existing deletion schedule. Leave unset otherwise. + Size of the local disk of the server. """ - zone: ScwZone + memory: Optional[ServerTypeMemory] """ - Zone of the server. + Size of memory available. """ - delivered: bool + minimum_lease_duration: Optional[str] """ - Set to true once the server has completed its provisioning steps and is ready to use. Some OS configurations might require a reinstallation of the server before delivery depending on the available stock. A reinstallation after the initial delivery will not change this flag and can be tracked using the server status. + Minimum duration of the lease in seconds (example. 3.4s). """ - vpc_status: ServerPrivateNetworkStatus + gpu: Optional[ServerTypeGPU] """ - Activation status of optional Private Network feature support for this server. + GPU description. """ - public_bandwidth_bps: int + network: Optional[ServerTypeNetwork] """ - Public bandwidth configured for this server. Expressed in bits per second. + Network description. """ - commitment: Optional[Commitment] + default_os: Optional[OS] """ - Commitment scheme applied to this server. + The default OS for this server type. """ diff --git a/scaleway/scaleway/applesilicon/v1alpha1/__init__.py b/scaleway/scaleway/applesilicon/v1alpha1/__init__.py index e50c753f5..5ea0fe91b 100644 --- a/scaleway/scaleway/applesilicon/v1alpha1/__init__.py +++ b/scaleway/scaleway/applesilicon/v1alpha1/__init__.py @@ -12,17 +12,17 @@ from .types import ServerStatus from .content import SERVER_TRANSIENT_STATUSES from .types import ServerTypeStock +from .types import Commitment from .types import OS from .types import ServerTypeCPU from .types import ServerTypeDisk from .types import ServerTypeGPU from .types import ServerTypeMemory from .types import ServerTypeNetwork -from .types import Commitment +from .types import Server from .types import ConnectivityDiagnosticServerHealth from .types import ServerPrivateNetwork from .types import ServerType -from .types import Server from .types import CommitmentTypeValue from .types import ConnectivityDiagnostic from .types import CreateServerRequest @@ -65,17 +65,17 @@ "ServerStatus", "SERVER_TRANSIENT_STATUSES", "ServerTypeStock", + "Commitment", "OS", "ServerTypeCPU", "ServerTypeDisk", "ServerTypeGPU", "ServerTypeMemory", "ServerTypeNetwork", - "Commitment", + "Server", "ConnectivityDiagnosticServerHealth", "ServerPrivateNetwork", "ServerType", - "Server", "CommitmentTypeValue", "ConnectivityDiagnostic", "CreateServerRequest", diff --git a/scaleway/scaleway/applesilicon/v1alpha1/api.py b/scaleway/scaleway/applesilicon/v1alpha1/api.py index 809526ad6..0046f76df 100644 --- a/scaleway/scaleway/applesilicon/v1alpha1/api.py +++ b/scaleway/scaleway/applesilicon/v1alpha1/api.py @@ -43,9 +43,9 @@ ) from .marshalling import ( unmarshal_OS, + unmarshal_Server, unmarshal_ServerPrivateNetwork, unmarshal_ServerType, - unmarshal_Server, unmarshal_ConnectivityDiagnostic, unmarshal_ListOSResponse, unmarshal_ListServerPrivateNetworksResponse, diff --git a/scaleway/scaleway/applesilicon/v1alpha1/marshalling.py b/scaleway/scaleway/applesilicon/v1alpha1/marshalling.py index 08cc96238..b8f5ea4c4 100644 --- a/scaleway/scaleway/applesilicon/v1alpha1/marshalling.py +++ b/scaleway/scaleway/applesilicon/v1alpha1/marshalling.py @@ -8,6 +8,8 @@ from .types import ( ConnectivityDiagnosticActionType, OS, + Commitment, + Server, ServerPrivateNetwork, ServerTypeCPU, ServerTypeDisk, @@ -15,8 +17,6 @@ ServerTypeMemory, ServerTypeNetwork, ServerType, - Commitment, - Server, ConnectivityDiagnosticServerHealth, ConnectivityDiagnostic, ListOSResponse, @@ -82,6 +82,132 @@ def unmarshal_OS(data: Any) -> OS: return OS(**args) +def unmarshal_Commitment(data: Any) -> Commitment: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'Commitment' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("type", None) + if field is not None: + args["type_"] = field + + field = data.get("cancelled", None) + if field is not None: + args["cancelled"] = field + + return Commitment(**args) + + +def unmarshal_Server(data: Any) -> Server: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'Server' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + + field = data.get("type", None) + if field is not None: + args["type_"] = field + + field = data.get("name", None) + if field is not None: + args["name"] = field + + field = data.get("project_id", None) + if field is not None: + args["project_id"] = field + + field = data.get("organization_id", None) + if field is not None: + args["organization_id"] = field + + field = data.get("ip", None) + if field is not None: + args["ip"] = field + + field = data.get("vnc_url", None) + if field is not None: + args["vnc_url"] = field + + field = data.get("ssh_username", None) + if field is not None: + args["ssh_username"] = field + + field = data.get("sudo_password", None) + if field is not None: + args["sudo_password"] = field + + field = data.get("vnc_port", None) + if field is not None: + args["vnc_port"] = field + + field = data.get("status", None) + if field is not None: + args["status"] = field + + field = data.get("os", None) + if field is not None: + args["os"] = unmarshal_OS(field) + else: + args["os"] = None + + field = data.get("created_at", None) + if field is not None: + args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["created_at"] = None + + field = data.get("updated_at", None) + if field is not None: + args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["updated_at"] = None + + field = data.get("deletable_at", None) + if field is not None: + args["deletable_at"] = ( + parser.isoparse(field) if isinstance(field, str) else field + ) + else: + args["deletable_at"] = None + + field = data.get("deletion_scheduled", None) + if field is not None: + args["deletion_scheduled"] = field + + field = data.get("zone", None) + if field is not None: + args["zone"] = field + + field = data.get("delivered", None) + if field is not None: + args["delivered"] = field + + field = data.get("vpc_status", None) + if field is not None: + args["vpc_status"] = field + + field = data.get("public_bandwidth_bps", None) + if field is not None: + args["public_bandwidth_bps"] = field + + field = data.get("commitment", None) + if field is not None: + args["commitment"] = unmarshal_Commitment(field) + else: + args["commitment"] = None + + return Server(**args) + + def unmarshal_ServerPrivateNetwork(data: Any) -> ServerPrivateNetwork: if not isinstance(data, dict): raise TypeError( @@ -291,132 +417,6 @@ def unmarshal_ServerType(data: Any) -> ServerType: return ServerType(**args) -def unmarshal_Commitment(data: Any) -> Commitment: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'Commitment' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("type", None) - if field is not None: - args["type_"] = field - - field = data.get("cancelled", None) - if field is not None: - args["cancelled"] = field - - return Commitment(**args) - - -def unmarshal_Server(data: Any) -> Server: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'Server' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("id", None) - if field is not None: - args["id"] = field - - field = data.get("type", None) - if field is not None: - args["type_"] = field - - field = data.get("name", None) - if field is not None: - args["name"] = field - - field = data.get("project_id", None) - if field is not None: - args["project_id"] = field - - field = data.get("organization_id", None) - if field is not None: - args["organization_id"] = field - - field = data.get("ip", None) - if field is not None: - args["ip"] = field - - field = data.get("vnc_url", None) - if field is not None: - args["vnc_url"] = field - - field = data.get("ssh_username", None) - if field is not None: - args["ssh_username"] = field - - field = data.get("sudo_password", None) - if field is not None: - args["sudo_password"] = field - - field = data.get("vnc_port", None) - if field is not None: - args["vnc_port"] = field - - field = data.get("status", None) - if field is not None: - args["status"] = field - - field = data.get("os", None) - if field is not None: - args["os"] = unmarshal_OS(field) - else: - args["os"] = None - - field = data.get("created_at", None) - if field is not None: - args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field - else: - args["created_at"] = None - - field = data.get("updated_at", None) - if field is not None: - args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field - else: - args["updated_at"] = None - - field = data.get("deletable_at", None) - if field is not None: - args["deletable_at"] = ( - parser.isoparse(field) if isinstance(field, str) else field - ) - else: - args["deletable_at"] = None - - field = data.get("deletion_scheduled", None) - if field is not None: - args["deletion_scheduled"] = field - - field = data.get("zone", None) - if field is not None: - args["zone"] = field - - field = data.get("delivered", None) - if field is not None: - args["delivered"] = field - - field = data.get("vpc_status", None) - if field is not None: - args["vpc_status"] = field - - field = data.get("public_bandwidth_bps", None) - if field is not None: - args["public_bandwidth_bps"] = field - - field = data.get("commitment", None) - if field is not None: - args["commitment"] = unmarshal_Commitment(field) - else: - args["commitment"] = None - - return Server(**args) - - def unmarshal_ConnectivityDiagnosticServerHealth( data: Any, ) -> ConnectivityDiagnosticServerHealth: diff --git a/scaleway/scaleway/applesilicon/v1alpha1/types.py b/scaleway/scaleway/applesilicon/v1alpha1/types.py index f107199d0..5adbcb259 100644 --- a/scaleway/scaleway/applesilicon/v1alpha1/types.py +++ b/scaleway/scaleway/applesilicon/v1alpha1/types.py @@ -109,6 +109,13 @@ def __str__(self) -> str: return str(self.value) +@dataclass +class Commitment: + type_: CommitmentType + + cancelled: bool + + @dataclass class OS: id: str @@ -193,228 +200,221 @@ class ServerTypeNetwork: @dataclass -class Commitment: - type_: CommitmentType - - cancelled: bool - - -@dataclass -class ConnectivityDiagnosticServerHealth: - is_server_alive: bool - - is_agent_alive: bool - - is_mdm_alive: bool - - is_ssh_port_up: bool - - is_vnc_port_up: bool - - last_checkin_date: Optional[datetime] - - -@dataclass -class ServerPrivateNetwork: +class Server: id: str """ - ID of the Server-to-Private Network mapping. + UUID of the server. """ - project_id: str + type_: str """ - Private Network Project ID. + Type of the server. """ - server_id: str + name: str """ - Apple silicon server ID. + Name of the server. """ - private_network_id: str + project_id: str """ - Private Network ID. + Project this server is associated with. """ - status: ServerPrivateNetworkServerStatus + organization_id: str """ - Configuration status of the Private Network. + Organization this server is associated with. """ - ipam_ip_ids: List[str] + ip: str """ - IPAM IP IDs of the server, if it has any. + IPv4 address of the server. """ - vlan: Optional[int] + vnc_url: str """ - ID of the VLAN associated with the Private Network. + Vnc:// URL to access Apple Remote Desktop. """ - created_at: Optional[datetime] + ssh_username: str """ - Private Network creation date. + SSH Username for remote shell. """ - updated_at: Optional[datetime] + sudo_password: str """ - Date the Private Network was last modified. + Admin password required to execute commands. """ - -@dataclass -class ServerType: - name: str + vnc_port: int """ - Name of the type. + VNC port to use for remote desktop connection. """ - stock: ServerTypeStock + status: ServerStatus """ - Current stock. + Current status of the server. """ - cpu: Optional[ServerTypeCPU] + os: Optional[OS] """ - CPU description. + Initially installed OS, this does not necessarily reflect the current OS version. """ - disk: Optional[ServerTypeDisk] + created_at: Optional[datetime] """ - Size of the local disk of the server. + Date on which the server was created. """ - memory: Optional[ServerTypeMemory] + updated_at: Optional[datetime] """ - Size of memory available. + Date on which the server was last updated. """ - minimum_lease_duration: Optional[str] + deletable_at: Optional[datetime] """ - Minimum duration of the lease in seconds (example. 3.4s). + Date from which the server can be deleted. """ - gpu: Optional[ServerTypeGPU] + deletion_scheduled: bool """ - GPU description. + Set to true to mark the server for automatic deletion depending on `deletable_at` date. Set to false to cancel an existing deletion schedule. Leave unset otherwise. """ - network: Optional[ServerTypeNetwork] + zone: ScwZone """ - Network description. + Zone of the server. """ - default_os: Optional[OS] + delivered: bool """ - The default OS for this server type. + Set to true once the server has completed its provisioning steps and is ready to use. Some OS configurations might require a reinstallation of the server before delivery depending on the available stock. A reinstallation after the initial delivery will not change this flag and can be tracked using the server status. """ - -@dataclass -class Server: - id: str + vpc_status: ServerPrivateNetworkStatus """ - UUID of the server. + Activation status of optional Private Network feature support for this server. """ - type_: str + public_bandwidth_bps: int """ - Type of the server. + Public bandwidth configured for this server. Expressed in bits per second. """ - name: str + commitment: Optional[Commitment] """ - Name of the server. + Commitment scheme applied to this server. """ - project_id: str + +@dataclass +class ConnectivityDiagnosticServerHealth: + is_server_alive: bool + + is_agent_alive: bool + + is_mdm_alive: bool + + is_ssh_port_up: bool + + is_vnc_port_up: bool + + last_checkin_date: Optional[datetime] + + +@dataclass +class ServerPrivateNetwork: + id: str """ - Project this server is associated with. + ID of the Server-to-Private Network mapping. """ - organization_id: str + project_id: str """ - Organization this server is associated with. + Private Network Project ID. """ - ip: str + server_id: str """ - IPv4 address of the server. + Apple silicon server ID. """ - vnc_url: str + private_network_id: str """ - Vnc:// URL to access Apple Remote Desktop. + Private Network ID. """ - ssh_username: str + status: ServerPrivateNetworkServerStatus """ - SSH Username for remote shell. + Configuration status of the Private Network. """ - sudo_password: str + ipam_ip_ids: List[str] """ - Admin password required to execute commands. + IPAM IP IDs of the server, if it has any. """ - vnc_port: int + vlan: Optional[int] """ - VNC port to use for remote desktop connection. + ID of the VLAN associated with the Private Network. """ - status: ServerStatus + created_at: Optional[datetime] """ - Current status of the server. + Private Network creation date. """ - os: Optional[OS] + updated_at: Optional[datetime] """ - Initially installed OS, this does not necessarily reflect the current OS version. + Date the Private Network was last modified. """ - created_at: Optional[datetime] + +@dataclass +class ServerType: + name: str """ - Date on which the server was created. + Name of the type. """ - updated_at: Optional[datetime] + stock: ServerTypeStock """ - Date on which the server was last updated. + Current stock. """ - deletable_at: Optional[datetime] + cpu: Optional[ServerTypeCPU] """ - Date from which the server can be deleted. + CPU description. """ - deletion_scheduled: bool + disk: Optional[ServerTypeDisk] """ - Set to true to mark the server for automatic deletion depending on `deletable_at` date. Set to false to cancel an existing deletion schedule. Leave unset otherwise. + Size of the local disk of the server. """ - zone: ScwZone + memory: Optional[ServerTypeMemory] """ - Zone of the server. + Size of memory available. """ - delivered: bool + minimum_lease_duration: Optional[str] """ - Set to true once the server has completed its provisioning steps and is ready to use. Some OS configurations might require a reinstallation of the server before delivery depending on the available stock. A reinstallation after the initial delivery will not change this flag and can be tracked using the server status. + Minimum duration of the lease in seconds (example. 3.4s). """ - vpc_status: ServerPrivateNetworkStatus + gpu: Optional[ServerTypeGPU] """ - Activation status of optional Private Network feature support for this server. + GPU description. """ - public_bandwidth_bps: int + network: Optional[ServerTypeNetwork] """ - Public bandwidth configured for this server. Expressed in bits per second. + Network description. """ - commitment: Optional[Commitment] + default_os: Optional[OS] """ - Commitment scheme applied to this server. + The default OS for this server type. """