Control Through vCenter Server
Programs can control DataSets through a vCenter Server using the vSphere Automation
API (vAPI).
Methods are provided for managing DataSets, and for managing entries in a DataSet. These
methods can be run as REST operations, or from Java or Python programs. See developer.vmware.com for
complete information about the various vSphere Automation SDKs. Ruby, Perl, and .NET
bindings were deprecated but are still available as open source on Github.
DataSets have certain properties, called
attributes. Attributes include a description of the DataSet, access permissions from the
guest or host, and usage type. Attributes are assigned to each DataSet at create time,
and can be modified by an update.
In the following REST examples,
{server}
represents the vCenter Server that manages ESXi hosts
running VMs in a datacenter.Operations on a DataSet:
- create – create a new DataSet with specified attributesPOST https://{server}/api/vcenter/vm/{vm}/data-sets
- delete - delete a DataSetDELETE https://{server}/api/vcenter/vm/{vm}/data-sets/{DataSet}
- update – modify the attributes of a DataSetPATCH https://{server}/api/vcenter/vm/{vm}/data-sets/{DataSet}
- get – query the attributes of a DataSetGET https://{server}/api/vcenter/vm/{vm}/data-sets/{DataSet}
- list - list all DataSets in a VMGET https://{server}/api/vcenter/vm/{vm}/data-sets
Operations on DataSet entries:
- set - create or update an entry in a DataSetPUT https://{server}/api/vcenter/vm/{vm}/data-sets/{DataSet}/entries/{key}
- get - retrieve the value of an entry in a DataSetGET https://{server}/api/vcenter/vm/{vm}/data-sets/{DataSet}/entries/{key}
- delete - delete an entry in a DataSetDELETE https://{server}/api/vcenter/vm/{vm}/data-sets/{DataSet}/entries/{key}
- list - list all entry keys in a DataSetGET https://{server}/api/vcenter/vm/{vm}/data-sets/{DataSet}/entries
These REST operations communicate back and
forth in JSON, similar to the examples shown in the sections below.
For instruction and examples of REST
programming, see the
vSphere
Automation API Reference
on code.vmware.com.