v10.1.1: Fixed `sporestack server operating-systems`
This commit is contained in:
parent
834b1e1e33
commit
a0864e413a
21
CHANGELOG.md
21
CHANGELOG.md
|
@ -5,8 +5,29 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## Deprecated features that will be removed in the next major version.
|
||||||
|
|
||||||
|
- `burn_rate` from `TokenInfo` is deprecated. Use `burn_rate_cents` or `burn_rate_usd` instead.
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
- Nothing yet.
|
||||||
|
|
||||||
|
## [10.2.0 - 2023-04-14]
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- `burn_rate_cents` to `TokenInfo` to replace `burn_rate`.
|
||||||
|
- `burn_rate_usd` to `TokenInfo`.
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- `sporestack token info` will now show burn rate in dollar amount ($0.00) instead of cents.
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- `sporestack server operating-systems` was updated to the new API behavior. (Unfortunately, was a breaking change.)
|
||||||
|
|
||||||
## [10.1.0 - 2023-04-14]
|
## [10.1.0 - 2023-04-14]
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
|
|
@ -47,10 +47,14 @@ sporestack token info realtestingtoken
|
||||||
sporestack token messages realtestingtoken
|
sporestack token messages realtestingtoken
|
||||||
sporestack token servers realtestingtoken
|
sporestack token servers realtestingtoken
|
||||||
|
|
||||||
|
sporestack server list --token realtestingtoken
|
||||||
sporestack server launch --no-quote --token realtestingtoken --operating-system debian-11 --days 1 --hostname sporestackpythonintegrationtestdelme
|
sporestack server launch --no-quote --token realtestingtoken --operating-system debian-11 --days 1 --hostname sporestackpythonintegrationtestdelme
|
||||||
|
sporestack server list --token realtestingtoken | grep sporestackpythonintegrationtestdelme
|
||||||
sporestack server topup --token realtestingtoken --hostname sporestackpythonintegrationtestdelme --days 1
|
sporestack server topup --token realtestingtoken --hostname sporestackpythonintegrationtestdelme --days 1
|
||||||
sporestack server info --token realtestingtoken --hostname sporestackpythonintegrationtestdelme
|
sporestack server info --token realtestingtoken --hostname sporestackpythonintegrationtestdelme
|
||||||
sporestack server json --token realtestingtoken --hostname sporestackpythonintegrationtestdelme
|
sporestack server json --token realtestingtoken --hostname sporestackpythonintegrationtestdelme
|
||||||
|
sporestack server autorenew-enable --token realtestingtoken --hostname sporestackpythonintegrationtestdelme
|
||||||
|
sporestack server autorenew-disable --token realtestingtoken --hostname sporestackpythonintegrationtestdelme
|
||||||
sporestack server start --token realtestingtoken --hostname sporestackpythonintegrationtestdelme
|
sporestack server start --token realtestingtoken --hostname sporestackpythonintegrationtestdelme
|
||||||
sporestack server stop --token realtestingtoken --hostname sporestackpythonintegrationtestdelme
|
sporestack server stop --token realtestingtoken --hostname sporestackpythonintegrationtestdelme
|
||||||
sporestack server rebuild --token realtestingtoken --hostname sporestackpythonintegrationtestdelme
|
sporestack server rebuild --token realtestingtoken --hostname sporestackpythonintegrationtestdelme
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
__all__ = ["api", "api_client", "exceptions"]
|
__all__ = ["api", "api_client", "exceptions"]
|
||||||
|
|
||||||
__version__ = "10.1.0"
|
__version__ = "10.1.1"
|
||||||
|
|
|
@ -11,7 +11,7 @@ from typing import Dict, List, Optional, Union
|
||||||
|
|
||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
from .models import Flavor, Payment
|
from .models import Flavor, OperatingSystem, Payment
|
||||||
|
|
||||||
|
|
||||||
class TokenAdd:
|
class TokenAdd:
|
||||||
|
@ -170,7 +170,7 @@ class OperatingSystems:
|
||||||
method = "GET"
|
method = "GET"
|
||||||
|
|
||||||
class Response(BaseModel):
|
class Response(BaseModel):
|
||||||
operating_systems: List[str]
|
operating_systems: Dict[str, OperatingSystem]
|
||||||
|
|
||||||
|
|
||||||
class TokenMessageSender(str, Enum):
|
class TokenMessageSender(str, Enum):
|
||||||
|
|
|
@ -735,9 +735,7 @@ def token_info(token: str = typer.Argument(DEFAULT_TOKEN)) -> None:
|
||||||
info = client.token.info()
|
info = client.token.info()
|
||||||
typer.echo(f"Balance: {info.balance_usd} ({info.balance_cents} cents)")
|
typer.echo(f"Balance: {info.balance_usd} ({info.balance_cents} cents)")
|
||||||
typer.echo(f"Total servers: {info.servers}")
|
typer.echo(f"Total servers: {info.servers}")
|
||||||
typer.echo(
|
typer.echo(f"Burn rate: {info.burn_rate_usd} per day (of servers set to autorenew)")
|
||||||
f"Burn rate: {info.burn_rate} cents per day (of servers set to autorenew)"
|
|
||||||
)
|
|
||||||
typer.echo(
|
typer.echo(
|
||||||
f"Days remaining: {info.days_remaining} (for servers set to autorenew, "
|
f"Days remaining: {info.days_remaining} (for servers set to autorenew, "
|
||||||
"given the remaining balance)"
|
"given the remaining balance)"
|
||||||
|
|
|
@ -41,9 +41,21 @@ class Flavor(BaseModel):
|
||||||
bandwidth: int
|
bandwidth: int
|
||||||
|
|
||||||
|
|
||||||
|
class OperatingSystem(BaseModel):
|
||||||
|
slug: str
|
||||||
|
"""Unique string to identify the operating system."""
|
||||||
|
minimum_disk: int
|
||||||
|
"""Minimum disk storage required in GiB"""
|
||||||
|
provider_slug: str
|
||||||
|
"""Unique string to identify the operating system."""
|
||||||
|
|
||||||
|
|
||||||
class TokenInfo(BaseModel):
|
class TokenInfo(BaseModel):
|
||||||
balance_cents: int
|
balance_cents: int
|
||||||
balance_usd: str
|
balance_usd: str
|
||||||
burn_rate: int
|
burn_rate: int
|
||||||
|
"""Deprecated."""
|
||||||
|
burn_rate_cents: int
|
||||||
|
burn_rate_usd: str
|
||||||
days_remaining: int
|
days_remaining: int
|
||||||
servers: int
|
servers: int
|
||||||
|
|
Loading…
Reference in New Issue