private synchronized void addAutoScalePolicy(String timerName, String policyName, long priority, String policyExpression, String action, int duration, int interval,
boolean isCleanUp) throws Exception {
// Adding a autoscale policy
// add timer policy lb_policy_scaleUp_cpu_mem -rule - (SYS.CUR_VSERVER.METRIC_TABLE(cpu).AVG_VAL.GT(80)-
// -action lb_scaleUpAction
autoscalepolicy timerPolicy = new autoscalepolicy();
try {
timerPolicy.set_name(policyName);
timerPolicy.set_action(action);
timerPolicy.set_rule(policyExpression);
autoscalepolicy.add(_netscalerService, timerPolicy);
} catch (Exception e) {
// Ignore Exception on cleanup
if (!isCleanUp)
throw e;