vim = vim_name
current_operation = "{} ({})".format(nsr['currentOperation'],nsr['currentOperationID'])
error_details = "N/A"
- if ns_state == "BROKEN" or ns_state == "DEGRADED":
- error_details = "{}\nDetail: {}".format(nsr['errorDescription'],nsr['errorDetail'])
+ if ns_state == "BROKEN" or ns_state == "DEGRADED" or nsr['errorDescription']:
+ error_details = "{}\nDetail: {}".format(nsr['errorDescription'], nsr['errorDetail'])
else:
nsopdata = ctx.obj.ns.get_opdata(ns['id'])
nsr = nsopdata['nsr:nsr']
@click.option('--scaling-group', prompt=True, help="scaling-group-descriptor name to use")
@click.option('--scale-in', default=False, is_flag=True, help="performs a scale in operation")
@click.option('--scale-out', default=False, is_flag=True, help="performs a scale out operation (by default)")
+@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 vnf_scale(ctx,
ns_name,
vnf_name,
scaling_group,
scale_in,
- scale_out):
+ scale_out,
+ wait):
"""
Executes a VNF scale (adding/removing VDUs)
check_client_version(ctx.obj, ctx.command.name)
if not scale_in and not scale_out:
scale_out = True
- ctx.obj.ns.scale_vnf(ns_name, vnf_name, scaling_group, scale_in, scale_out)
+ ctx.obj.ns.scale_vnf(ns_name, vnf_name, scaling_group, scale_in, scale_out, wait)
# except ClientException as e:
# print(str(e))
# exit(1)