List Host
Returns information about at most 2500 visible (subject to permission checks) hosts in vCenter matching the Host.FilterSpec.
Request
URLURL
Query Parameters
Query Parameters
Clusters that must contain the hosts for the hosts to match the filter. If unset or empty, hosts in any cluster and hosts that are not in a cluster match the filter. If this field is not empty and Host.FilterSpec.standalone is true, no hosts will match the filter. When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: ClusterComputeResource. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: ClusterComputeResource.
Connection states that a host must be in to match the filter (see Host.Summary.connection-state. If unset or empty, hosts in any connection state match the filter.
Datacenters that must contain the hosts for the hosts to match the filter. If unset or empty, hosts in any datacenter match the filter. When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: Datacenter. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: Datacenter.
Folders that must contain the hosts for the hosts to match the filter. If unset or empty, hosts in any folder match the filter. When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: Folder. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: Folder.
Identifiers of hosts that can match the filter. If unset or empty, hosts with any identifier match the filter. When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: HostSystem. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: HostSystem.
Names that hosts must have to match the filter (see Host.Summary.name). If unset or empty, hosts with any name match the filter.
If true, only hosts that are not part of a cluster can match the filter, and if false, only hosts that are are part of a cluster can match the filter. If unset Hosts can match filter independent of whether they are part of a cluster or not. If this field is true and Host.FilterSpec.clusters os not empty, no hosts will match the filter.
Header Parameters
Header Parameters
Required session ID, acquired from Create Session API under CIS product
vmware-api-session-id example
"b00db39f948d13ea1e59b4d6fce56389"
Authentication
Response
Response BodyResponse Body
array
of
HostSummary
of type application/json
Commonly used information about the hosts matching the Host.FilterSpec.
[
{
"connection_state": "CONNECTED",
"host": "string",
"name": "string",
"power_state": "POWERED_ON"
}
]
The Host.ConnectionState enumerated type defines the connection status of a host.
CONNECTED : Host is connected to the vCenter Server
DISCONNECTED : Host is disconnected from the vCenter Server
NOT_RESPONDING : VirtualCenter is not receiving heartbeats from the server. The state automatically changes to connected once heartbeats are received again.
Possible values are: CONNECTED , DISCONNECTED , NOT_RESPONDING
Identifier of the host. When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: HostSystem. When operations return a value of this structure as a result, the field will be an identifier for the resource type: HostSystem.
Name of the host.
The Host.PowerState enumerated type defines the power states of a host.
POWERED_ON : The host is powered on. A host that is entering standby mode is also in this state.
POWERED_OFF : The host was specifically powered off by the user through vCenter server. This state is not a cetain state, because after vCenter server issues the command to power off the host, the host might crash, or kill all the processes but fail to power off.
STANDBY : The host was specifically put in standby mode, either explicitly by the user, or automatically by DPM. This state is not a cetain state, because after VirtualCenter issues the command to put the host in standby state, the host might crash, or kill all the processes but fail to enter standby mode. A host that is exiting standby mode is also in this state.
Possible values are: POWERED_ON , POWERED_OFF , STANDBY
Errors
com.vmware.vapi.std.errors.invalid_argument : if the Host.FilterSpec.connection-states field contains a value that is not supported by the server.
com.vmware.vapi.std.errors.unauthorized : if the user doesn’t have the required privileges.
com.vmware.vapi.std.errors.unable_to_allocate_resource : if more than 2500 hosts match the Host.FilterSpec.
com.vmware.vapi.std.errors.service_unavailable : if the system is unable to communicate with a service to complete the request.
‘Default’ means this response is used for all HTTP codes that are not covered individually for this operation.
Code Samples
PowerCLI Client SDK Example
cURL Command
Vendor Extensions
x-vmw-doc-deprecated-method: get
x-vmw-doc-deprecated-path: /rest/vcenter/host
x-vmw-doc-operation: list