Closed
Conversation
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 is a PoC, and came out of a discussion with @pierreprinetti about gophercloud/utils#190
I've only implemented it for Networks, as that should be sufficient for discussion. I have changed all uses of ListOpts in acceptance tests to use ListOptsMulti instead to kick the tyres.
Something else to make clear: this is 2 PRs in 1! The 2 commits in this PR present 2 alternative APIs. My personal preference is for the first one (the monadic one), as it has the best type safety.
Fixes #[PUT ISSUE NUMBER HERE]
Links to the line numbers/files in the OpenStack source code that support the
code in this PR:
Tag filters: https://github.com/openstack/neutron/blob/ed6023c3473585b4af6980404e7fe36ea152f980/neutron/objects/tag.py#L37-L104
Sort fields are singletons: https://github.com/openstack/neutron/blob/ed6023c3473585b4af6980404e7fe36ea152f980/neutron/api/v2/base.py#L291-L293
Most filter values can have multiple values: https://github.com/openstack/neutron/blob/ed6023c3473585b4af6980404e7fe36ea152f980/neutron/api/api_common.py#L70-L115