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