class Google::Apis::OsconfigV1beta::Assignment

An assignment represents the group or groups of VM instances that the policy applies to. If an assignment is empty, it applies to all VM instances. Otherwise, the targeted VM instances must meet all the criteria specified. So if both labels and zones are specified, the policy applies to VM instances with those labels and in those zones.

Attributes

group_labels[RW]

Targets instances matching at least one of these label sets. This allows an assignment to target disparate groups, for example “env=prod or env=staging”. Corresponds to the JSON property `groupLabels` @return [Array<Google::Apis::OsconfigV1beta::AssignmentGroupLabel>]

instance_name_prefixes[RW]

Targets VM instances whose name starts with one of these prefixes. Like labels, this is another way to group VM instances when targeting configs, for example prefix=“prod-”. Only supported for project-level policies. Corresponds to the JSON property `instanceNamePrefixes` @return [Array<String>]

instances[RW]

Targets any of the instances specified. Instances are specified by their URI in the form `zones//instances/`. Instance targeting is uncommon and is supported to facilitate the management of changes by the instance or to target specific VM instances for development and testing. Only supported for project-level policies and must reference instances within this project. Corresponds to the JSON property `instances` @return [Array<String>]

os_types[RW]

Targets VM instances matching at least one of the following OS types. VM instances must match all supplied criteria for a given OsType to be included. Corresponds to the JSON property `osTypes` @return [Array<Google::Apis::OsconfigV1beta::AssignmentOsType>]

zones[RW]

Targets instances in any of these zones. Leave empty to target instances in any zone. Zonal targeting is uncommon and is supported to facilitate the management of changes by zone. Corresponds to the JSON property `zones` @return [Array<String>]

Public Class Methods

new(**args) click to toggle source
# File lib/google/apis/osconfig_v1beta/classes.rb, line 151
def initialize(**args)
   update!(**args)
end

Public Instance Methods

update!(**args) click to toggle source

Update properties of this object

# File lib/google/apis/osconfig_v1beta/classes.rb, line 156
def update!(**args)
  @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)
  @os_types = args[:os_types] if args.key?(:os_types)
  @zones = args[:zones] if args.key?(:zones)
end