2019-07-17 19:58:39 +05:00
|
|
|
import click
|
2019-12-31 19:54:08 +05:00
|
|
|
from uncloud_cli.commands.helper import add_otp_options, make_request
|
2019-07-17 19:58:39 +05:00
|
|
|
|
|
|
|
|
|
|
|
@click.group()
|
|
|
|
def user():
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2019-12-31 20:18:14 +05:00
|
|
|
@user.command('files')
|
2019-12-31 19:54:08 +05:00
|
|
|
@add_otp_options
|
|
|
|
def list_files(**kwargs):
|
|
|
|
make_request('user', 'files', data=kwargs)
|
2019-07-17 19:58:39 +05:00
|
|
|
|
|
|
|
|
2019-12-31 20:18:14 +05:00
|
|
|
@user.command('vms')
|
2019-12-31 19:54:08 +05:00
|
|
|
@add_otp_options
|
|
|
|
def list_vms(**kwargs):
|
|
|
|
make_request('user', 'vms', data=kwargs)
|
2019-11-11 19:49:35 +01:00
|
|
|
|
|
|
|
|
2019-12-31 20:18:14 +05:00
|
|
|
@user.command('networks')
|
2019-12-31 19:54:08 +05:00
|
|
|
@add_otp_options
|
|
|
|
def list_networks(**kwargs):
|
|
|
|
make_request('user', 'network', data=kwargs)
|
2019-11-11 19:49:35 +01:00
|
|
|
|
|
|
|
|
2019-12-31 20:18:14 +05:00
|
|
|
@user.command('add-ssh')
|
2019-12-31 19:54:08 +05:00
|
|
|
@add_otp_options
|
2019-12-31 20:18:14 +05:00
|
|
|
@click.option('--key-name', required=True)
|
|
|
|
@click.option('--key', required=True)
|
2019-12-31 19:54:08 +05:00
|
|
|
def add_ssh(**kwargs):
|
|
|
|
make_request('user', 'add-ssh', data=kwargs)
|
2019-11-11 19:49:35 +01:00
|
|
|
|
|
|
|
|
2019-12-31 20:18:14 +05:00
|
|
|
@user.command('remove-ssh')
|
2019-12-31 19:54:08 +05:00
|
|
|
@add_otp_options
|
2019-12-31 20:18:14 +05:00
|
|
|
@click.option('--key-name', required=True)
|
2019-12-31 19:54:08 +05:00
|
|
|
def remove_ssh(**kwargs):
|
|
|
|
make_request('user', 'remove-ssh', data=kwargs)
|
2019-11-11 19:49:35 +01:00
|
|
|
|
2019-11-17 23:54:39 +05:00
|
|
|
|
2019-12-31 20:18:14 +05:00
|
|
|
@user.command('get-ssh')
|
2019-12-31 19:54:08 +05:00
|
|
|
@add_otp_options
|
2019-12-31 20:18:14 +05:00
|
|
|
@click.option('--key-name', default='')
|
2019-12-31 19:54:08 +05:00
|
|
|
def get_ssh(**kwargs):
|
|
|
|
make_request('user', 'get-ssh', data=kwargs)
|