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]
## [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]

View File

@ -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

View File

@ -2,4 +2,4 @@
__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 .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"