Enhance the model structure for list deletion#2326
Merged
cb-github-robot merged 1 commit intocloud-barista:mainfrom Feb 23, 2026
Merged
Enhance the model structure for list deletion#2326cb-github-robot merged 1 commit intocloud-barista:mainfrom
cb-github-robot merged 1 commit intocloud-barista:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the deletion model structure by changing bulk resource deletion responses from simple string arrays (model.IdList) to structured output (model.ResourceDeleteResults). The new model provides detailed per-resource success/failure information with error messages, making it easier for API consumers to understand which resources were successfully deleted and why others failed.
Changes:
- Introduced new structured models:
ResourceDeleteResultandResourceDeleteResultswith success/failure tracking and error messages - Updated bulk deletion APIs for securityGroup, sshKey, vNet, dataDisk, image, customImage, and sharedResources to return structured results
- Re-enabled dependency checking to prevent deletion of resources still referenced by other objects
- Added Spider response validation and post-deletion verification for improved reliability
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/core/model/common.go | Added ResourceDeleteResult, ResourceDeleteResults, and SpiderBooleanInfo struct definitions |
| src/core/resource/common.go | Updated DelAllResources and DelResource to use new models; added dependency checking and Spider verification |
| src/interface/rest/server/resource/common.go | Simplified RestDelAllResources to return structured results directly, removed wrapper |
| src/interface/rest/server/resource/vnet.go | Updated Swagger annotation to reference ResourceDeleteResults |
| src/interface/rest/server/resource/sshkey.go | Updated Swagger annotation to reference ResourceDeleteResults |
| src/interface/rest/server/resource/securitygroup.go | Updated Swagger annotation to reference ResourceDeleteResults |
| src/interface/rest/server/resource/image.go | Updated Swagger annotation to reference ResourceDeleteResults |
| src/interface/rest/server/resource/dataDisk.go | Updated Swagger annotation to reference ResourceDeleteResults |
| src/interface/rest/server/resource/customimage.go | Updated Swagger annotation to reference ResourceDeleteResults |
| src/interface/rest/docs/swagger.yaml | Added OpenAPI schema definitions for new model structures |
| src/interface/rest/docs/docs.go | Generated documentation reflecting new model structures |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Seokho Son <shsongist@gmail.com>
Member
Author
|
/approve |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes the output model for deleting multiple resources from string to structured output