Skip to content
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 networks.ListOptsMulti #2746

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mdbooth
Copy link
Contributor

@mdbooth mdbooth commented Sep 1, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant