+def nst_show(ctx, name, literal):
+ try:
+ check_client_version(ctx.obj, ctx.command.name)
+ resp = ctx.obj.nst.get(name)
+ #resp = ctx.obj.nst.get_individual(name)
+ except ClientException as inst:
+ print((inst.message))
+ exit(1)
+
+ if literal:
+ print(yaml.safe_dump(resp))
+ return
+
+ table = PrettyTable(['field', 'value'])
+ for k, v in list(resp.items()):
+ table.add_row([k, json.dumps(v, indent=2)])
+ table.align = 'l'
+ print(table)
+
+
+@cli.command(name='nst-show', short_help='shows the content of a Network Slice Template (NST)')
+@click.option('--literal', is_flag=True,
+ help='print literally, no pretty table')
+@click.argument('name')
+@click.pass_context
+def nst_show1(ctx, name, literal):
+ '''shows the content of a Network Slice Template (NST)
+
+ NAME: name or ID of the NST
+ '''
+ nst_show(ctx, name, literal)
+
+
+@cli.command(name='netslice-template-show', short_help='shows the content of a Network Slice Template (NST)')
+@click.option('--literal', is_flag=True,
+ help='print literally, no pretty table')
+@click.argument('name')
+@click.pass_context
+def nst_show2(ctx, name, literal):
+ '''shows the content of a Network Slice Template (NST)
+
+ NAME: name or ID of the NST
+ '''
+ nst_show(ctx, name, literal)
+
+
+def nsi_show(ctx, name, literal, filter):
+ try:
+ check_client_version(ctx.obj, ctx.command.name)
+ nsi = ctx.obj.nsi.get(name)
+ except ClientException as inst:
+ print((inst.message))
+ exit(1)
+
+ if literal:
+ print(yaml.safe_dump(nsi))
+ return
+
+ table = PrettyTable(['field', 'value'])
+
+ for k, v in list(nsi.items()):
+ if filter is None or filter in k:
+ table.add_row([k, json.dumps(v, indent=2)])
+
+ table.align = 'l'
+ print(table)
+
+
+@cli.command(name='nsi-show', short_help='shows the content of a Network Slice Instance (NSI)')
+@click.argument('name')
+@click.option('--literal', is_flag=True,
+ help='print literally, no pretty table')
+@click.option('--filter', default=None)
+@click.pass_context
+def nsi_show1(ctx, name, literal, filter):
+ '''shows the content of a Network Slice Instance (NSI)
+
+ NAME: name or ID of the Network Slice Instance
+ '''
+ nsi_show(ctx, name, literal, filter)
+
+
+@cli.command(name='netslice-instance-show', short_help='shows the content of a Network Slice Instance (NSI)')
+@click.argument('name')
+@click.option('--literal', is_flag=True,
+ help='print literally, no pretty table')
+@click.option('--filter', default=None)
+@click.pass_context
+def nsi_show2(ctx, name, literal, filter):
+ '''shows the content of a Network Slice Instance (NSI)
+
+ NAME: name or ID of the Network Slice Instance
+ '''
+ nsi_show(ctx, name, literal, filter)
+
+
+def nsi_op_show(ctx, id, filter):
+ try:
+ check_client_version(ctx.obj, ctx.command.name)
+ op_info = ctx.obj.nsi.get_op(id)
+ except ClientException as inst:
+ print((inst.message))
+ exit(1)
+
+ table = PrettyTable(['field', 'value'])
+ for k, v in list(op_info.items()):
+ if filter is None or filter in k:
+ table.add_row([k, json.dumps(v, indent=2)])
+ table.align = 'l'
+ print(table)
+
+
+@cli.command(name='nsi-op-show', short_help='shows the info of an operation over a Network Slice Instance(NSI)')
+@click.argument('id')
+@click.option('--filter', default=None)
+@click.pass_context
+def nsi_op_show1(ctx, id, filter):
+ '''shows the info of an operation over a Network Slice Instance(NSI)
+
+ ID: operation identifier
+ '''
+ nsi_op_show(ctx, id, filter)
+
+
+@cli.command(name='netslice-instance-op-show', short_help='shows the info of an operation over a Network Slice Instance(NSI)')
+@click.argument('id')
+@click.option('--filter', default=None)
+@click.pass_context
+def nsi_op_show2(ctx, id, filter):
+ '''shows the info of an operation over a Network Slice Instance(NSI)
+
+ ID: operation identifier
+ '''
+ nsi_op_show(ctx, id, filter)
+
+
+@cli.command(name='pdu-show', short_help='shows the content of a Physical Deployment Unit (PDU)')
+@click.argument('name')
+@click.option('--literal', is_flag=True,
+ help='print literally, no pretty table')
+@click.option('--filter', default=None)
+@click.pass_context
+def pdu_show(ctx, name, literal, filter):
+ '''shows the content of a Physical Deployment Unit (PDU)
+
+ NAME: name or ID of the PDU
+ '''
+ try:
+ check_client_version(ctx.obj, ctx.command.name)
+ pdu = ctx.obj.pdu.get(name)
+ except ClientException as inst:
+ print((inst.message))
+ exit(1)
+
+ if literal:
+ print(yaml.safe_dump(pdu))
+ return
+
+ table = PrettyTable(['field', 'value'])
+
+ for k, v in list(pdu.items()):
+ if filter is None or filter in k:
+ table.add_row([k, json.dumps(v, indent=2)])
+
+ table.align = 'l'
+ print(table)
+
+