PatchInstanceFilter

A filter to target VM instances for patching. The targeted VMs must meet all criteria specified. So if both labels and zones are specified, the patch job targets only VMs with those labels and in those zones.

JSON representation
{"all":boolean,"groupLabels":[{object (GroupLabel)}],"zones":[string],"instances":[string],"instanceNamePrefixes":[string]}
Fields
all

boolean

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

groupLabels[]

object (GroupLabel)

Targets VM instances matching ANY of these GroupLabels. This allows targeting of disparate groups of VM instances.

zones[]

string

Targets VM instances in ANY of these zones. Leave empty to target VM instances in any zone.

instances[]

string

Targets any of the VM instances specified. Instances are specified by their URI in the formzones/[ZONE]/instances/[INSTANCE_NAME],projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME], orhttps://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]

instanceNamePrefixes[]

string

Targets VMs whose name starts with one of these prefixes. Similar to labels, this is another way to group VMs when targeting configs, for example prefix="prod-".

GroupLabel

Targets a group of VM instances by using theirassigned labels. Labels are key-value pairs. AGroupLabel 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 followingGroupLabel:{"env":"test", "app":"web"}. This means that the patch job is applied to VMs that have both the labelsenv=test andapp=web.

JSON representation
{"labels":{string:string,...}}
Fields
labels

map (key: string, value: string)

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

An object containing a list of"key": value pairs. Example:{ "name": "wrench", "mass": "1.3kg", "count": "3" }.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-28 UTC.