-
Notifications
You must be signed in to change notification settings - Fork 1.3k
api: Remove redundant API parameters #6143
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
Conversation
weizhouapache
left a comment
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.
code lgtm
|
@blueorangutan package |
|
@weizhouapache a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result: ✖️ el7 ✖️ el8 ✖️ debian ✖️ suse15. SL-JID 2942 |
11fd4bc to
836125f
Compare
|
@blueorangutan package |
GabrielBrascher
left a comment
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.
Thanks for the PR, @Pearl1594.
I would like to double-check if those parameters should be aimed only at Admins.
I ask this because it is not clear if that's the goal of this PR as well, or if it is aiming just at removing the redundant/duplicated parameters.
If the goal is to remove duplicated parameters but keep the current API behavior (Users & Admins), then I believe it should instead be removed at the ListVMsCmdAdmin which extends ListVMsCmd.
|
Thanks for reviewing @GabrielBrascher , the following params: pod_id, storage_id, host_id, seem to be used only applicable only for root admins - https://github.com/apache/cloudstack/blob/main/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java#L1004-L1011 , hence I took the following approach. It removes the redundant params and also ensures to behave the same way as before. |
|
@Pearl1594 shouldn't a domain- or resource admin be allowed to list by host, pod, zone ? |
|
Sorry @Pearl1594, I raised the question regarding "Admins & Users". |
836125f to
3c5a779
Compare
|
It seems that only listing zones is allowed for all roles - listing storage pools, hosts, clusters and pods, are restricted to root admins only. So, this change shouldn't effect any behavior. |
|
@blueorangutan package |
|
@Pearl1594 a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
weizhouapache
left a comment
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.
code lgtm
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2943 |
|
@blueorangutan test |
|
@Pearl1594 a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
GabrielBrascher
left a comment
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.
LGTM
|
Trillian test result (tid-3683)
|
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.
Code LGTM, checked the UI codebase and could not find any of the params being passed to the listVirtualMachines API - would be good to test the different roles to verify the behaviour is not affected
|
Have tested different roles and as advised by @Pearl1594 the removed parameters only apply for ROOT admin |
Description
This PR removes the redundant api parameters listed under listVirtualMachines API. The parameters are already defined in
ListVMsCmdByAdminclassTypes of changes
Feature/Enhancement Scale or Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?