Class: Google::Apis::OsconfigV1beta::PatchInstanceFilter

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/osconfig_v1beta/classes.rb,
lib/google/apis/osconfig_v1beta/representations.rb,
lib/google/apis/osconfig_v1beta/representations.rb

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ PatchInstanceFilter

Returns a new instance of PatchInstanceFilter.



1260
1261
1262
# File 'lib/google/apis/osconfig_v1beta/classes.rb', line 1260

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#allBoolean Also known as: all?

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

Returns:

  • (Boolean)


1229
1230
1231
# File 'lib/google/apis/osconfig_v1beta/classes.rb', line 1229

def all
  @all
end

#group_labelsArray<Google::Apis::OsconfigV1beta::PatchInstanceFilterGroupLabel>

Targets VM instances matching at least one of these label sets. This allows targeting of disparate groups, for example "env=prod or env=staging". Corresponds to the JSON property groupLabels



1236
1237
1238
# File 'lib/google/apis/osconfig_v1beta/classes.rb', line 1236

def group_labels
  @group_labels
end

#instance_name_prefixesArray<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-". Corresponds to the JSON property instanceNamePrefixes

Returns:

  • (Array<String>)


1243
1244
1245
# File 'lib/google/apis/osconfig_v1beta/classes.rb', line 1243

def instance_name_prefixes
  @instance_name_prefixes
end

#instancesArray<String>

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] Corresponds to the JSON property instances

Returns:

  • (Array<String>)


1252
1253
1254
# File 'lib/google/apis/osconfig_v1beta/classes.rb', line 1252

def instances
  @instances
end

#zonesArray<String>

Targets VM instances in ANY of these zones. Leave empty to target VM instances in any zone. Corresponds to the JSON property zones

Returns:

  • (Array<String>)


1258
1259
1260
# File 'lib/google/apis/osconfig_v1beta/classes.rb', line 1258

def zones
  @zones
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1265
1266
1267
1268
1269
1270
1271
# File 'lib/google/apis/osconfig_v1beta/classes.rb', line 1265

def update!(**args)
  @all = args[:all] if args.key?(:all)
  @group_labels = args[:group_labels] if args.key?(:group_labels)
  @instance_name_prefixes = args[:instance_name_prefixes] if args.key?(:instance_name_prefixes)
  @instances = args[:instances] if args.key?(:instances)
  @zones = args[:zones] if args.key?(:zones)
end