1. Types
2. vcenter
3. host

## vcenter host: filter spec

The `filter_spec` structure contains fields used to filter the results when listing hosts (see list). If multiple fields are specified, only hosts matching all of the fields match the filter.

### Representations:

- JSON
- XML

{
"clusters": [
"obj-103",
"obj-103"
],
"connection_states": [
"CONNECTED",
"CONNECTED"
],
"datacenters": [
"obj-103",
"obj-103"
],
"folders": [
"obj-103",
"obj-103"
],
"hosts": [
"obj-103",
"obj-103"
],
"names": [
"string",
"string"
],
"standalone": true
}
<?xml version="1.0" ?>
<ns0:FilterSpec xmlns:ns0="http://vmware.com/vcenter/host" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<connection_states-array>
<array-item>CONNECTED</array-item>
<array-item>CONNECTED</array-item>
</connection_states-array>
<clusters-array>
<array-item>obj-103</array-item>
<array-item>obj-103</array-item>
</clusters-array>
<datacenters-array>
<array-item>obj-103</array-item>
<array-item>obj-103</array-item>
</datacenters-array>
<names-array>
<array-item>string</array-item>
<array-item>string</array-item>
</names-array>
<hosts-array>
<array-item>obj-103</array-item>
<array-item>obj-103</array-item>
</hosts-array>
<folders-array>
<array-item>obj-103</array-item>
<array-item>obj-103</array-item>
</folders-array>
<standalone>true</standalone>
</ns0:FilterSpec>

#### Attributes:

Name | Type | Description
--- | --- | ---
Optional
hosts | string[] | Identifiers of hosts that can match the filter. Optional. 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 | string[] | Names that hosts must have to match the filter (see vcenter.host.summary.name). Optional. If unset or empty, hosts with any name match the filter.
folders | string[] | Folders that must contain the hosts for the hosts to match the filter. Optional. 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`.
datacenters | string[] | Datacenters that must contain the hosts for the hosts to match the filter. Optional. 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`.
standalone | boolean | 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. Optional. If unset Hosts can match filter independent of whether they are part of a cluster or not. If this field is true and vcenter.host.filter_spec.clusters os not empty, no hosts will match the filter.
clusters | string[] | Clusters that must contain the hosts for the hosts to match the filter. Optional. 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 vcenter.host.filter_spec.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 | string[] | Connection states that a host must be in to match the filter (see vcenter.host.summary.connection_state. Optional. If unset or empty, hosts in any connection state match the filter.