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

Allow plugins to provide arbitrary filter headers #107

Merged
merged 1 commit into from Mar 8, 2019

Conversation

Dorthu
Copy link
Member

@Dorthu Dorthu commented Mar 6, 2019

This is for @jfrederickson

Plugins sometimes need to use more complex filtering than the CLI
provides by default. This allows plugins only to specify filter headers
as Python dicts, and overrides whatever was passed in the CLI command.

This is for @jfrederickson

Plugins sometimes need to use more complex filtering than the CLI
provides by default.  This allows plugins only to specify filter headers
as Python dicts, and overrides whatever was passed in the CLI command.
Copy link
Member

@jfrederickson jfrederickson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - this appears to work as intended:

In [38]: status, result = context.client.call_operation('linodes', 'types', filters={"+and": [{ "vcpus": { "+gte": 2 }}, {"class": "standard"}], "+order_by": "memo
    ...: ry", "+order": "asc"})

In [39]: [item['id'] for item in result['data']]
Out[39]:
['g6-standard-2',
 'g6-standard-4',
 'g6-standard-6',
 'g6-standard-8',
 'g6-standard-16',
 'g6-standard-20',
 'g6-standard-24',
 'g6-standard-32']

@patthiel
Copy link
Contributor

patthiel commented Mar 8, 2019

LGTM

@Dorthu Dorthu merged commit d00bbf1 into master Mar 8, 2019
@er0k er0k deleted the feature/plugin-arbitrary-filtering branch May 18, 2021 15:25
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.

None yet

3 participants