Skip to content

Commit b228841

Browse files
Jessica Wangvijayvenkat
authored andcommitted
CS-15885: cloudstack 3.0 UI - autoscale - add UI-side validation - at least one condition is required in Scale Up/Down Policy.
1 parent 3d754ed commit b228841

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

ui/scripts/autoscaler.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,14 +799,33 @@
799799
}
800800
}
801801

802+
//Scale Up Policy
803+
if(args.data.scaleUpDuration == null || args.data.scaleUpDuration.length == 0) {
804+
args.response.error("Duration of Scale Up Policy is required.");
805+
return;
806+
}
802807
if(args.data.scaleUpDuration < args.data.interval) {
803808
args.response.error("Duration of Scale Up Policy can not be less than Polling Interval.");
804809
return;
810+
}
811+
if(scaleUpData.length == 0) {
812+
args.response.error("At least one condition is required in Scale Up Policy.");
813+
return;
814+
}
815+
816+
//Scale Down Policy
817+
if(args.data.scaleDownDuration == null || args.data.scaleDownDuration.length == 0) {
818+
args.response.error("Duration of Scale Down Policy is required.");
819+
return;
805820
}
806821
if(args.data.scaleDownDuration < args.data.interval) {
807822
args.response.error("Duration of Scale Down Policy can not be less than Polling Interval.");
808823
return;
809-
}
824+
}
825+
if(scaleDownData.length == 0) {
826+
args.response.error("At least one condition is required in Scale Down Policy.");
827+
return;
828+
}
810829
//validation (end) *****
811830

812831
var scaleVmProfileResponse = [];

0 commit comments

Comments
 (0)