diff --git a/scaleway-async/scaleway_async/applesilicon/v1alpha1/api.py b/scaleway-async/scaleway_async/applesilicon/v1alpha1/api.py index 15711479a..07d5ce076 100644 --- a/scaleway-async/scaleway_async/applesilicon/v1alpha1/api.py +++ b/scaleway-async/scaleway_async/applesilicon/v1alpha1/api.py @@ -131,6 +131,7 @@ async def create_server( *, type_: str, enable_vpc: bool, + public_bandwidth_bps: int, zone: Optional[ScwZone] = None, name: Optional[str] = None, project_id: Optional[str] = None, @@ -142,6 +143,7 @@ async def create_server( Create a new server in the targeted zone, specifying its configuration including name and type. :param type_: Create a server of the given type. :param enable_vpc: Activate the Private Network feature for this server. This feature is configured through the Apple Silicon - Private Networks API. + :param public_bandwidth_bps: Public bandwidth to configure for this server. This defaults to the minimum bandwidth for this server type. For compatible server types, the bandwidth can be increased which incurs additional costs. :param zone: Zone to target. If none is passed will use default zone from the config. :param name: Create a server with this given name. :param project_id: Create a server in the given project ID. @@ -155,6 +157,7 @@ async def create_server( result = await api.create_server( type="example", enable_vpc=False, + public_bandwidth_bps=1, ) """ @@ -167,6 +170,7 @@ async def create_server( CreateServerRequest( type_=type_, enable_vpc=enable_vpc, + public_bandwidth_bps=public_bandwidth_bps, zone=zone, name=name or random_name(prefix="as"), project_id=project_id, @@ -455,6 +459,7 @@ async def update_server( schedule_deletion: Optional[bool] = None, enable_vpc: Optional[bool] = None, commitment_type: Optional[CommitmentTypeValue] = None, + public_bandwidth_bps: Optional[int] = None, ) -> Server: """ Update a server. @@ -465,6 +470,7 @@ async def update_server( :param schedule_deletion: Specify whether the server should be flagged for automatic deletion. :param enable_vpc: Activate or deactivate Private Network support for this server. :param commitment_type: Change commitment. Use 'none' to automatically cancel a renewing commitment. + :param public_bandwidth_bps: Public bandwidth to configure for this server. Setting an higher bandwidth incurs additional costs. Supported bandwidth levels depends on server type and can be queried using the `/server-types` endpoint. :return: :class:`Server ` Usage: @@ -489,6 +495,7 @@ async def update_server( schedule_deletion=schedule_deletion, enable_vpc=enable_vpc, commitment_type=commitment_type, + public_bandwidth_bps=public_bandwidth_bps, ), self.client, ), diff --git a/scaleway-async/scaleway_async/applesilicon/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/applesilicon/v1alpha1/marshalling.py index be75811b6..08cc96238 100644 --- a/scaleway-async/scaleway_async/applesilicon/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/applesilicon/v1alpha1/marshalling.py @@ -223,6 +223,10 @@ def unmarshal_ServerTypeNetwork(data: Any) -> ServerTypeNetwork: if field is not None: args["public_bandwidth_bps"] = field + field = data.get("supported_bandwidth", None) + if field is not None: + args["supported_bandwidth"] = field + return ServerTypeNetwork(**args) @@ -400,6 +404,10 @@ def unmarshal_Server(data: Any) -> Server: 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) @@ -623,6 +631,9 @@ def marshal_CreateServerRequest( if request.enable_vpc is not None: output["enable_vpc"] = request.enable_vpc + if request.public_bandwidth_bps is not None: + output["public_bandwidth_bps"] = request.public_bandwidth_bps + if request.name is not None: output["name"] = request.name @@ -723,4 +734,7 @@ def marshal_UpdateServerRequest( request.commitment_type, defaults ) + if request.public_bandwidth_bps is not None: + output["public_bandwidth_bps"] = request.public_bandwidth_bps + return output diff --git a/scaleway-async/scaleway_async/applesilicon/v1alpha1/types.py b/scaleway-async/scaleway_async/applesilicon/v1alpha1/types.py index 692f3e59d..f107199d0 100644 --- a/scaleway-async/scaleway_async/applesilicon/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/applesilicon/v1alpha1/types.py @@ -189,6 +189,8 @@ class ServerTypeMemory: class ServerTypeNetwork: public_bandwidth_bps: int + supported_bandwidth: List[int] + @dataclass class Commitment: @@ -405,6 +407,11 @@ class Server: Activation status of optional Private Network feature support for this server. """ + public_bandwidth_bps: int + """ + Public bandwidth configured for this server. Expressed in bits per second. + """ + commitment: Optional[Commitment] """ Commitment scheme applied to this server. @@ -443,6 +450,11 @@ class CreateServerRequest: Activate the Private Network feature for this server. This feature is configured through the Apple Silicon - Private Networks API. """ + public_bandwidth_bps: int + """ + Public bandwidth to configure for this server. This defaults to the minimum bandwidth for this server type. For compatible server types, the bandwidth can be increased which incurs additional costs. + """ + zone: Optional[ScwZone] """ Zone to target. If none is passed will use default zone from the config. @@ -842,3 +854,8 @@ class UpdateServerRequest: """ Change commitment. Use 'none' to automatically cancel a renewing commitment. """ + + public_bandwidth_bps: Optional[int] + """ + Public bandwidth to configure for this server. Setting an higher bandwidth incurs additional costs. Supported bandwidth levels depends on server type and can be queried using the `/server-types` endpoint. + """ diff --git a/scaleway/scaleway/applesilicon/v1alpha1/api.py b/scaleway/scaleway/applesilicon/v1alpha1/api.py index 8a0fc312e..809526ad6 100644 --- a/scaleway/scaleway/applesilicon/v1alpha1/api.py +++ b/scaleway/scaleway/applesilicon/v1alpha1/api.py @@ -131,6 +131,7 @@ def create_server( *, type_: str, enable_vpc: bool, + public_bandwidth_bps: int, zone: Optional[ScwZone] = None, name: Optional[str] = None, project_id: Optional[str] = None, @@ -142,6 +143,7 @@ def create_server( Create a new server in the targeted zone, specifying its configuration including name and type. :param type_: Create a server of the given type. :param enable_vpc: Activate the Private Network feature for this server. This feature is configured through the Apple Silicon - Private Networks API. + :param public_bandwidth_bps: Public bandwidth to configure for this server. This defaults to the minimum bandwidth for this server type. For compatible server types, the bandwidth can be increased which incurs additional costs. :param zone: Zone to target. If none is passed will use default zone from the config. :param name: Create a server with this given name. :param project_id: Create a server in the given project ID. @@ -155,6 +157,7 @@ def create_server( result = api.create_server( type="example", enable_vpc=False, + public_bandwidth_bps=1, ) """ @@ -167,6 +170,7 @@ def create_server( CreateServerRequest( type_=type_, enable_vpc=enable_vpc, + public_bandwidth_bps=public_bandwidth_bps, zone=zone, name=name or random_name(prefix="as"), project_id=project_id, @@ -455,6 +459,7 @@ def update_server( schedule_deletion: Optional[bool] = None, enable_vpc: Optional[bool] = None, commitment_type: Optional[CommitmentTypeValue] = None, + public_bandwidth_bps: Optional[int] = None, ) -> Server: """ Update a server. @@ -465,6 +470,7 @@ def update_server( :param schedule_deletion: Specify whether the server should be flagged for automatic deletion. :param enable_vpc: Activate or deactivate Private Network support for this server. :param commitment_type: Change commitment. Use 'none' to automatically cancel a renewing commitment. + :param public_bandwidth_bps: Public bandwidth to configure for this server. Setting an higher bandwidth incurs additional costs. Supported bandwidth levels depends on server type and can be queried using the `/server-types` endpoint. :return: :class:`Server ` Usage: @@ -489,6 +495,7 @@ def update_server( schedule_deletion=schedule_deletion, enable_vpc=enable_vpc, commitment_type=commitment_type, + public_bandwidth_bps=public_bandwidth_bps, ), self.client, ), diff --git a/scaleway/scaleway/applesilicon/v1alpha1/marshalling.py b/scaleway/scaleway/applesilicon/v1alpha1/marshalling.py index be75811b6..08cc96238 100644 --- a/scaleway/scaleway/applesilicon/v1alpha1/marshalling.py +++ b/scaleway/scaleway/applesilicon/v1alpha1/marshalling.py @@ -223,6 +223,10 @@ def unmarshal_ServerTypeNetwork(data: Any) -> ServerTypeNetwork: if field is not None: args["public_bandwidth_bps"] = field + field = data.get("supported_bandwidth", None) + if field is not None: + args["supported_bandwidth"] = field + return ServerTypeNetwork(**args) @@ -400,6 +404,10 @@ def unmarshal_Server(data: Any) -> Server: 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) @@ -623,6 +631,9 @@ def marshal_CreateServerRequest( if request.enable_vpc is not None: output["enable_vpc"] = request.enable_vpc + if request.public_bandwidth_bps is not None: + output["public_bandwidth_bps"] = request.public_bandwidth_bps + if request.name is not None: output["name"] = request.name @@ -723,4 +734,7 @@ def marshal_UpdateServerRequest( request.commitment_type, defaults ) + if request.public_bandwidth_bps is not None: + output["public_bandwidth_bps"] = request.public_bandwidth_bps + return output diff --git a/scaleway/scaleway/applesilicon/v1alpha1/types.py b/scaleway/scaleway/applesilicon/v1alpha1/types.py index 692f3e59d..f107199d0 100644 --- a/scaleway/scaleway/applesilicon/v1alpha1/types.py +++ b/scaleway/scaleway/applesilicon/v1alpha1/types.py @@ -189,6 +189,8 @@ class ServerTypeMemory: class ServerTypeNetwork: public_bandwidth_bps: int + supported_bandwidth: List[int] + @dataclass class Commitment: @@ -405,6 +407,11 @@ class Server: Activation status of optional Private Network feature support for this server. """ + public_bandwidth_bps: int + """ + Public bandwidth configured for this server. Expressed in bits per second. + """ + commitment: Optional[Commitment] """ Commitment scheme applied to this server. @@ -443,6 +450,11 @@ class CreateServerRequest: Activate the Private Network feature for this server. This feature is configured through the Apple Silicon - Private Networks API. """ + public_bandwidth_bps: int + """ + Public bandwidth to configure for this server. This defaults to the minimum bandwidth for this server type. For compatible server types, the bandwidth can be increased which incurs additional costs. + """ + zone: Optional[ScwZone] """ Zone to target. If none is passed will use default zone from the config. @@ -842,3 +854,8 @@ class UpdateServerRequest: """ Change commitment. Use 'none' to automatically cancel a renewing commitment. """ + + public_bandwidth_bps: Optional[int] + """ + Public bandwidth to configure for this server. Setting an higher bandwidth incurs additional costs. Supported bandwidth levels depends on server type and can be queried using the `/server-types` endpoint. + """