bernardodemarco opened a new pull request, #11222:
URL: https://github.com/apache/cloudstack/pull/11222

   ### Description
   
   PR #9666 introduced changes to fix issues with the deletion of backup 
schedules. Prior to that PR, the `deleteBackupSchedule` API accepted only one 
parameter (`virtualmachineid`) and would delete a random backup schedule 
associated with the specified VM. The update modified the behavior so that, 
instead of randomly deleting one schedule, the API deletes all backup schedules 
for the given VM (when the `virtualmachineid` parameter is specified).
   
   Additionally, the PR added support for deleting a specific schedule by 
introducing the `id` parameter to the `deleteBackupSchedule` API. However, the 
`BackupScheduleVO` class currently does not have a `uuid` attribute, and the 
`BackupScheduleResponse` does not have the `id` field. As a result, the API 
currently does not correctly recognize the `id` parameter in the API calls, 
preventing the deletion of a specific schedule.
   
   This PR addresses that issue by enabling the deletion of individual backup 
schedules via their ID. It also updates the UI to send the `id` parameter when 
the user selects a specific schedule to delete, rather than using the 
`virtualmachineid` parameter.
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [X] Bug fix (non-breaking change which fixes an issue)
   - [X] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] build/CI
   - [ ] test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [X] Minor
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   Before applying the PR changes, I verified that is was not possible to 
delete specific schedules:
   
   <details>
   <summary>Backup Schedules</summary>
   
   ```sql
   select * from cloud.backup_schedule\G
   *************************** 1. row ***************************
                    id: 11
                 vm_id: 7
         schedule_type: 0
              schedule: 12
              timezone: AGT
   scheduled_timestamp: 2025-07-16 14:12:00
          async_job_id: NULL
           max_backups: 2
   *************************** 2. row ***************************
                    id: 12
                 vm_id: 7
         schedule_type: 1
              schedule: 03:30
              timezone: GMT
   scheduled_timestamp: 2025-07-17 06:03:00
          async_job_id: NULL
           max_backups: 1
   2 rows in set (0.000 sec)
   ```
   
   </details>
   
   ```
   (segregated-lab) 🐱 > delete backupschedule id=12
   🙈 Error: (HTTP 530, error code 9999) Either instance ID or ID of backup 
schedule needs to be specified
   (segregated-lab) 🐱 > delete backupschedule id=11
   🙈 Error: (HTTP 530, error code 9999) Either instance ID or ID of backup 
schedule needs to be specified
   (segregated-lab) 🐱 > delete backupschedule id="11"
   🙈 Error: (HTTP 530, error code 9999) Either instance ID or ID of backup 
schedule needs to be specified
   (segregated-lab) 🐱 > delete backupschedule id="12"
   🙈 Error: (HTTP 530, error code 9999) Either instance ID or ID of backup 
schedule needs to be specified
   ```
   
   After applying the changes:
   - Verified that the ID is present in the `listBackupSchedule` API return
   - Verified that it is possible to delete backup schedules of a specific ID
   - Verified that it is possible to delete specific schedules through the UI
   - Verified that is is possible to delete all backup schedules of a VM
   - Verified access validation
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to