X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fscripts%2Fosm.py;h=76daaa42d9bb193b81146c87c12dcadead063f2b;hb=e26c422590219f865d958a8537b8f6c0973ac703;hp=2e65121270de2bc43275799c68f66eddf6ebab23;hpb=1b6c5b581dc29170b0bc81f909a41a322760de9a;p=osm%2Fosmclient.git diff --git a/osmclient/scripts/osm.py b/osmclient/scripts/osm.py index 2e65121..76daaa4 100755 --- a/osmclient/scripts/osm.py +++ b/osmclient/scripts/osm.py @@ -217,12 +217,16 @@ def vnfd_list2(ctx, filter): @cli.command(name='vnf-list') +@click.option('--ns', default=None, help='NS instance id or name to restrict the VNF list') @click.pass_context -def vnf_list(ctx): +def vnf_list(ctx, ns): ''' list all VNF instances''' try: - check_client_version(ctx.obj, ctx.command.name, 'v1') - resp = ctx.obj.vnf.list() + if ns: + check_client_version(ctx.obj, '--ns') + resp = ctx.obj.vnf.list(ns) + else: + resp = ctx.obj.vnf.list() except ClientException as inst: print(inst.message) exit(1) @@ -409,7 +413,7 @@ def vnf_show(ctx, name, literal, filter): NAME: name or ID of the VNF instance ''' try: - check_client_version(ctx.obj, ctx.command.name, 'v1') + check_client_version(ctx.obj, ctx.command.name) resp = ctx.obj.vnf.get(name) except ClientException as inst: print(inst.message)