table.add_row([k, utils.wrap_text(json.dumps(v, indent=2), 100)])
table.align = "l"
print(table)
+
+
+@click.command(name="ns-op-cancel", short_help="cancels an ongoing NS operation")
+@click.argument("id")
+@click.option(
+ "--cancel_mode",
+ required=False,
+ default="GRACEFUL",
+ show_default=True,
+ help="Mode of cancellation, can be FORCEFUL or GRACEFUL",
+)
+@click.option(
+ "--wait",
+ required=False,
+ default=False,
+ is_flag=True,
+ help="do not return the control immediately, but keep it "
+ "until the operation is completed, or timeout",
+)
+@click.pass_context
+def ns_op_cancel(ctx, id, cancel_mode, wait):
+ """Cancels an ongoing NS operation
+
+ ID: operation identifier
+ """
+ logger.debug("")
+ utils.check_client_version(ctx.obj, ctx.command.name)
+ ctx.obj.ns.cancel_op(id, cancel_mode, wait)