[Pulp-list] Searching for an RPM

Dennis Kliban dkliban at redhat.com
Thu Dec 6 20:41:40 UTC 2018


On Thu, Dec 6, 2018 at 1:47 PM Matthew Madey <mattmadey at gmail.com> wrote:

> Having some trouble with the search API.. I'd like to be able to query for
> a package to see if it exists in any repository on the server. Can someone
> share an example curl POST to find a particular RPM based on name? I've
> been trying the below and getting nothing but null return values.
>
> curl -H "Accept:application/json,version=2" -H
> "Content-Type:application/json" -X POST -u admin:**** -k -d '{"criteria":
> {"filters": {"id": {"$in": ["ansible"]}, "group": {"$regex": ".*"}},
> "fields": ["id", "group", "description"]}}'
> https://pulp.server.com/pulp/api/v2/rpm/search/
> null
>

You are probably getting a 404. I was able to do a search using the
following:

curl -k -H "Accept:application/json,version=2" -H
"Content-Type:application/json" -X POST -u admin:admin -d '{"criteria": {
"filters": {"name": {"$regex": "squirrel"}}}}'
https://localhost/pulp/api/v2/content/units/rpm/search/

The above command finds a package with the name 'squirrel'. However, it may
or may not be in a repository.



> _______________________________________________
> Pulp-list mailing list
> Pulp-list at redhat.com
> https://www.redhat.com/mailman/listinfo/pulp-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pulp-list/attachments/20181206/509dd593/attachment.htm>


More information about the Pulp-list mailing list