Understanding thevSphere
Automation API
vSphere
Automation
APIYou can use the
vSphere
Automation
REST services to automate many aspects of your vSphere environment such as configuration, authentication, certificate management, tagging, managing the life cycle of clusters, content libraries, Kubernetes cluster management, and many more.How Does thevSphere
Automation API Work
vSphere
Automation
API WorkThe
vSphere
Automation
API follows a resource-based REST architecture with JavaScript Object Notation (JSON) requests and responses. REST, an acronym for Representational State Transfer, is a software architectural style in which programs use the Hypertext Transfer Protocol (HTTP) to exchange serialized representations of objects between a client and a server. The client sends an HTTP request and receives an HTTP response from the server. Request and response bodies are encoded using JSON, and must conform to the JSON schema associated with each operation.The
vSphere
Automation
API uses the main CRUD (Create, Retrieve, Update, Delete) functions over HTTP to manage representations of the objects that the API defines. In thevSphere
Automation
API, these objects are represented by a collection of JSON schemas. You use:
- HTTP GET to retrieve a representation of an object
- HTTP POST to create an object
- HTTP PATCH or PUT to modify an object
- HTTP DELETE to delete an object
The HTTP verbs are also called methods. Each API operation is identified by a method and a URL. Operations can also contain a body that is composed of one or more data structures. The operation body contains parameters that are structured as key-value pairs. For more information, see vSphere Automation API Requests.
ThevSphere
Automation API in Context
vSphere
Automation
API in ContextTo take full advantage of the
vSphere
Automation
API, you must understand the broader context in which it functions.vCenter Server Automation Architecture

- vSphere AutomationAPI: the REST API for vSphere Management
- The underlying platform of thevSphere AutomationAPI is vSphere, which consists ofvCenter ServerandESXi. ThevSphere AutomationAPI is available to all licensed vSphere users.Starting with vSphere 6.0, VMware introduced thevSphere AutomationAPI to supplement the SOAP-based vSphere Web Services API. Since then, VMware engineers have been designing new vSphere features with a RESTful approach and these new services have been integrated into thevSphere AutomationAPI. As a result, you can now use thevSphere AutomationAPI to manage and automate many aspects of your vSphere environment such asvCenter Serverconfiguration, authentication, tagging, content libraries, managing the life cycle of clusters, managing internal and external certificates,vSphere Trust Authority,vSphere Supervisor, and so on.However, you cannot manage all aspects of your vSphere environment with thevSphere AutomationAPI as it does not cover all vSphere features. To expose the full set of vSphere functionalities you must use both thevSphere AutomationAPI and the vSphere Web Services API. For both APIs, VMware has compiled SDKs that help programmers automate tasks.
- vSphere Web Services API: the SOAP API for vSphere Management
- The vSphere Web Services API, which is based on the SOAP protocol, provides basic vSphere functionalities such as host management, virtual machine provisioning, monitoring,vSANand many more. It uses port 443 and the/sdkand/sdk/vim25base paths. The vSphere Web Services API can be consumed through:
- the vSphere Management SDK for Java
- the Python SDK for managing vSphere (pyVmomi)
- the Virtual Infrastructure JSON APIStarting in vSphere version 8.0.1, you can communicate with the vSphere Web Services API by using HTTP and JSON. For more information, see thevSphere Web Services SDK Programming Guide.
- customer generated bindings from the WSDL files included in the vSphere Management SDK
- vSphere AutomationAPI Ports
- ThevSphere AutomationAPI uses the standard HTTPS network port 443. A subset of thevSphere AutomationAPI related to appliance configuration and life cycle is available also on port 5480. You can use the services on port 5480 immediately after installingvCenter Serverand during life cycle and configuration operations when the services on port 443 are unavailable.
- vSphere AutomationAPI Base Paths
- All existing and non-deprecated HTTP operations of thevSphere AutomationAPI are available on port 443 and the/apibase path. The APIs released up to vSphere version 7.0.2 are also available on the deprecated/restbase path. The/apibase path will remain the only active base path when the/restbase path is removed in a future vSphere release.
- vSphere AutomationAPI Security
- ThevSphere AutomationREST APIs are designed with security best practices in mind. The HTTP link between the client application and thevSphere AutomationAPI is established through the Transport Layer Security (TLS) cryptographic protocol. User identity security is guaranteed by token-based authentication and by the OAuth 2.0 workflows for federated authentication.
- SDKs for thevSphere AutomationAPI
- VMware supports open-source SDKs that empower developers to consume thevSphere AutomationAPI through a programming language. ThevSphere Automation SDK for Javaand thevSphere Automation SDK for Pythoncontain tools, libraries, documentation, and sample code for vSphere automation. Both SDKs are based on the JSON-RPC protocol. You can download or contribute to the vSphere Automation SDKs on GitHub.
- vSphere Automation Tools
- Automation tools such asPowerCLI, Data Center CLI (DCLI), andvRealize Orchestratorprovide another option for consuming the vSphere APIs. For example, you can usePowerCLIand thevSphere Automation SDK for PowerShellto communicate directly with thevSphere AutomationAPI by using PowerShell scripts. For more information, see thePowerCLI User's Guide.
- User Interface Tools
- User interface tools such as thevSphere Clientand the vCenter Server Management Interface consume thevSphere AutomationAPI and the vSphere Web Services API in the back end.
Which REST Clients to Use with thevSphere
Automation API
vSphere
Automation
API- Client Applications for REST
- You can use any REST client to communicate with thevSphere AutomationAPI.Some popular applications are:
- cURL - http://curl.haxx.se
- Postman - https://www.getpostman.com/
- jq parser - https://stedolan.github.io/jq/
- API Explorer in thevSphere Client
- Use the API Explorer, a built-in tool in thevSphere Client, to explore and try out vSphere APIs.
Why Use thevSphere
Automation API Through REST
vSphere
Automation
API Through RESTYou can choose whether to access the
vSphere
Automation
API directly through REST or through the various SDKs and automation tools binded to the API.Possible use cases for using the
vSphere
Automation
API through REST:- There is no SDK available for your programming language. For example, you use PHP, JavaScript, Swift, Rust, and so on.
- Your integration footprint is small and you can't justify the overhead of installing and maintaining thevSphere AutomationSDKs for Java or Python. For example, if you are designing a client application that fetches a few parameters from your vSphere environment, you might decide that installing and maintaining the Java or Python SDKs is unnecessary.