-
Notifications
You must be signed in to change notification settings - Fork 26
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
[WIP] Adding support for search_options on collection or subcollection #63
base: master
Are you sure you want to change the base?
Conversation
- Dynamically driven by the "subcollections" exposed via OPTIONS /api/:collection - supports queries and actions Queries: miq.vms.find(166).tags.collect(&:name) miq.vms.find(166).tags.select(:categorization).collect(&:categorization) Subcollection Actions: miq.vms.find(166).tags.assign(:name => "/managed/location/ny") miq.vms.find(166).tags.assign([{:name => "/managed/location/chicago"}, {:name => "/managed/cc/001"}]) Subcollection resource actions: miq.vms.find(166).tags.find(32).unassign miq.vms.find(166).tags.where(:name => "/managed/location/*").collect(&:unassign) Fixes: ManageIQ#31 Fixes: ManageIQ#32
- Moving action specific action methods for resources and subresources to seperate mixin. - Moving action specific action methods for collections and subcollections to seperate mixin. - Moving common queryable methods for collections and subcollections to a common QueryableMixin
- Updated options response fixture to include subcollections - Added collection rspecs - Added resource rspecs
- Add tests for subcollections
- Adding resource actions_vms.json - Adding subcollection actions_vm_tags.json
- Adding tests for subresources
- This allows arbitration search parameters to be send up with the query relation searches made. i.e. miq.providers.search_options(:provider_class => "provider").collect(&:name) or miq.vms.search_options(:collection_class => "VmServer").where(:name => "aab*").collect(&:name) - Also works witih subcollections: i.e. miq.vms.find(166).tags.search_options(:some_parameter => "some_value").collect(&:name)
@Fryguy marking as WIP as this depends on #61 Also, not sure about the home of this, I've placed search_options in the client with its usage in collection and subcollection for now. Didn't know if this would be useful for others and move it to queryable, it could be specified anywhere in the queryable chain of commands, right now it must be specified before. |
@abellotti if this is a viable PR, please rebase. |
Adding support for search_options on the collection or subcollection.
This allows arbitration search parameters to be send up with the
query relation searches made. i.e.
Also works witih subcollections, i.e.: