9.1.0: Messaging and fixes for API changes

This commit is contained in:
Administrator 2023-03-29 01:51:06 +00:00
parent b4705c3634
commit f70a1f65b0
4 changed files with 12 additions and 26 deletions

View File

@ -7,9 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
## [9.1.0 - 2023-03-28]
### Added ### Added
- Token messages support. - Token messages support.
- `deleted_at` field in Server Info respones.
### Changed
- Fixes to be compatible with API updates.
## [9.0.0 - 2023-02-08] ## [9.0.0 - 2023-02-08]

View File

@ -9,7 +9,7 @@ test:
$(MAKE) test-pytest $(MAKE) test-pytest
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: build-dist:
rm dist/* || true rm dist/* || true

View File

@ -2,4 +2,4 @@
__all__ = ["api", "api_client", "exceptions"] __all__ = ["api", "api_client", "exceptions"]
__version__ = "9.0.0" __version__ = "9.1.0"

View File

@ -11,7 +11,7 @@ from typing import Dict, List, Optional
from pydantic import BaseModel, Field from pydantic import BaseModel, Field
from .models import Flavor, NetworkInterface, Payment from .models import Flavor, Payment
class TokenAdd: class TokenAdd:
@ -70,8 +70,6 @@ class ServerLaunch:
"""null is automatic, otherwise a string region slug.""" """null is automatic, otherwise a string region slug."""
token: str token: str
"""Token to draw from when launching the server.""" """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: str = ""
"""Hostname to refer to your server by.""" """Hostname to refer to your server by."""
autorenew: bool = False autorenew: bool = False
@ -80,17 +78,6 @@ class ServerLaunch:
expiration. 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: class ServerTopup:
url = "/server/{machine_id}/topup" url = "/server/{machine_id}/topup"
@ -100,13 +87,6 @@ class ServerTopup:
days: int days: int
token: str 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: class ServerInfo:
url = "/server/{machine_id}/info" url = "/server/{machine_id}/info"
@ -123,8 +103,7 @@ class ServerInfo:
region: str region: str
flavor: Flavor flavor: Flavor
deleted: bool deleted: bool
network_interfaces: List[NetworkInterface] deleted_at: int
"""Deprecated, use ipv4/ipv6 instead."""
operating_system: str operating_system: str
hostname: str hostname: str
autorenew: bool autorenew: bool
@ -194,7 +173,7 @@ class OperatingSystems:
operating_systems: List[str] operating_systems: List[str]
class TokenMessageSender(Enum): class TokenMessageSender(str, Enum):
USER = "User" USER = "User"
SPORESTACK = "SporeStack" SPORESTACK = "SporeStack"