Reference For: developers

API: hosts

Operations of the hosts tag of the native REST API.

Host lifecycle (enter/exit maintenance mode)

POST /v1/clusters/{id}/hosts

Adds a pending (disconnected) host to a cluster. The agent on that machine registers with the join token and the same name to connect it.

CLI
kyvernon cluster add-host <id> --name <name>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the cluster (domain-cN)

Request body

application/json: AddHostRequest

NameTypeRequiredDescription
forceboolean or nullWhen true, return an existing same-name host instead of failing; a registered host in this cluster is reset (its certificate revoked) so its agent can join again with the join token.
managementAddressstring or nullOptional management address; defaults to name.
namestringyesHost display name / FQDN (must match the agent's hostname at join).

Responses

StatusDescriptionSchema
202Accepted: the body names the task to poll (GET /v1/tasks/{id}/wait)TaskRef
400Invalid argument; the error body names the fieldErrorBody
404Not found (or not visible to the caller)ErrorBody
409Conflict: the object exists, or expectedVersion is staleErrorBody

POST /v1/clusters/{id}/move-hosts

Moves hosts into a cluster (Host.Inventory.EditCluster on the cluster, Host.Inventory.MoveHost on each host). Each host must be in maintenance mode (error.host.not_in_maintenance) and have no virtual machines (error.host_has_vms). Runs as a task (ClusterComputeResource.moveInto).

CLI
kyvernon cluster move-hosts <id> <host>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the cluster (domain-cN)

Request body

application/json: MoveHostsRequest

NameTypeRequiredDescription
listarray of stringyesHost ids (host-N), each in maintenance mode and without virtual machines.

Responses

StatusDescriptionSchema
202Accepted: the body names the task to poll (GET /v1/tasks/{id}/wait)TaskRef
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/clusters/{id}/reconfigure

Reconfigures cluster HA / scheduler / migration policy (ReconfigureComputeResource_Task).

CLI
kyvernon cluster reconfigure <id> --ha-enabled true --max-bandwidth-mib-s 48

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the cluster (domain-cN)

Request body

application/json: ReconfigureClusterRequest

NameTypeRequiredDescription
allowPostcopyboolean or nullFlip Cluster.migration.allow_postcopy when set.
downtimeLimitMsinteger (int64) or nullSet Cluster.migration.downtime_limit_ms. Clear with modify=false.
haEnabledboolean or nullFlip Cluster.ha.enabled when set.
maxBandwidthMibSinteger (int64) or nullSet Cluster.migration.max_bandwidth_mib_s (MiB/s). Clear with modify=false.
modifybooleanMerge provided fields (default) or replace missing with false/cleared.
schedulerAutomaticboolean or nullFlip Cluster.scheduler.automatic when set.
schedulerEnabledboolean or nullFlip Cluster.scheduler.enabled when set.

Responses

StatusDescriptionSchema
202Accepted: the body names the task to poll (GET /v1/tasks/{id}/wait)TaskRef
400Invalid argument; the error body names the fieldErrorBody
404Not found (or not visible to the caller)ErrorBody

GET /v1/hosts/join-token

The join token and the controller endpoint a new host needs (Host.Inventory.AddHostToCluster on the root folder). 404 when the controller has no join token file.

CLI
kyvernon host join-token

Responses

StatusDescriptionSchema
200OKJoinTokenView
403Permission denied; args.privilege names the missing privilegeErrorBody
404Not found (or not visible to the caller)ErrorBody

DELETE /v1/hosts/{id}

Removes a host with no VMs placed on it (HostSystem.Destroy_Task).

CLI
kyvernon host destroy <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Responses

StatusDescriptionSchema
202Accepted: the body names the task to poll (GET /v1/tasks/{id}/wait)TaskRef
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/hosts/{id}/datastores

Creates a local, NFS, or VMFS datastore on the host (SOAP HostDatastoreSystem).

CLI
kyvernon host create-datastore <id> --type local --name <name> --path <path>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Request body

application/json: CreateHostDatastoreRequest

NameTypeRequiredDescription
accessModestring or nullreadWrite or readOnly (default readWrite).
diskstring or nullDisk key for VMFS create: WWID, naa.…, or device path.
namestringyesDatastore display name (CreateLocalDatastore.name / HostNasVolumeSpec.localPath / HostVmfsSpec.volumeName).
nfsTypestring or nullNFS or NFS41 (default NFS).
pathstring or nullAbsolute host path for a local datastore.
remoteHoststring or nullNFS server (CreateNasDatastore).
remotePathstring or nullNFS export path.
securityTypestring or nullNFS security flavour (default sys).
typestringyeslocal, nfs, or vmfs (SOAP CreateLocal / CreateNas / CreateVmfs).

Responses

StatusDescriptionSchema
201CreatedObjectView
400Invalid argument; the error body names the fieldErrorBody
404Not found (or not visible to the caller)ErrorBody
409Conflict: the object exists, or expectedVersion is staleErrorBody

DELETE /v1/hosts/{id}/datastores/{dsId}

Removes a datastore mounted on the host (SOAP RemoveDatastore).

CLI
kyvernon host remove-datastore <id> <ds-id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)
dsIdpathstringyesdatastore-N

