+ str(exc))
+ raise ClientException(message)
+
+ def scale_vnf(self, ns_name, vnf_name, scaling_group, scale_in, scale_out, wait=False):
+ """Scales a VNF by adding/removing VDUs
+ """
+ self._logger.debug("")
+ self._client.get_token()
+ try:
+ op_data={}
+ 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,
+ }
+ op_id = self.exec_op(ns_name, op_name='scale', op_data=op_data, wait=wait)
+ print(str(op_id))
+ except ClientException as exc:
+ message="failed to scale vnf {} of ns {}:\nerror:\n{}".format(
+ vnf_name, ns_name, str(exc))