diff --git a/CHANGELOG.md b/CHANGELOG.md index ae4383d..17b3c6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [7.3.0 - 2022-11-28] + +### Fixed + +- Fixed broken `sporestack server topup` after API changes. + ## [7.2.1 - 2022-11-01] ### Changed diff --git a/src/sporestack/__init__.py b/src/sporestack/__init__.py index 700bdbf..c7b84b0 100644 --- a/src/sporestack/__init__.py +++ b/src/sporestack/__init__.py @@ -2,4 +2,4 @@ __all__ = ["api", "api_client", "exceptions"] -__version__ = "7.2.1" +__version__ = "7.3.0" diff --git a/src/sporestack/api.py b/src/sporestack/api.py index 8b2defe..48483f1 100644 --- a/src/sporestack/api.py +++ b/src/sporestack/api.py @@ -51,7 +51,6 @@ class ServerLaunch: """Token to draw from when launching the server.""" quote: bool = False """Don't launch, get a quote on how much it would cost""" - affiliate_token: Optional[str] = None hostname: str = "" """Hostname to refer to your server by.""" autorenew: bool = False @@ -65,17 +64,11 @@ class ServerLaunch: """Deprecated, not needed when paying with token. Only used for quote.""" expiration: int machine_id: str - network_interfaces: List[NetworkInterface] = [] - """Deprecated, use ipv4/ipv6 from ServerInfo instead.""" created_at: int = 0 - region: Optional[str] = None - """Deprecated, use ServerInfo instead.""" created: bool = False paid: bool = False """Deprecated, not needed when paying with token.""" warning: Optional[str] = None - flavor: str = "" - """Deprecated, use ServerInfo instead.""" class ServerTopup: @@ -85,15 +78,11 @@ class ServerTopup: class Request(BaseModel): days: int token: str - quote: bool = False - affiliate_token: Optional[str] = None class Response(BaseModel): machine_id: str - payment: Payment - """Deprecated, not needed when paying with token.""" expiration: int - paid: bool = False + paid: bool = True """Deprecated, not needed when paying with token.""" warning: Optional[str] = None diff --git a/src/sporestack/api_client.py b/src/sporestack/api_client.py index d171c88..932b5a8 100644 --- a/src/sporestack/api_client.py +++ b/src/sporestack/api_client.py @@ -140,7 +140,6 @@ def launch( api_endpoint: str = API_ENDPOINT, region: Optional[str] = None, retry: bool = False, - affiliate_token: Optional[str] = None, quote: bool = False, hostname: str = "", autorenew: bool = False, @@ -148,7 +147,6 @@ def launch( request = api.ServerLaunch.Request( days=days, token=token, - affiliate_token=affiliate_token, flavor=flavor, region=region, operating_system=operating_system, @@ -170,18 +168,11 @@ def topup( token: str, api_endpoint: str = API_ENDPOINT, retry: bool = False, - affiliate_token: Optional[str] = None, - quote: bool = False, ) -> api.ServerTopup.Response: """ Topup a server. """ - request = api.ServerTopup.Request( - days=days, - token=token, - affiliate_token=affiliate_token, - quote=quote, - ) + request = api.ServerTopup.Request(days=days, token=token) url = api_endpoint + api.ServerTopup.url.format(machine_id=machine_id) response = _api_request(url=url, json_params=request.dict(), retry=retry) response_object = api.ServerTopup.Response.parse_obj(response) diff --git a/src/sporestack/cli.py b/src/sporestack/cli.py index 0a6aad9..f675991 100644 --- a/src/sporestack/cli.py +++ b/src/sporestack/cli.py @@ -223,7 +223,6 @@ def topup( token=_token, retry=True, ) - assert response.payment.paid is True typer.echo(response.expiration)