diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b9e496..b6be2b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [9.1.0 - 2023-03-28] + ### Added - Token messages support. +- `deleted_at` field in Server Info respones. + +### Changed + +- Fixes to be compatible with API updates. ## [9.0.0 - 2023-02-08] diff --git a/Makefile b/Makefile index 09ed32e..a3c454b 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ test: $(MAKE) test-pytest test-pytest: - python -m pytest --cov=sporestack --cov-fail-under=40 --cov-report=term --durations=3 --cache-clear + python -m pytest --cov=sporestack --cov-fail-under=39 --cov-report=term --durations=3 --cache-clear build-dist: rm dist/* || true diff --git a/src/sporestack/__init__.py b/src/sporestack/__init__.py index 3c48abf..d677664 100644 --- a/src/sporestack/__init__.py +++ b/src/sporestack/__init__.py @@ -2,4 +2,4 @@ __all__ = ["api", "api_client", "exceptions"] -__version__ = "9.0.0" +__version__ = "9.1.0" diff --git a/src/sporestack/api.py b/src/sporestack/api.py index 61ec952..9a93212 100644 --- a/src/sporestack/api.py +++ b/src/sporestack/api.py @@ -11,7 +11,7 @@ from typing import Dict, List, Optional from pydantic import BaseModel, Field -from .models import Flavor, NetworkInterface, Payment +from .models import Flavor, Payment class TokenAdd: @@ -70,8 +70,6 @@ class ServerLaunch: """null is automatic, otherwise a string region slug.""" token: str """Token to draw from when launching the server.""" - quote: bool = False - """Don't launch, get a quote on how much it would cost""" hostname: str = "" """Hostname to refer to your server by.""" autorenew: bool = False @@ -80,17 +78,6 @@ class ServerLaunch: expiration. """ - class Response(BaseModel): - payment: Payment - """Deprecated, not needed when paying with token. Only used for quote.""" - expiration: int - machine_id: str - created_at: int = 0 - created: bool = False - paid: bool = False - """Deprecated, not needed when paying with token.""" - warning: Optional[str] = None - class ServerTopup: url = "/server/{machine_id}/topup" @@ -100,13 +87,6 @@ class ServerTopup: days: int token: str - class Response(BaseModel): - machine_id: str - expiration: int - paid: bool = True - """Deprecated, not needed when paying with token.""" - warning: Optional[str] = None - class ServerInfo: url = "/server/{machine_id}/info" @@ -123,8 +103,7 @@ class ServerInfo: region: str flavor: Flavor deleted: bool - network_interfaces: List[NetworkInterface] - """Deprecated, use ipv4/ipv6 instead.""" + deleted_at: int operating_system: str hostname: str autorenew: bool @@ -194,7 +173,7 @@ class OperatingSystems: operating_systems: List[str] -class TokenMessageSender(Enum): +class TokenMessageSender(str, Enum): USER = "User" SPORESTACK = "SporeStack"