47 lines
989 B
Python
Executable file
47 lines
989 B
Python
Executable file
import click
|
|
from uncloud_cli.commands.helper import add_otp_options, make_request
|
|
|
|
|
|
@click.group()
|
|
def user():
|
|
pass
|
|
|
|
|
|
@user.command('files')
|
|
@add_otp_options
|
|
def list_files(**kwargs):
|
|
make_request('user', 'files', data=kwargs)
|
|
|
|
|
|
@user.command('vms')
|
|
@add_otp_options
|
|
def list_vms(**kwargs):
|
|
make_request('user', 'vms', data=kwargs)
|
|
|
|
|
|
@user.command('networks')
|
|
@add_otp_options
|
|
def list_networks(**kwargs):
|
|
make_request('user', 'network', data=kwargs)
|
|
|
|
|
|
@user.command('add-ssh')
|
|
@add_otp_options
|
|
@click.option('--key-name', required=True)
|
|
@click.option('--key', required=True)
|
|
def add_ssh(**kwargs):
|
|
make_request('user', 'add-ssh', data=kwargs)
|
|
|
|
|
|
@user.command('remove-ssh')
|
|
@add_otp_options
|
|
@click.option('--key-name', required=True)
|
|
def remove_ssh(**kwargs):
|
|
make_request('user', 'remove-ssh', data=kwargs)
|
|
|
|
|
|
@user.command('get-ssh')
|
|
@add_otp_options
|
|
@click.option('--key-name', default='')
|
|
def get_ssh(**kwargs):
|
|
make_request('user', 'get-ssh', data=kwargs)
|