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.
{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
attributes
POST https://{server}/api/vcenter/vm/{vm}/data-sets
- delete - delete a
DataSet
DELETE https://{server}/api/vcenter/vm/{vm}/data-sets/{DataSet}
- update – modify the attributes of a
DataSet
PATCH https://{server}/api/vcenter/vm/{vm}/data-sets/{DataSet}
- get – query the attributes of a
DataSet
GET https://{server}/api/vcenter/vm/{vm}/data-sets/{DataSet}
- list - list all DataSets in a
VM
GET https://{server}/api/vcenter/vm/{vm}/data-sets
Operations on DataSet entries:
- set - create or update an entry in
a
DataSet
PUT https://{server}/api/vcenter/vm/{vm}/data-sets/{DataSet}/entries/{key}
- get - retrieve the value of an
entry in a
DataSet
GET https://{server}/api/vcenter/vm/{vm}/data-sets/{DataSet}/entries/{key}
- delete - delete an entry in a
DataSet
DELETE https://{server}/api/vcenter/vm/{vm}/data-sets/{DataSet}/entries/{key}
- list - list all entry keys in a
DataSet
GET 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.