1. Types
2. vcenter
3. vm

## vcenter VM: filter spec

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

### Representations:

- JSON
- XML

{
"clusters": [
"obj-103",
"obj-103"
],
"datacenters": [
"obj-103",
"obj-103"
],
"folders": [
"obj-103",
"obj-103"
],
"hosts": [
"obj-103",
"obj-103"
],
"names": [
"string",
"string"
],
"power_states": [
"POWERED_OFF",
"POWERED_OFF"
],
"resource_pools": [
"obj-103",
"obj-103"
],
"vms": [
"obj-103",
"obj-103"
]
}
<?xml version="1.0" ?>
<ns0:FilterSpec xmlns:ns0="http://vmware.com/vcenter/VM" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<power_states-array>
<array-item>POWERED_OFF</array-item>
<array-item>POWERED_OFF</array-item>
</power_states-array>
<resource_pools-array>
<array-item>obj-103</array-item>
<array-item>obj-103</array-item>
</resource_pools-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>
<vms-array>
<array-item>obj-103</array-item>
<array-item>obj-103</array-item>
</vms-array>
<folders-array>
<array-item>obj-103</array-item>
<array-item>obj-103</array-item>
</folders-array>
</ns0:FilterSpec>

#### Attributes:

Name | Type | Description
--- | --- | ---
Optional
vms | string[] | Identifiers of virtual machines that can match the filter. Optional. If unset or empty, virtual machines 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: `VirtualMachine`. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: `VirtualMachine`.
names | string[] | Names that virtual machines must have to match the filter (see vcenter.VM.info.name). Optional. If unset or empty, virtual machines with any name match the filter.
folders | string[] | Folders that must contain the virtual machine for the virtual machine to match the filter. Optional. If unset or empty, virtual machines 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 virtual machine for the virtual machine to match the filter. Optional. If unset or empty, virtual machines 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`.
hosts | string[] | Hosts that must contain the virtual machine for the virtual machine to match the filter. Optional. If unset or empty, virtual machines on any host 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`.
clusters | string[] | Clusters that must contain the virtual machine for the virtual machine to match the filter. Optional. If unset or empty, virtual machines in any cluster 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`.
resource_pools | string[] | Resource pools that must contain the virtual machine for the virtual machine to match the filter. Optional. If unset or empty, virtual machines in any resource pool match the filter.When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: `ResourcePool`. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: `ResourcePool`.
power_states | string[] | Power states that a virtual machine must be in to match the filter (see vcenter.vm.power.info.state. Optional. If unset or empty, virtual machines in any power state match the filter.