X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fscripts%2Fosm.py;h=23f6889bc92ea5a2dcccc2a199f5389483eadbb0;hb=refs%2Ftags%2Fv3.0.0rc14;hp=dee931f1e54f4b16ab82aa3a0d5881f1ccd8c6fd;hpb=ef3e9bd9d3aea645aa43461122904ad69a27b2c3;p=osm%2Fosmclient.git diff --git a/osmclient/scripts/osm.py b/osmclient/scripts/osm.py index dee931f..23f6889 100755 --- a/osmclient/scripts/osm.py +++ b/osmclient/scripts/osm.py @@ -36,6 +36,11 @@ import time envvar='OSM_SO_PORT', help='hostname of server. ' + 'Also can set OSM_SO_PORT in environment') +@click.option('--so-project', + default='default', + envvar='OSM_SO_PROJECT', + help='Project Name in SO. ' + + 'Also can set OSM_SO_PROJECT in environment') @click.option('--ro-hostname', default=None, envvar='OSM_RO_HOSTNAME', @@ -47,7 +52,7 @@ import time help='hostname of RO server. ' + 'Also can set OSM_RO_PORT in environment') @click.pass_context -def cli(ctx, hostname, so_port, ro_hostname, ro_port): +def cli(ctx, hostname, so_port, so_project, ro_hostname, ro_port): if hostname is None: print( "either hostname option or OSM_HOSTNAME " + @@ -56,6 +61,7 @@ def cli(ctx, hostname, so_port, ro_hostname, ro_port): ctx.obj = client.Client( host=hostname, so_port=so_port, + so_project=so_project, ro_host=ro_hostname, ro_port=ro_port) @@ -454,9 +460,12 @@ def vim_delete(ctx, name): @cli.command(name='vim-list') +@click.option('--ro_update/--no_ro_update', + default=False, + help='update list from RO') @click.pass_context -def vim_list(ctx): - resp = ctx.obj.vim.list() +def vim_list(ctx, ro_update): + resp = ctx.obj.vim.list(ro_update) table = PrettyTable(['vim name', 'uuid']) for vim in resp: table.add_row([vim['name'], vim['uuid']])