Category Archives: vSphere

VMware vSphere SDKs explained

I currently manage the vSphere/VMware Cloud on AWS SDK team and I find that looking at the SDK’s page on VMware Code it can be a bit daunting to figure out exactly which SDK you might need. So, to clarify the landscape for vSphere specific SDKs a bit I thought I’d flesh out some of the unwritten details.

SDKs & Tools for Calling VMware SOAP API’s

As of this writing (June 2018) the bulk of VMware’s vSphere API’s are SOAP API’s which can be used from a variety of languages built using VMware’s WSDL including the Management SDK (for Java and .NET), the family of  “vmomi” tools: Pyvmomi, Govmomi, rbvmomi and last but not least the Perl SDK.

Ok, on to REST APIs…

SDKs for VMware REST APIs

Prior to the release of vSphere 6.5 in 2016, VMware released a set of “vCloud Suite *” SDK’s for use with the Tagging and Content Library REST API’s. With the release of 6.5 VMware created a new set of SDKs named “vSphere Automation SDK for *” where “*” is a language like Java, Python or Ruby. These new SDK’s were released on Github and are available here.

VMware Cloud on AWS APIs

At VMworld in 2017 VMware announced the release of VMware Cloud on AWS (VMC) and with it a new set of API’s for managing this new IaaS environment. As part of this expansion we’ve since added support for these API’s to the vSphere Automation SDK’s to include language bindings for the VMC Console API’s as well as NSX-T Policy API’s.

So there you have it. Hopefully, this helps explain some of the links on the SDK page the VMware {code} website.

Please post a comment with any questions.

VMware Automation SDK for Python API Reference Documentation

Accessing VMware vcenter REST API Authentication from curl

Here’s a simple example of calling the vSphere REST API using curl. These commands first authenticate to the API which creates a vmware-api-session-id cookie which is stored to cookie-jar.txt then makes a request to get a list of VMs:

curl -k -i -u administrator@vsphere.local:password -X POST -c cookie-jar.txt https://vcenter/rest/com/vmware/cis/session<br>
curl -k -i -b cookie-jar.txt https://vcenter/rest/vcenter/vm<br>

NOTE: Use with caution as your credentials will likely be caught in your command line history!

Here’s a related post on vSphere SDKs.

Check out the new VMware portal!