Documentation ¶
Index ¶
- Constants
- type Access
- type CreateSpec
- type Info
- type Manager
- func (c *Manager) CreateDataSet(ctx context.Context, vm string, spec *CreateSpec) (string, error)
- func (c *Manager) DeleteDataSet(ctx context.Context, vm string, dataSet string, force bool) error
- func (c *Manager) DeleteEntry(ctx context.Context, vm string, dataSet string, key string) error
- func (c *Manager) GetDataSet(ctx context.Context, vm string, dataSet string) (*Info, error)
- func (c *Manager) GetEntry(ctx context.Context, vm string, dataSet string, key string) (string, error)
- func (c *Manager) ListDataSets(ctx context.Context, vm string) ([]Summary, error)
- func (c *Manager) ListEntries(ctx context.Context, vm string, dataSet string) ([]string, error)
- func (c *Manager) SetEntry(ctx context.Context, vm string, dataSet string, key string, value string) error
- func (c *Manager) UpdateDataSet(ctx context.Context, vm string, dataSet string, spec *UpdateSpec) error
- type Summary
- type UpdateSpec
Constants ¶
const ( AccessNone = Access("NONE") AccessReadOnly = Access("READ_ONLY") AccessReadWrite = Access("READ_WRITE") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateSpec ¶
type CreateSpec struct { // Name should take the form "com.company.project" to avoid conflict with other uses. // Must not be empty. Name string `json:"name"` // Description of the data set. Description string `json:"description"` // Host controls access to the data set entries by the ESXi host and the vCenter. // For example, if the host access is set to NONE, the entries of this data set // will not be accessible through the vCenter API. // Must not be empty. Host Access `json:"host"` // Guest controls access to the data set entries by the guest OS of the VM (i.e. in-guest APIs). // For example, if the guest access is set to READ_ONLY, it will be forbidden // to create, delete, and update entries in this data set via the VMware Guest SDK. // Must not be empty. Guest Access `json:"guest"` // OmitFromSnapshotAndClone controls whether the data set is included in snapshots and clones of the VM. // When a VM is reverted to a snapshot, any data set with OmitFromSnapshotAndClone=true will be destroyed. // Default is false. OmitFromSnapshotAndClone *bool `json:"omit_from_snapshot_and_clone,omitempty"` }
Describes a data set to be created.
type Info ¶
type Info struct { Name string `json:"name"` Description string `json:"description"` Host Access `json:"host"` Guest Access `json:"guest"` Used int `json:"used"` OmitFromSnapshotAndClone bool `json:"omit_from_snapshot_and_clone"` }
Data set information.
type Manager ¶
Manager extends rest.Client, adding data set related methods.
Data sets functionality was introduced in vSphere 8.0, and requires the VM to have virtual hardware version 20 or newer.
See the VMware Guest SDK Programming Guide for details on using data sets from within the guest OS of a VM.
See https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/vm/data_sets/
func NewManager ¶
NewManager creates a new Manager instance with the given client.
func (*Manager) CreateDataSet ¶
CreateDataSet creates a data set associated with the given virtual machine.
func (*Manager) DeleteDataSet ¶
DeleteDataSet deletes an existing data set from the given virtual machine. The operation will fail if the data set is not empty. Set the force flag to delete a non-empty data set.
func (*Manager) DeleteEntry ¶
DeleteEntry removes an existing entry from the given data set.
func (*Manager) GetDataSet ¶
GetDataSet retrieves information about the given data set.
func (*Manager) GetEntry ¶
func (c *Manager) GetEntry(ctx context.Context, vm string, dataSet string, key string) (string, error)
GetEntry returns the value of the data set entry with the given key.
func (*Manager) ListDataSets ¶
ListDataSets returns a list of brief descriptions of the data sets on with the given virtual machine.
func (*Manager) ListEntries ¶
ListEntries returns a list of all entry keys in the given data set.
func (*Manager) SetEntry ¶
func (c *Manager) SetEntry(ctx context.Context, vm string, dataSet string, key string, value string) error
SetEntry creates or updates an entry in the given data set. If an entry with the given key already exists, it will be overwritten. The key can be at most 4096 bytes. The value can be at most 1MB.
func (*Manager) UpdateDataSet ¶
func (c *Manager) UpdateDataSet(ctx context.Context, vm string, dataSet string, spec *UpdateSpec) error
UpdateDataSet modifies the given data set.