Reference documentation and code samples for the Google Cloud OsConfig V1 Client class 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.
Generated from protobuf messagegoogle.cloud.osconfig.v1.PatchInstanceFilter
Namespace
Google \ Cloud \ OsConfig \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ all
bool
Target all VM instances in the project. If true, no other criteria is permitted.
Targets VM instances matching ANY of these GroupLabels. This allows targeting of disparate groups of VM instances.
↳ zones
array
Targets VM instances in ANY of these zones. Leave empty to target VM instances in any zone.
↳ instances
array
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]
↳ instance_name_prefixes
array
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-".
getAll
Target all VM instances in the project. If true, no other criteria is
permitted.
Returns
Type
Description
bool
setAll
Target all VM instances in the project. If true, no other criteria is
permitted.
Parameter
Name
Description
var
bool
Returns
Type
Description
$this
getGroupLabels
Targets VM instances matching ANY of these GroupLabels. This allows
targeting of disparate groups of VM instances.
Targets VM instances in ANY of these zones. Leave empty to target VM
instances in any zone.
Parameter
Name
Description
var
string[]
Returns
Type
Description
$this
getInstances
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]
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]
Parameter
Name
Description
var
string[]
Returns
Type
Description
$this
getInstanceNamePrefixes
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-".
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-".
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud OsConfig V1 Client - Class PatchInstanceFilter (2.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.0 (latest)](/php/docs/reference/cloud-osconfig/latest/V1.PatchInstanceFilter)\n- [2.0.5](/php/docs/reference/cloud-osconfig/2.0.5/V1.PatchInstanceFilter)\n- [1.3.5](/php/docs/reference/cloud-osconfig/1.3.5/V1.PatchInstanceFilter)\n- [1.2.2](/php/docs/reference/cloud-osconfig/1.2.2/V1.PatchInstanceFilter)\n- [1.1.1](/php/docs/reference/cloud-osconfig/1.1.1/V1.PatchInstanceFilter)\n- [1.0.5](/php/docs/reference/cloud-osconfig/1.0.5/V1.PatchInstanceFilter) \nReference documentation and code samples for the Google Cloud OsConfig V1 Client class PatchInstanceFilter.\n\nA filter to target VM instances for patching. The targeted\nVMs must meet all criteria specified. So if both labels and zones are\nspecified, the patch job targets only VMs with those labels and in those\nzones.\n\nGenerated from protobuf message `google.cloud.osconfig.v1.PatchInstanceFilter`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ OsConfig \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getAll\n\nTarget all VM instances in the project. If true, no other criteria is\npermitted.\n\n### setAll\n\nTarget all VM instances in the project. If true, no other criteria is\npermitted.\n\n### getGroupLabels\n\nTargets VM instances matching ANY of these GroupLabels. This allows\ntargeting of disparate groups of VM instances.\n\n### setGroupLabels\n\nTargets VM instances matching ANY of these GroupLabels. This allows\ntargeting of disparate groups of VM instances.\n\n### getZones\n\nTargets VM instances in ANY of these zones. Leave empty to target VM\ninstances in any zone.\n\n### setZones\n\nTargets VM instances in ANY of these zones. Leave empty to target VM\ninstances in any zone.\n\n### getInstances\n\nTargets any of the VM instances specified. Instances are specified by their\nURI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`,\n`projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]`, or\n`https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]`\n\n### setInstances\n\nTargets any of the VM instances specified. Instances are specified by their\nURI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`,\n`projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]`, or\n`https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]`\n\n### getInstanceNamePrefixes\n\nTargets VMs whose name starts with one of these prefixes. Similar to\nlabels, this is another way to group VMs when targeting configs, for\nexample prefix=\"prod-\".\n\n### setInstanceNamePrefixes\n\nTargets VMs whose name starts with one of these prefixes. Similar to\nlabels, this is another way to group VMs when targeting configs, for\nexample prefix=\"prod-\"."]]