s/ucloud/uncloud/g
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
This commit is contained in:
parent
267828e85a
commit
280043659d
10 changed files with 10 additions and 10 deletions
31
uncloud_cli/commands/image.py
Executable file
31
uncloud_cli/commands/image.py
Executable file
|
|
@ -0,0 +1,31 @@
|
|||
from uncloud_cli.commands.helper import load_dump_pretty
|
||||
from uncloud_cli.config import env_vars
|
||||
from os.path import join as join_path
|
||||
|
||||
import click
|
||||
import requests
|
||||
|
||||
|
||||
@click.group()
|
||||
def image():
|
||||
pass
|
||||
|
||||
|
||||
@image.command("list")
|
||||
@click.option("--public", is_flag=True)
|
||||
def _list(public):
|
||||
if public:
|
||||
r = requests.get(join_path(env_vars.get("UCLOUD_API_SERVER"), "image", "list-public"))
|
||||
print(load_dump_pretty(r.content))
|
||||
|
||||
|
||||
@image.command("create-from-file")
|
||||
@click.option("--name", required=True)
|
||||
@click.option("--uuid", required=True)
|
||||
@click.option("--image-store-name", required=True)
|
||||
def create_from_file(name, uuid, image_store_name):
|
||||
data = {"name": name, "uuid": uuid, "image_store": image_store_name}
|
||||
r = requests.post(
|
||||
join_path(env_vars.get("UCLOUD_API_SERVER"), "image", "create"), json=data
|
||||
)
|
||||
print(load_dump_pretty(r.content))
|
||||
Loading…
Add table
Add a link
Reference in a new issue