[Pulp-list] v2 api retrieve rpms in repo? PLEASE! :)

Ryan Bowlby rbowlby83 at gmail.com
Thu May 2 08:16:19 UTC 2013


Seems like it should be a pretty simple API call, but I can't figure
out how to do it for the life of me. I was able to get a response that
includes the entire metadata for each rpm in a given repo. I don't
need or want that, just a list of rpm filenames.

>>> body = { 'criteria': { 'limit': 1, 'fields': { 'association' : []}}}

>>> r = requests.post('https://pulp/pulp/api/v2/repositories/repo/search/units/', auth=('admin', 'removed'), verify=False, data=json.dumps(body))

>>> pprint.pprint(r.json())[{u'_id': {u'$oid': u'51818a5aee95994a2d0000cd'},
  u'metadata': {u'_content_type_id': u'rpm',
                u'_id': u'faa52d6a-1f5c-41e1-9ad8-c200aa3d3278',
                u'_ns': u'units_rpm',
                u'_storage_path':......REMOVED FOR BREVITY


Please for the love of all that is holy can someone share with me how
to retrieve a list of RPMs for a given repo? Possibly updating the
pulp 2.1 API documentation with this example as I'm sure this is a
pretty common ask.

Please don't RTFM me, I've read:

http://pulp-dev-guide.readthedocs.org/en/latest/integration/rest-api/repo/retrieval.html
http://pulp-dev-guide.readthedocs.org/en/latest/conventions/criteria.html#search-api

None the wiser after doing so. Tailing logs after running pulp-admin
and those docs only got me this far.

Thanks,
Ryan




More information about the Pulp-list mailing list