File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
api/src/main/java/org/apache/cloudstack/api/command/user/backup
server/src/main/java/org/apache/cloudstack/backup Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -55,14 +55,12 @@ public class DeleteBackupScheduleCmd extends BaseCmd {
5555 @ Parameter (name = ApiConstants .VIRTUAL_MACHINE_ID ,
5656 type = CommandType .UUID ,
5757 entityType = UserVmResponse .class ,
58- required = true ,
5958 description = "ID of the VM" )
6059 private Long vmId ;
6160
6261 @ Parameter (name = ApiConstants .ID ,
6362 type = CommandType .UUID ,
6463 entityType = BackupScheduleResponse .class ,
65- required = true ,
6664 description = "ID of the schedule" ,
6765 since = "4.20.1" )
6866 private Long id ;
Original file line number Diff line number Diff line change @@ -470,6 +470,9 @@ public List<BackupSchedule> listBackupSchedule(final Long vmId) {
470470 public boolean deleteBackupSchedule (DeleteBackupScheduleCmd cmd ) {
471471 Long vmId = cmd .getVmId ();
472472 Long id = cmd .getId ();
473+ if (Objects .isNull (vmId ) && Objects .isNull (id )) {
474+ throw new InvalidParameterValueException ("Either instance ID or ID of backup schedule needs to be specified" );
475+ }
473476 if (Objects .nonNull (vmId )) {
474477 final VMInstanceVO vm = findVmById (vmId );
475478 validateForZone (vm .getDataCenterId ());
You can’t perform that action at this time.
0 commit comments