Added '--raw' option to vds stop
This commit is contained in:
parent
2446a74b76
commit
94953ccf16
12
twvdscli.py
12
twvdscli.py
@ -544,18 +544,26 @@ def vds_start(vds_id: Optional[int] = typer.Argument(None), raw: bool = typer.Op
|
|||||||
|
|
||||||
|
|
||||||
@servers_app.command("stop")
|
@servers_app.command("stop")
|
||||||
def vds_stop(vds_id: Optional[int] = typer.Argument(None)):
|
def vds_stop(vds_id: Optional[int] = typer.Argument(None), raw: bool = typer.Option(False, help="Get result as raw json")):
|
||||||
"""
|
"""
|
||||||
Stop VDS
|
Stop VDS
|
||||||
"""
|
"""
|
||||||
if vds_id is None:
|
if vds_id is None:
|
||||||
|
if raw:
|
||||||
|
print(
|
||||||
|
dict(
|
||||||
|
error="No VDS ID provided"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return 1
|
||||||
vds_list()
|
vds_list()
|
||||||
vds_id = input("Enter VDS ID: ")
|
vds_id = input("Enter VDS ID: ")
|
||||||
result = Server.stop(vds_id)
|
result = Server.stop(vds_id)
|
||||||
if result is None:
|
if result is None:
|
||||||
print(typer.style("Error", fg=typer.colors.RED))
|
print(typer.style("Error", fg=typer.colors.RED))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
if raw:
|
||||||
|
print(result)
|
||||||
for frame in cycle(r'-\|/'):
|
for frame in cycle(r'-\|/'):
|
||||||
state = Server.get_vds(vds_id)
|
state = Server.get_vds(vds_id)
|
||||||
if state:
|
if state:
|
||||||
|
Loading…
Reference in New Issue
Block a user