logger.debug("")
vnfd_list(ctx, nf_type, filter, long)
-@cli_osm.command(name='vnfpkg-repo-list', short_help='list all xNF from OSM repositories')
-@click.option('--filter', default=None,
- help='restricts the list to the NFpkg matching the filter')
-@click.option('--repo', default=None,
- help='restricts the list to a particular OSM repository')
-@click.option('--long', is_flag=True, help='get more details')
-@click.pass_context
-def vnfd_list3(ctx, filter, repo, long):
- """list xNF packages from OSM repositories"""
- pkgtype = 'vnf'
- pkg_repo_list(ctx, pkgtype, filter, repo, long)
-
@cli_osm.command(name='nfpkg-list', short_help='list all xNF packages (VNF, HNF, PNF)')
@click.option('--nf_type', help='type of NF (vnf, pnf, hnf)')
@click.option('--filter', default=None,
# print(str(e))
# exit(1)
+@cli_osm.command(name='vnfpkg-repo-list', short_help='list all xNF from OSM repositories')
+@click.option('--filter', default=None,
+ help='restricts the list to the NFpkg matching the filter')
+@click.option('--repo', default=None,
+ help='restricts the list to a particular OSM repository')
+@click.option('--long', is_flag=True, help='get more details')
+@click.pass_context
+def nfpkg_repo_list1(ctx, filter, repo, long):
+ """list xNF packages from OSM repositories"""
+ pkgtype = 'vnf'
+ pkg_repo_list(ctx, pkgtype, filter, repo, long)
+
@cli_osm.command(name='nfpkg-repo-list', short_help='list all xNF from OSM repositories')
@click.option('--filter', default=None,
help='restricts the list to the NFpkg matching the filter')
help='restricts the list to a particular OSM repository')
@click.option('--long', is_flag=True, help='get more details')
@click.pass_context
-def vnfd_list4(ctx, filter, repo, long):
+def nfpkg_repo_list2(ctx, filter, repo, long):
"""list xNF packages from OSM repositories"""
pkgtype = 'vnf'
pkg_repo_list(ctx, pkgtype, filter, repo, long)
help='restricts the list to a particular OSM repository')
@click.option('--long', is_flag=True, help='get more details')
@click.pass_context
-def nsd_list3(ctx, filter, repo, long):
+def nspkg_repo_list(ctx, filter, repo, long):
"""list xNF packages from OSM repositories"""
pkgtype = 'ns'
pkg_repo_list(ctx, pkgtype, filter, repo, long)
help='restricts the list to a particular OSM repository')
@click.option('--long', is_flag=True, help='get more details')
@click.pass_context
-def nspkg_list(ctx, filter, repo, long):
+def nspkg_repo_list2(ctx, filter, repo, long):
"""list xNF packages from OSM repositories"""
pkgtype = 'ns'
pkg_repo_list(ctx, pkgtype, filter, repo, long)
if op['lcmOperationType']=='action':
action_name = op['operationParams']['primitive']
detail = "-"
- if op['operationState']=='PROCESSING':
- if op['lcmOperationType'] in ('instantiate', 'terminate'):
+ if op['operationState'] == 'PROCESSING':
+ if op['queuePosition'] is not None and op['queuePosition'] > 0:
+ detail = "In queue. Current position: {}".format(op['queuePosition'])
+ elif op['lcmOperationType'] in ('instantiate', 'terminate'):
if op['stage']:
detail = op['stage']
- else:
- detail = "In queue. Current position: {}".format(op['queuePosition'])
elif op['operationState'] in ('FAILED', 'FAILED_TEMP'):
detail = op.get('errorMessage','-')
date = datetime.fromtimestamp(op['startTime']).strftime("%Y-%m-%dT%H:%M:%S")
time.sleep(5)
t += 5
print ("Could not determine KDU status")
+ return
if literal:
print(yaml.safe_dump(resp, indent=4, default_flow_style=False))
@click.option('--vnf_name', default=None, help='member-vnf-index if the target is a vnf instead of a ns)')
@click.option('--kdu_name', default=None, help='kdu-name if the target is a kdu)')
@click.option('--vdu_id', default=None, help='vdu-id if the target is a vdu')
-@click.option('--vdu_count', default=None, help='number of vdu instance of this vdu_id')
+@click.option('--vdu_count', default=None, type=int, help='number of vdu instance of this vdu_id')
@click.option('--action_name', prompt=True, help='action name')
@click.option('--params', default=None, help='action params in YAML/JSON inline string')
@click.option('--params_file', default=None, help='YAML/JSON file with action params')
op_data['kdu_name'] = kdu_name
if vdu_id:
op_data['vdu_id'] = vdu_id
- if vdu_count:
+ if vdu_count is not None:
op_data['vdu_count_index'] = vdu_count
if timeout:
op_data['timeout_ns_action'] = timeout