# Google Cloud OsConfig V1 Client - Class InstanceFilter (2.2.3)

2.2.3 (latest) 2.2.2 2.1.0 2.0.5 1.3.5 1.2.2 1.1.1 1.0.5 Reference documentation and code samples for the Google Cloud OsConfig V1 Client class InstanceFilter.

Filters to select target VMs for an assignment.

If more than one filter criteria is specified below, a VM will be selected
if and only if it satisfies all of them.

Generated from protobuf message `google.cloud.osconfig.v1.OSPolicyAssignment.InstanceFilter`

## Namespace

Google \\ Cloud \\ OsConfig \\ V1 \\ OSPolicyAssignment

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ all` | `bool` Target all VMs in the project. If true, no other criteria is permitted. |
| `↳ inclusion_labels` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicyAssignment.LabelSet>` List of label sets used for VM inclusion. If the list has more than one `LabelSet`, the VM is included if any of the label sets are applicable for the VM. |
| `↳ exclusion_labels` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicyAssignment.LabelSet>` List of label sets used for VM exclusion. If the list has more than one label set, the VM is excluded if any of the label sets are applicable for the VM. |
| `↳ inventories` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicyAssignment.InstanceFilter.Inventory>` List of inventories to select VMs. A VM is selected if its inventory data matches at least one of the following inventories. |

### getAll

Target all VMs in the project. If true, no other criteria is
permitted.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setAll

Target all VMs in the project. If true, no other criteria is
permitted.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getInclusionLabels

List of label sets used for VM inclusion.

If the list has more than one `LabelSet`, the VM is included if any
of the label sets are applicable for the VM.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicyAssignment.LabelSet>` |   |

### setInclusionLabels

List of label sets used for VM inclusion.

If the list has more than one `LabelSet`, the VM is included if any
of the label sets are applicable for the VM.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicyAssignment.LabelSet>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getExclusionLabels

List of label sets used for VM exclusion.

If the list has more than one label set, the VM is excluded if any
of the label sets are applicable for the VM.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicyAssignment.LabelSet>` |   |

### setExclusionLabels

List of label sets used for VM exclusion.

If the list has more than one label set, the VM is excluded if any
of the label sets are applicable for the VM.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicyAssignment.LabelSet>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getInventories

List of inventories to select VMs.

A VM is selected if its inventory data matches at least one of the
following inventories.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicyAssignment.InstanceFilter.Inventory>` |   |

### setInventories

List of inventories to select VMs.

A VM is selected if its inventory data matches at least one of the
following inventories.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-osconfig/latest/V1.OSPolicyAssignment.InstanceFilter.Inventory>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |