X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fscripts%2Fosm.py;fp=osmclient%2Fscripts%2Fosm.py;h=625defe5031c43cd0ef5a45c88648fa2e6e59e88;hb=a0bed2931f09825ef42abe81fcc3c03fdf52c5ed;hp=1fe8c360aad9c871445860f4ae1f3c99475c6f7a;hpb=5f4237344c6b74f554aa343671074e4c46110926;p=osm%2Fosmclient.git diff --git a/osmclient/scripts/osm.py b/osmclient/scripts/osm.py index 1fe8c36..625defe 100755 --- a/osmclient/scripts/osm.py +++ b/osmclient/scripts/osm.py @@ -1567,9 +1567,9 @@ def ns_action(ctx, exit(1) -@cli.command(name='ns-scale-vdu') +@cli.command(name='vnf-scale') @click.argument('ns_name' ) -@click.option('--vnf-name', prompt=True, help="member-vnf-index to scale") +@click.option('vnf-name', prompt=True, help="member-vnf-index to scale") @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)") @@ -1580,28 +1580,16 @@ def ns_scale_vdu(ctx, scaling_group, scale_in, scale_out): - """executes a VNF VDU scale over a NS instance + """executes a VNF scale (adding/removing VDUs) NS_NAME: name or ID of the NS instance + VNF_NAME: member-vnf-index in the NS to be scaled """ try: check_client_version(ctx.obj, ctx.command.name) - op_data={} if not scale_in and not scale_out: scale_out = True - # print("You must provide scale type with option '--vnf-scale-in' or '--vnf-scale-out'") - # exit(1) - op_data["scaleType"] = "SCALE_VNF" - op_data["scaleVnfData"] = {} - if scale_in: - op_data["scaleVnfData"]["scaleVnfType"] = "SCALE_IN" - else: - op_data["scaleVnfData"]["scaleVnfType"] = "SCALE_OUT" - op_data["scaleVnfData"]["scaleByStepData"] = { - "member-vnf-index": vnf_name, - "scaling-group-descriptor": scaling_group, - } - ctx.obj.ns.exec_op(ns_name, op_name='scale', op_data=op_data) + ctx.obj.ns.scale_vnf(ns_name, vnf_name, scaling_group, scale_in, scale_out) except ClientException as inst: print((inst.message)) exit(1)