Definitely helpful, thanks Adam! curl's immensely useful when working on REST apps.
With Candlepin, you can also identify as a consumer using the certificates returned when you register:
--key /etc/pki/consumer/key.pem --cert /etc/pki/consumer/cert.pem
Some examples from my command history:
Unbind: curl -k -u admin:admin -X delete https://localhost:8443/candlepin/entitlements/1
Unregister: curl -k -u admin:admin -X delete https://localhost/candlepin/consumers/d23667bb-21d7-4809-b187-1503174226f5
Data import: curl -k -u admin:admin -F upload=@export.zip https://localhost:8443/candlepin/owners/1/import
Cheers,
Devan
On Thu, Jul 22, 2010 at 4:25 PM, Adam Young ayoung@redhat.com wrote:
As I was working on FreeIPA, I found myself wanting to test the JSON API from the command line. Took a lilttle trial and error.
http://adam.younglogic.com/?p=897
Here's the end result
curl -v \ -H "Content-Type:application/json" \ -H "Accept:applicaton/json"\ --negotiate -u : \ --cacert /etc/ipa/ca.crt \ -d '{"method":"user_find","params":[[""],{}],"id":0}' \ -X POST https://%60hostname%60/ipa/json
The one neat thing about this write up is that it uses kinit and kerberos, and handles doing ssl with ca certs correctly. Not sure if this will help either effort, or if this is old news, but I figured it couldn't hurt to share. _______________________________________________ candlepin mailing list candlepin@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/candlepin