Google Cloud OsConfig V1 Client - Class PatchInstanceFilter (1.1.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
NameDescription
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<Google\Cloud\OsConfig\V1\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
TypeDescription
bool

setAll

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

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getGroupLabels

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

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setGroupLabels

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

Parameter
NameDescription
var array<Google\Cloud\OsConfig\V1\PatchInstanceFilter\GroupLabel>
Returns
TypeDescription
$this

getZones

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

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setZones

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

Parameter
NameDescription
var string[]
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string[]
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string[]
Returns
TypeDescription
$this