Responses

StatusDescriptionSchema
204Done; no body
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/hosts/{id}/disconnect

Disconnects a host (HostSystem.DisconnectHost_Task). Heartbeats stay disconnected until reconnect.

CLI
kyvernon host disconnect <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Responses

StatusDescriptionSchema
202Accepted: the body names the task to poll (GET /v1/tasks/{id}/wait)TaskRef
404Not found (or not visible to the caller)ErrorBody

POST /v1/hosts/{id}/enter-maintenance

Puts a host into maintenance mode.

CLI
kyvernon host enter-maintenance <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Responses

StatusDescriptionSchema
202Accepted: the body names the task to poll (GET /v1/tasks/{id}/wait)TaskRef
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/hosts/{id}/exit-maintenance

Takes a host out of maintenance mode.

CLI
kyvernon host exit-maintenance <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Responses

StatusDescriptionSchema
202Accepted: the body names the task to poll (GET /v1/tasks/{id}/wait)TaskRef
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

GET /v1/hosts/{id}/iscsi

The software iSCSI configuration of a host: adapter, CHAP (without secrets), send and static targets, what the last rescan found (Host.Config.Storage on the host).

CLI
kyvernon host iscsi <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Responses

StatusDescriptionSchema
200OKIscsiConfigView
403Permission denied; args.privilege names the missing privilegeErrorBody
404Not found (or not visible to the caller)ErrorBody

PUT /v1/hosts/{id}/iscsi/authentication

Updates adapter-level or per-target CHAP (UpdateInternetScsiAuthenticationProperties).

CLI
kyvernon host set-iscsi-auth <id> --chap-enabled --chap-name <name> --chap-secret <secret>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Request body

application/json: IscsiAuthenticationRequest

NameTypeRequiredDescription
chapAuthEnabledbooleanyeschapAuthEnabled.
chapNamestring or nullchapName.
chapSecretstring or nullchapSecret (omit to reuse existing secret for the same name).
mutualChapAuthenticationTypestring or nullMutual CHAP type; omit / empty / chapProhibited disables mutual.
mutualChapNamestring or nullmutualChapName.
mutualChapSecretstring or nullmutualChapSecret.
targetSetIscsiTargetSetBody or null

Responses

StatusDescriptionSchema
204Done; no body
400Invalid argument; the error body names the fieldErrorBody
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/hosts/{id}/iscsi/rescan

Rescans one HBA (RescanHba); software iSCSI vmhba64 only.

CLI
kyvernon host rescan-iscsi <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Request body

application/json: IscsiRescanRequest

NameTypeRequiredDescription
hbaDevicestring or nullHBA device (vmhba64); defaults to the software iSCSI HBA.

Responses

StatusDescriptionSchema
204Done; no body
400Invalid argument; the error body names the fieldErrorBody
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

POST /v1/hosts/{id}/iscsi/rescan-all

Rescans every projected HBA (RescanAllHba).

CLI
kyvernon host rescan-all-iscsi <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Responses

StatusDescriptionSchema
204Done; no body
404Not found (or not visible to the caller)ErrorBody

POST /v1/hosts/{id}/iscsi/send-targets

Adds iSCSI send targets (AddInternetScsiSendTargets).

CLI
kyvernon host add-iscsi-send-targets <id> --address <addr>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Request body

application/json: IscsiSendTargetsRequest

NameTypeRequiredDescription
targetsarray of IscsiSendTargetBodyyesSend targets to add or remove.

Responses

StatusDescriptionSchema
204Done; no body
400Invalid argument; the error body names the fieldErrorBody
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

DELETE /v1/hosts/{id}/iscsi/send-targets

Removes iSCSI send targets (RemoveInternetScsiSendTargets).

CLI
kyvernon host remove-iscsi-send-targets <id> --address <addr>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Request body

application/json: IscsiSendTargetsRequest

NameTypeRequiredDescription
targetsarray of IscsiSendTargetBodyyesSend targets to add or remove.

Responses

StatusDescriptionSchema
204Done; no body
400Invalid argument; the error body names the fieldErrorBody
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

PUT /v1/hosts/{id}/iscsi/software

Enables or disables software iSCSI (UpdateSoftwareInternetScsiEnabled).

