25 lines
557 B
Python
Executable File
25 lines
557 B
Python
Executable File
import click
|
|
import requests
|
|
|
|
from uncloud_cli.commands.helper import make_request
|
|
|
|
|
|
@click.group()
|
|
def image():
|
|
pass
|
|
|
|
|
|
@image.command("list")
|
|
@click.option("--public", is_flag=True)
|
|
def _list(public):
|
|
if public:
|
|
make_request('image', 'list-public', request_method=requests.get)
|
|
|
|
|
|
@image.command("create-from-file")
|
|
@click.option("--name", required=True)
|
|
@click.option("--uuid", required=True)
|
|
@click.option("--image-store-name", 'image_store', required=True)
|
|
def create_from_file(**kwargs):
|
|
make_request('image', 'create', data=kwargs)
|