vCenter REST API

A new feature introduced in vSphere 6.5 is a REST API, which is a more modern, more straightforward-to-use, and more developer-friendly vSphere API. Compared to the capabilities provided by the vSphere API, at the time of writing, not all functions are supported by the REST API. However, compared to vSphere 6.5, the range of supported functions has been extended significantly.

Embedded in the vCSA, there is an API Explorer that allows you to access the documentation of the new REST APIs.

Access your vCSA at the address https://<VCSA_IP>/apiexplorer to reach the API Explorer and click on the Select API drop-down menu to select the available endpoints, as shown in the following screenshot:

To get the complete documentation on a specific API (description, required fields, request body, and more), click the Show/Hide option to expand the available sections. For example, to reset a running VM, I can use the following URL:

https://vcsa-lab.learnvmware.local/rest/vcenter/vm/Linux-Prod3/power/reset

The whole command for CURL is as follows:

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'vmware-api-session-id: 7d884f11981fbd6e7b383ca737277834' 'https://vcsa-lab.learnvmware.local/rest/vcenter/vm/Linux-Prod3/power/reset'
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.55.14