|
|
|
@ -157,7 +157,6 @@ def launch(
|
|
|
|
|
input("[Press ctrl+c to cancel, or enter to accept.]")
|
|
|
|
|
|
|
|
|
|
if autorenew:
|
|
|
|
|
typer.echo("Autorenew is a BETA feature!!!", err=True)
|
|
|
|
|
typer.echo(
|
|
|
|
|
"Server will be automatically renewed (from this token) to one week of expiration.", # noqa: E501
|
|
|
|
|
err=True,
|
|
|
|
@ -346,6 +345,8 @@ def server_list(
|
|
|
|
|
typer.echo(f"Running: {info.running}")
|
|
|
|
|
typer.echo(f"Region: {info.region}")
|
|
|
|
|
typer.echo(f"Flavor: {info.flavor.slug}")
|
|
|
|
|
typer.echo(f"Token: {info.token}")
|
|
|
|
|
typer.echo(f"Autorenew: {info.autorenew}")
|
|
|
|
|
human_expiration = time.strftime(
|
|
|
|
|
"%Y-%m-%d %H:%M:%S %z", time.localtime(info.expiration)
|
|
|
|
|
)
|
|
|
|
@ -454,6 +455,30 @@ def stop(hostname: str = "", machine_id: str = "", token: str = DEFAULT_TOKEN) -
|
|
|
|
|
typer.echo(f"{hostname} stopped.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@server_cli.command()
|
|
|
|
|
def autorenew_enable(
|
|
|
|
|
hostname: str = "", machine_id: str = "", token: str = DEFAULT_TOKEN
|
|
|
|
|
) -> None:
|
|
|
|
|
"""
|
|
|
|
|
Enable autorenew on a server.
|
|
|
|
|
"""
|
|
|
|
|
machine_id = _get_machine_id(machine_id=machine_id, hostname=hostname, token=token)
|
|
|
|
|
api_client.autorenew_enable(machine_id=machine_id, api_endpoint=get_api_endpoint())
|
|
|
|
|
typer.echo("Autorenew enabled.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@server_cli.command()
|
|
|
|
|
def autorenew_disable(
|
|
|
|
|
hostname: str = "", machine_id: str = "", token: str = DEFAULT_TOKEN
|
|
|
|
|
) -> None:
|
|
|
|
|
"""
|
|
|
|
|
Disable autorenew on a server.
|
|
|
|
|
"""
|
|
|
|
|
machine_id = _get_machine_id(machine_id=machine_id, hostname=hostname, token=token)
|
|
|
|
|
api_client.autorenew_disable(machine_id=machine_id, api_endpoint=get_api_endpoint())
|
|
|
|
|
typer.echo("Autorenew disabled.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@server_cli.command()
|
|
|
|
|
def destroy(
|
|
|
|
|
hostname: str = "", machine_id: str = "", token: str = DEFAULT_TOKEN
|
|
|
|
|