vSphere 6.5 (released last week) introduces a new REST API providing a much more modern, simplified and developer-friendly API. The areas covered by the REST API are currently limited to vCenter Server Appliance (vCSA) management, Content Library and VM operations and lifecycle (check below for a more complete list). Also, to make our life easier, this new API is self-documented via an API Explorer embedded in the vCenter Server Appliance.
Browse to the root of your vCenter (https://[vCenter-IP-or-FQDN]) to reach the API Explorer, and click on the “Browse vSphere REST APIs” link on the right.
You can expand / collapse the various sections to get a clear and complete documentation on each API call: description, required fields, request body, detailed filter information, list of responses messages, and so on.
Doesn’t this interface looks familiar? Maybe because it uses the Swagger UI. 🙂
Have you noticed this “Try it out!” button?
You can manage the following areas from the REST API:
- VM Management (select ‘vcenter‘ API in the top drop down menu):
- VM creation and management
- VM power operations
- Virtual hardware management
- Virtual Datacenter Management (select ‘vcenter‘ API in the top drop down menu):
- Mostly read operations,
- Appliance configuration (select ‘appliance‘ API in the top drop down menu):
- Access (Shell, SSH, DCUI)
- Network configuration
- System settings (NTP and time settings, SNMP, power operations, etc.)
- Appliance health (select ‘appliance‘ API in the top drop down menu):
- Monitor system health (disk space, memory, load, databases, etc.)
- Monitor services
- Appliance backup and recovery (select ‘appliance‘ API in the top drop down menu)
- Content Library (select ‘content‘ API in the top drop down menu):
- Items management
- …and much more.
Don’t hesitate to have a look at the REST API Explorer, it’s very handy! 🙂