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

Batch subcommand filter #199

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

Conversation

yazug
Copy link
Collaborator

@yazug yazug commented Oct 20, 2020

simple batch subcommand using get_filter implementation

get_filter abstracts several filter request patterns for paginated and
non-paginated get interactions with errata

Exposes the top level api calls for searching and does not do any additional processing at the moment

errata-tool batch list

errata-tool batch get <batch_id_or_name>

@yazug yazug requested review from ktdreyer and lhh October 20, 2020 18:34
@yazug yazug self-assigned this Oct 20, 2020
yazug added 4 commits July 7, 2023 12:14
- helper method to implement general filter query pattern
- add support for release/product difference in nesting filter
  parameters
- support for paginated requests
- basic unittest for filter helper based on usage

Works with the following

et.get_filter('/api/v1/releases', 'filter', is_active="true",
	  enabled="true", name='OpenStack 14.0.z for RHEL 7')

works with the following
et.get_filter('/errata', 'errata_filter[filter_params]',
	  show_type_RHBA=1, show_type_RHEA=1, show_type_RHSA=1,
	  show_state_NEW_FILES=1, show_state_QE=1,
          show_state_REL_PREP=1,show_state_PUSH_READY=1,
          open_closed_option='exclude', release=856)

Note: errata endpoint releases and products have to be special
handled to include extra [] and multiple entries if you want them

Related: red-hat-storage#132
errata-tool batch get <id or name of batch>
errata-tool batch list
based on ErrataConnector::get_filter method

prints the returned json blob

also has --summary to show some more details
BatchSearch encapsulates the searching functionality
and exposes 2 methods for querying ET

Batch is an object for a specific batch from ET

Batch object has properties exposed for some of the relevant
data extracted it also exposes the raw data returned for the
batch as well as accessors methods to work with the raw returned data.

Batch can be constructed from data already partially broken down
from BatchSearch or to directly query ET and parse the data

the Batch::errata property will lazy load the Errata objects.
If you are just wanting to know which advisories you can look at
Batch::errata_ids property which will provide you with the list of
advisories ids that in the batch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant