nsd_list(ctx, filter, long)
-def pkg_repo_list(ctx, pkgtype, filter, repo, long):
- if filter:
- filter='&'.join(filter)
- resp = ctx.obj.osmrepo.pkg_list(pkgtype, filter, repo)
- if long:
- table = PrettyTable(['nfpkg name', 'vendor', 'version', 'latest', 'description', 'repository'])
- else:
- table = PrettyTable(['nfpkg name', 'repository'])
- for vnfd in resp:
- name = vnfd.get('name', '-')
- repository = vnfd.get('repository')
- if long:
- vendor = vnfd.get('vendor')
- version = vnfd.get('version')
- description = vnfd.get('description')
- latest = vnfd.get('latest')
- table.add_row([name, vendor, version, latest, description, repository])
- else:
- table.add_row([name, repository])
- table.align = 'l'
- print(table)
-
def vnfd_list(ctx, nf_type, filter, long):
logger.debug("")
if nf_type:
logger.debug("")
vnfd_list(ctx, nf_type, filter, 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, multiple=True,
# print(str(e))
# exit(1)
+
+def pkg_repo_list(ctx, pkgtype, filter, repo, long):
+ if filter:
+ filter='&'.join(filter)
+ resp = ctx.obj.osmrepo.pkg_list(pkgtype, filter, repo)
+ if long:
+ table = PrettyTable(['nfpkg name', 'vendor', 'version', 'latest', 'description', 'repository'])
+ else:
+ table = PrettyTable(['nfpkg name', 'repository'])
+ for vnfd in resp:
+ name = vnfd.get('name', '-')
+ repository = vnfd.get('repository')
+ if long:
+ vendor = vnfd.get('vendor')
+ version = vnfd.get('version')
+ description = vnfd.get('description')
+ latest = vnfd.get('latest')
+ table.add_row([name, vendor, version, latest, description, repository])
+ else:
+ table.add_row([name, repository])
+ table.align = 'l'
+ print(table)
+
+
@cli_osm.command(name='vnfpkg-repo-list', short_help='list all xNF from OSM repositories')
@click.option('--filter', default=None, multiple=True,
help='restricts the list to the NFpkg matching the filter')
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, multiple=True,
help='restricts the list to the NFpkg matching the filter')
pkgtype = 'vnf'
pkg_repo_list(ctx, pkgtype, filter, repo, long)
+
+@cli_osm.command(name='nsd-repo-list', short_help='list all NS from OSM repositories')
+@click.option('--filter', default=None, multiple=True,
+ help='restricts the list to the NS 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 nspkg_repo_list(ctx, filter, repo, long):
+ """list xNF packages from OSM repositories"""
+ pkgtype = 'ns'
+ pkg_repo_list(ctx, pkgtype, filter, repo, long)
+
+
+@cli_osm.command(name='nspkg-repo-list', short_help='list all NS from OSM repositories')
+@click.option('--filter', default=None, multiple=True,
+ help='restricts the list to the NS 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 nspkg_repo_list2(ctx, filter, repo, long):
+ """list xNF packages from OSM repositories"""
+ pkgtype = 'ns'
+ pkg_repo_list(ctx, pkgtype, filter, repo, long)
+
+
def vnf_list(ctx, ns, filter, long):
# try:
if ns or filter:
logger.debug("")
vnf_list(ctx, ns, filter, long)
-@cli_osm.command(name='nsd-repo-list', short_help='list all NS from OSM repositories')
-@click.option('--filter', default=None, multiple=True,
- help='restricts the list to the NS 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 nspkg_repo_list(ctx, filter, repo, long):
- """list xNF packages from OSM repositories"""
- pkgtype = 'ns'
- pkg_repo_list(ctx, pkgtype, filter, repo, long)
-
-@cli_osm.command(name='nspkg-repo-list', short_help='list all NS from OSM repositories')
-@click.option('--filter', default=None, multiple=True,
- help='restricts the list to the NS 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 nspkg_repo_list2(ctx, filter, repo, long):
- """list xNF packages from OSM repositories"""
- pkgtype = 'ns'
- pkg_repo_list(ctx, pkgtype, filter, repo, long)
@cli_osm.command(name='nf-list', short_help='list all NF instances')
@click.option('--ns', default=None, help='NS instance id or name to restrict the NF list')