Google Cloud OsConfig V1 Client - Class PatchInstanceFilter (2.0.1)

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 message google.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.

↳ group_labels array<PatchInstanceFilter\GroupLabel>

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 form zones/[ZONE]/instances/[INSTANCE_NAME], projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME], or https://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.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setGroupLabels

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

Parameter
Name Description
var array<PatchInstanceFilter\GroupLabel>
Returns
Type Description
$this

getZones

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

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setZones

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 form zones/[ZONE]/instances/[INSTANCE_NAME], projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME], or https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setInstances

Targets any of the VM instances specified. Instances are specified by their URI in the form zones/[ZONE]/instances/[INSTANCE_NAME], projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME], or https://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-".

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setInstanceNamePrefixes

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-".

Parameter
Name Description
var string[]
Returns
Type Description
$this