Mapping Methods for the JSON Protocol
All methods defined in the WSDL schema for the vSphere Web Services API can be
invoked by using a REST-like URL with the POST verb. The method name appends to the URL and
the method parameters appear as JSON in the body of the request.
Method names begin with an uppercase letter and match the method name in the vSphere Web
Services API Reference. All methods attach to a managed object reference, as in the SOAP
API.
For example, the
SessionManager
managed object has a method whose WSDL name is
AcquireLocalTicket
.The URL format that you use to invoke a
method is
https://vcenter_fqdn/sdk/vim25/8.0.1.0/mo_ref/method_name
For example, you invoke the
AcquireLocalTicket
method with a URL like this:When you POST a request to invoke a method on a managed object, the body of the request contains a single anonymous JSON object that specifies the parameter names and values. Unlike the SOAP request protocol, the JSON does not specify a reference to "this" because the managed object reference is in the URL path.https://vcenter_fqdn/sdk/vim25/8.0.1.0/SessionManager/SessionManager/AcquireLocalTicket
For example, the method
Folder.CreateFolder
requires a name for the new folder. The body
for that request would look similar to this:
{"name": "spare_VM_folder"}