Re: [Pulp-list] Searching for an RPM

2018-12-06 Thread Matthew Madey
Thank you very much! That returned a lot of information. I think with a few
filters I can narrow it down to what I need. Thanks again!

On Thu, Dec 6, 2018 at 2:41 PM Dennis Kliban  wrote:

> On Thu, Dec 6, 2018 at 1:47 PM Matthew Madey  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

Re: [Pulp-list] Searching for an RPM

2018-12-06 Thread Dennis Kliban
On Thu, Dec 6, 2018 at 1:47 PM Matthew Madey  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