:raises ClientError: if the specified version does not match the client version
'''
fullclassname = obj.__module__ + "." + obj.__class__.__name__
- message = 'the following commands or options are only supported with the option "--sol005": {}'.format(what)
+ message = 'The following commands or options are only supported with the option "--sol005": {}'.format(what)
if version == 'v1':
- message = 'the following commands or options are not supported when using option "--sol005": {}'.format(what)
+ message = 'The following commands or options are not supported when using option "--sol005": {}'.format(what)
if fullclassname != 'osmclient.{}.client.Client'.format(version):
raise ClientException(message)
return
def ns_list(ctx, filter):
'''list all NS instances'''
if filter:
- check_client_version(ctx.obj, '--filter option')
+ check_client_version(ctx.obj, '--filter')
resp = ctx.obj.ns.list(filter)
else:
resp = ctx.obj.ns.list()
fullclassname = ctx.obj.__module__ + "." + ctx.obj.__class__.__name__
if fullclassname == 'osmclient.sol005.client.Client':
nsr = ns
+ nsr_name = nsr['name']
+ nsr_id = nsr['_id']
else:
nsopdata = ctx.obj.ns.get_opdata(ns['id'])
nsr = nsopdata['nsr:nsr']
+ nsr_name = nsr['name-ref']
+ nsr_id = nsr['ns-instance-config-ref']
opstatus = nsr['operational-status'] if 'operational-status' in nsr else 'Not found'
configstatus = nsr['config-status'] if 'config-status' in nsr else 'Not found'
if configstatus == "config_not_needed":
configstatus = "configured (no charms)"
table.add_row(
- [nsr['name'],
- nsr['_id'],
+ [nsr_name,
+ nsr_id,
opstatus,
configstatus])
table.align = 'l'
help='comma separated list of keys to inject to vnfs')
@click.option('--config',
default=None,
- help='ns specific yaml configuration')
+ help='ns specific yaml configuration:\nvnf: [member-vnf-index: TEXT, vim_account: TEXT]\n'
+ 'vld: [name: TEXT, vim-network-name: TEXT or DICT with vim_account, vim_net entries]')
@click.pass_context
def ns_create(ctx,
nsd_name,
config):
'''creates a new NS instance'''
try:
- if config:
- check_client_version(ctx.obj, '--config', 'v1')
+ # if config:
+ # check_client_version(ctx.obj, '--config', 'v1')
ctx.obj.ns.create(
nsd_name,
ns_name,