<div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Dec 6, 2018 at 1:47 PM Matthew Madey <<a href="mailto:mattmadey@gmail.com">mattmadey@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr">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.<div><br></div><div>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"]}}' <a href="https://pulp.server.com/pulp/api/v2/rpm/search/" target="_blank">https://pulp.server.com/pulp/api/v2/rpm/search/</a><br>null<br></div></div></div></div>
</blockquote><div><br></div><div>You are probably getting a 404. I was able to do a search using the following:</div><div><br></div><div>curl -k -H "Accept:application/json,version=2" -H "Content-Type:application/json" -X POST -u admin:admin -d '{"criteria": { "filters": {"name": {"$regex": "squirrel"}}}}' <a href="https://localhost/pulp/api/v2/content/units/rpm/search/">https://localhost/pulp/api/v2/content/units/rpm/search/</a><br></div><div><br></div><div>The above command finds a package with the name 'squirrel'. However, it may or may not be in a repository. <br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">_______________________________________________<br>
Pulp-list mailing list<br>
<a href="mailto:Pulp-list@redhat.com" target="_blank">Pulp-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-list" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/pulp-list</a></blockquote></div></div></div>