CLI
kyvernon host set-software-iscsi <id> --enabled

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Request body

application/json: SetSoftwareIscsiRequest

NameTypeRequiredDescription
enabledbooleanyesEnable or disable the software iSCSI initiator.

Responses

StatusDescriptionSchema
204Done; no body
404Not found (or not visible to the caller)ErrorBody

POST /v1/hosts/{id}/iscsi/static-targets

Adds iSCSI static targets (AddInternetScsiStaticTargets).

CLI
kyvernon host add-iscsi-static-targets <id> --address <addr> --iqn <iqn>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Request body

application/json: IscsiStaticTargetsRequest

NameTypeRequiredDescription
targetsarray of IscsiStaticTargetBodyyesStatic targets to add or remove.

Responses

StatusDescriptionSchema
204Done; no body
400Invalid argument; the error body names the fieldErrorBody
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

DELETE /v1/hosts/{id}/iscsi/static-targets

Removes iSCSI static targets (RemoveInternetScsiStaticTargets).

CLI
kyvernon host remove-iscsi-static-targets <id> --address <addr> --iqn <iqn>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Request body

application/json: IscsiStaticTargetsRequest

NameTypeRequiredDescription
targetsarray of IscsiStaticTargetBodyyesStatic targets to add or remove.

Responses

StatusDescriptionSchema
204Done; no body
400Invalid argument; the error body names the fieldErrorBody
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody

GET /v1/hosts/{id}/network-health

Host-bridge VLAN/MTU realisation health (ESX-N-17 / M1-NET-01).

CLI
kyvernon host network-health <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Responses

StatusDescriptionSchema
200OKNetworkHealthView
404Not found (or not visible to the caller)ErrorBody

GET /v1/hosts/{id}/network-hints

Lists LLDP/CDP neighbours for a host (HostNetworkSystem.QueryNetworkHint).

CLI
kyvernon host network-hints <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)
devicequerystring or nullOptional physical NIC device names (SOAP device; repeat device= or omit).

Responses

StatusDescriptionSchema
200OKNetworkHintsView
404Not found (or not visible to the caller)ErrorBody

POST /v1/hosts/{id}/reboot

Reboots a host. Needs Host.Config.Maintenance on the host and, without force, the host in maintenance mode (error.host.not_in_maintenance). The host's agent must declare the host-power capability (error.host_capability_missing).

CLI
kyvernon host reboot <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Request body

application/json: HostPowerRequest

NameTypeRequiredDescription
forcebooleanReboot or shut down although the host is not in maintenance mode (default false). Virtual machines that still run on the host stop with it.

Responses

StatusDescriptionSchema
202Accepted: the body names the task to poll (GET /v1/tasks/{id}/wait)TaskRef
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody
501The host agent cannot restart its machine (error.host_capability_missing)ErrorBody

POST /v1/hosts/{id}/reconnect

Clears an admin disconnect (HostSystem.ReconnectHost_Task).

CLI
kyvernon host reconnect <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Responses

StatusDescriptionSchema
202Accepted: the body names the task to poll (GET /v1/tasks/{id}/wait)TaskRef
404Not found (or not visible to the caller)ErrorBody

POST /v1/hosts/{id}/shutdown

Shuts a host down (powers the machine off). Same rules as reboot; the host stays off until someone powers it on (out-of-band management).

CLI
kyvernon host shutdown <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Request body

application/json: HostPowerRequest

NameTypeRequiredDescription
forcebooleanReboot or shut down although the host is not in maintenance mode (default false). Virtual machines that still run on the host stop with it.

Responses

StatusDescriptionSchema
202Accepted: the body names the task to poll (GET /v1/tasks/{id}/wait)TaskRef
404Not found (or not visible to the caller)ErrorBody
412Failed precondition; the error body says whichErrorBody
501The host agent cannot power its machine off (error.host_capability_missing)ErrorBody

GET /v1/hosts/{id}/vmfs-create-options

Lists VMFS create options for a disk (QueryVmfsDatastoreCreateOptions).

CLI
kyvernon host vmfs-create-options <id> --device-path <path>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)
devicePathquerystringyesDevice path, WWID, or naa.… (SOAP devicePath).

Responses

StatusDescriptionSchema
200OKarray of VmfsCreateOptionView
400Invalid argument; the error body names the fieldErrorBody
404Not found (or not visible to the caller)ErrorBody

GET /v1/hosts/{id}/vmfs-disks

Lists iSCSI LUNs available for VMFS create (QueryAvailableDisksForVmfs).

CLI
kyvernon host vmfs-disks <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the host (host-N)

Responses

StatusDescriptionSchema
200OKarray of VmfsDiskView
404Not found (or not visible to the caller)ErrorBody

Version 0.1.