diff --git a/scaleway-async/scaleway_async/vpcgw/v1/api.py b/scaleway-async/scaleway_async/vpcgw/v1/api.py index 55cc50103..f4a0b33ed 100644 --- a/scaleway-async/scaleway_async/vpcgw/v1/api.py +++ b/scaleway-async/scaleway_async/vpcgw/v1/api.py @@ -58,6 +58,7 @@ UpdateGatewayRequest, UpdateIPRequest, UpdatePATRuleRequest, + UpgradeGatewayRequest, ) from .content import ( GATEWAY_NETWORK_TRANSIENT_STATUSES, @@ -93,6 +94,7 @@ marshal_UpdateGatewayRequest, marshal_UpdateIPRequest, marshal_UpdatePATRuleRequest, + marshal_UpgradeGatewayRequest, ) @@ -448,12 +450,14 @@ async def upgrade_gateway( *, gateway_id: str, zone: Optional[Zone] = None, + type_: Optional[str] = None, ) -> Gateway: """ - Upgrade a Public Gateway to the latest version. - Upgrade a given Public Gateway to the newest software version. This applies the latest bugfixes and features to your Public Gateway, but its service will be interrupted during the update. + Upgrade a Public Gateway to the latest version and/or to a different commercial offer type. + Upgrade a given Public Gateway to the newest software version or to a different commercial offer type. This applies the latest bugfixes and features to your Public Gateway. Note that gateway service will be interrupted during the update. :param gateway_id: ID of the gateway to upgrade. :param zone: Zone to target. If none is passed will use default zone from the config. + :param type_: Gateway type (commercial offer). :return: :class:`Gateway ` Usage: @@ -470,7 +474,14 @@ async def upgrade_gateway( res = self._request( "POST", f"/vpc-gw/v1/zones/{param_zone}/gateways/{param_gateway_id}/upgrade", - body={}, + body=marshal_UpgradeGatewayRequest( + UpgradeGatewayRequest( + gateway_id=gateway_id, + zone=zone, + type_=type_, + ), + self.client, + ), ) self._throw_on_error(res) diff --git a/scaleway-async/scaleway_async/vpcgw/v1/marshalling.py b/scaleway-async/scaleway_async/vpcgw/v1/marshalling.py index a30639886..ef34334dc 100644 --- a/scaleway-async/scaleway_async/vpcgw/v1/marshalling.py +++ b/scaleway-async/scaleway_async/vpcgw/v1/marshalling.py @@ -45,6 +45,7 @@ UpdateGatewayRequest, UpdateIPRequest, UpdatePATRuleRequest, + UpgradeGatewayRequest, ) @@ -1127,3 +1128,15 @@ def marshal_UpdatePATRuleRequest( output["protocol"] = str(request.protocol) return output + + +def marshal_UpgradeGatewayRequest( + request: UpgradeGatewayRequest, + defaults: ProfileDefaults, +) -> Dict[str, Any]: + output: Dict[str, Any] = {} + + if request.type_ is not None: + output["type"] = request.type_ + + return output diff --git a/scaleway-async/scaleway_async/vpcgw/v1/types.py b/scaleway-async/scaleway_async/vpcgw/v1/types.py index 3fa4fd587..d0a4f4fcf 100644 --- a/scaleway-async/scaleway_async/vpcgw/v1/types.py +++ b/scaleway-async/scaleway_async/vpcgw/v1/types.py @@ -1746,3 +1746,8 @@ class UpgradeGatewayRequest: """ Zone to target. If none is passed will use default zone from the config. """ + + type_: Optional[str] + """ + Gateway type (commercial offer). + """ diff --git a/scaleway/scaleway/vpcgw/v1/api.py b/scaleway/scaleway/vpcgw/v1/api.py index 04ddb1828..da3adb3e4 100644 --- a/scaleway/scaleway/vpcgw/v1/api.py +++ b/scaleway/scaleway/vpcgw/v1/api.py @@ -58,6 +58,7 @@ UpdateGatewayRequest, UpdateIPRequest, UpdatePATRuleRequest, + UpgradeGatewayRequest, ) from .content import ( GATEWAY_NETWORK_TRANSIENT_STATUSES, @@ -93,6 +94,7 @@ marshal_UpdateGatewayRequest, marshal_UpdateIPRequest, marshal_UpdatePATRuleRequest, + marshal_UpgradeGatewayRequest, ) @@ -448,12 +450,14 @@ def upgrade_gateway( *, gateway_id: str, zone: Optional[Zone] = None, + type_: Optional[str] = None, ) -> Gateway: """ - Upgrade a Public Gateway to the latest version. - Upgrade a given Public Gateway to the newest software version. This applies the latest bugfixes and features to your Public Gateway, but its service will be interrupted during the update. + Upgrade a Public Gateway to the latest version and/or to a different commercial offer type. + Upgrade a given Public Gateway to the newest software version or to a different commercial offer type. This applies the latest bugfixes and features to your Public Gateway. Note that gateway service will be interrupted during the update. :param gateway_id: ID of the gateway to upgrade. :param zone: Zone to target. If none is passed will use default zone from the config. + :param type_: Gateway type (commercial offer). :return: :class:`Gateway ` Usage: @@ -470,7 +474,14 @@ def upgrade_gateway( res = self._request( "POST", f"/vpc-gw/v1/zones/{param_zone}/gateways/{param_gateway_id}/upgrade", - body={}, + body=marshal_UpgradeGatewayRequest( + UpgradeGatewayRequest( + gateway_id=gateway_id, + zone=zone, + type_=type_, + ), + self.client, + ), ) self._throw_on_error(res) diff --git a/scaleway/scaleway/vpcgw/v1/marshalling.py b/scaleway/scaleway/vpcgw/v1/marshalling.py index a30639886..ef34334dc 100644 --- a/scaleway/scaleway/vpcgw/v1/marshalling.py +++ b/scaleway/scaleway/vpcgw/v1/marshalling.py @@ -45,6 +45,7 @@ UpdateGatewayRequest, UpdateIPRequest, UpdatePATRuleRequest, + UpgradeGatewayRequest, ) @@ -1127,3 +1128,15 @@ def marshal_UpdatePATRuleRequest( output["protocol"] = str(request.protocol) return output + + +def marshal_UpgradeGatewayRequest( + request: UpgradeGatewayRequest, + defaults: ProfileDefaults, +) -> Dict[str, Any]: + output: Dict[str, Any] = {} + + if request.type_ is not None: + output["type"] = request.type_ + + return output diff --git a/scaleway/scaleway/vpcgw/v1/types.py b/scaleway/scaleway/vpcgw/v1/types.py index 3fa4fd587..d0a4f4fcf 100644 --- a/scaleway/scaleway/vpcgw/v1/types.py +++ b/scaleway/scaleway/vpcgw/v1/types.py @@ -1746,3 +1746,8 @@ class UpgradeGatewayRequest: """ Zone to target. If none is passed will use default zone from the config. """ + + type_: Optional[str] + """ + Gateway type (commercial offer). + """