-
Notifications
You must be signed in to change notification settings - Fork 918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add batch APIs for multiple tags to object #2211
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you for this and esp. including vcsim support and tests @embano1 !
Just one minor question, otherwise lgtm.
Please hold Doug, found a minor glitch in one test which passed but in the wrong way :) |
- Add attach-multiple-tags-to-object and detach-multiple-tags-from-object APIs - Add BatchError(s) types - Add minimum simulator APIs (see note below) - Add/update comments to describe error behavior in detail - Add black-box tests (against simulator) Tested against vCenter 6.7U3 which has the following behavior: - Missing/invalid object reference: 403 Forbidden - No valid REST session: 401 Unauthorized - No tagging permissions: ServerFaultCode: Permission to perform this operation was denied - Tag not found: 200 with individual cis.tagging.objectNotFound.error in response - Cardinality violation: 200 with cis.tagging.attach.invalidArgument.cardinality.error Note that the existing simulator APIs currently don't support all these failure codes Fixes: #2208 Related: #2210 Signed-off-by: Michael Gasch <[email protected]>
Done, ready for merge. |
This PR adds support for the missing multiple-tags-to-object (attach/detach) APIs which are important for efficiency and performance especially in large environments (many tags/objects) and environments with high churn (Kubernetes controllers, event-driven systems).
The following changes were made:
Example output handled in a
main.go
with thelog
package where some tags could not be assigned to a valid reference:Tested against vCenter 6.7U3 which has the following behavior:
403 Forbidden
401 Unauthorized
ServerFaultCode: Permission to perform this operation was denied
200 with individual cis.tagging.objectNotFound.error in response
200 with cis.tagging.attach.invalidArgument.cardinality.error
Note that the existing simulator APIs currently don't support all these failure codes
Fixes: #2208
Related: #2210
Signed-off-by: Michael Gasch [email protected]