uncloud-cli/uncloud_cli/commands/image.py
2019-12-31 20:18:14 +05:00

24 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)