Exploring new VCSA VAMI API w/PowerCLI
A very good series from William Lam about exploring the new VCSA VAMI API with PowerCLI.
One of the most most exciting developments in vSphere 6.5 with respect to Automation is the introduction of several new REST APIs included in the vCenter Server Appliance (VCSA). In addition to covering some of the existing capabilities like vSphere Content Library and Tagging, customers will now have access to a new basic Virtual Machine management API that has been greatly simplified compared to the traditional vSphere SOAP API and access to the VCSA’s Virtual Appliance Management Interface API, also known to most as the VAMI.
A short version of William’s series, here is Part 1:Before getting started, I wanted to mention some of the resources and tips/ricks that I have been using to get started with the new REST APIs:
Once connected, you can retrieve a list of API service endpoints by simply running the following:
You can also filter the results which includes the use of a wildcard character, which is quite nice. The example below will only show API service endpoints for everything under “com.vmware.appliance”:
For a given API endpoint, you can then retrieve the operations that are supported by piping the result to the Get-Method cmdlet (gm for short). Below is an example showing the methods for appliance/system/version which is just the get() method:
Part 2:In Part 2 of this series, its about how to monitor the health of your vCenter Server Appliance (VCSA) by retrieving some of the health metrics that are exposed by the Virtual Appliance Management Interface (VAMI).
Read the entire article here, Exploring new VCSA VAMI API w/PowerCLI
via the fine folks at opvizor.