vCenter API Curl Hello World

Mindwatering Incorporated

Author: Tripp W Black

Created: 10/06 at 04:14 PM

 

Category:
VMWare
vCenter

Example:
$ curl -k -i -u administrator@vsphere.local:password -X POST -c cookie-jar.txt https://myvcenter.mindwatering.net/rest/com/vmware/cis/session
$ curl -k -i -b cookie-jar.txt https://myvcenter.mindwatering.net/rest/vcenter/vm

Notes:
Above saves the session cookie to cookie-jar.txt so it can then use the session authentication in the cookie for the second command.
The password will be in the recent command history for the user that runs this code.




previous page