On Thu, Dec 6, 2018 at 1:47 PM Matthew Madey <mattma...@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@redhat.com
> https://www.redhat.com/mailman/listinfo/pulp-list
_______________________________________________
Pulp-list mailing list
Pulp-list@redhat.com
https://www.redhat.com/mailman/listinfo/pulp-list

Reply via email to