# Google Cloud OsConfig V1 Client - Class GroupLabel (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 GroupLabel.

Targets a group of VM instances by using their [assigned
labels](https://cloud.google.com/compute/docs/labeling-resources). Labels
are key-value pairs. A `GroupLabel` is a combination of labels
that is used to target VMs for a patch job.

For example, a patch job can target VMs that have the following
`GroupLabel`: `{"env":"test", "app":"web"}`. This means that the patch job
is applied to VMs that have both the labels `env=test` and `app=web`.

Generated from protobuf message `google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel`

## Namespace

Google \\ Cloud \\ OsConfig \\ V1 \\ PatchInstanceFilter

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Compute Engine instance labels that must be present for a VM instance to be targeted by this filter. |

### getLabels

Compute Engine instance labels that must be present for a VM
instance to be targeted by this filter.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setLabels

Compute Engine instance labels that must be present for a VM
instance to be targeted by this filter.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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