Class GuestPolicies.Assignment.Builder (2.22.0)

public static final class GuestPolicies.Assignment.Builder extends GeneratedMessageV3.Builder<GuestPolicies.Assignment.Builder> implements GuestPolicies.AssignmentOrBuilder

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.

Protobuf type google.cloud.osconfig.v1beta.Assignment

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllGroupLabels(Iterable<? extends GuestPolicies.Assignment.GroupLabel> values)

public GuestPolicies.Assignment.Builder addAllGroupLabels(Iterable<? extends GuestPolicies.Assignment.GroupLabel> values)

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

repeated .google.cloud.osconfig.v1beta.Assignment.GroupLabel group_labels = 1;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.osconfig.v1beta.GuestPolicies.Assignment.GroupLabel>
Returns
TypeDescription
GuestPolicies.Assignment.Builder

addAllInstanceNamePrefixes(Iterable<String> values)

public GuestPolicies.Assignment.Builder addAllInstanceNamePrefixes(Iterable<String> values)

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.

repeated string instance_name_prefixes = 4;

Parameter
NameDescription
valuesIterable<String>

The instanceNamePrefixes to add.

Returns
TypeDescription
GuestPolicies.Assignment.Builder

This builder for chaining.

addAllInstances(Iterable<String> values)

public GuestPolicies.Assignment.Builder addAllInstances(Iterable<String> values)

Targets any of the instances specified. Instances are specified by their URI in the form zones/[ZONE]/instances/[INSTANCE_NAME].

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.

repeated string instances = 3;

Parameter
NameDescription
valuesIterable<String>

The instances to add.

Returns
TypeDescription
GuestPolicies.Assignment.Builder

This builder for chaining.

addAllOsTypes(Iterable<? extends GuestPolicies.Assignment.OsType> values)

public GuestPolicies.Assignment.Builder addAllOsTypes(Iterable<? extends GuestPolicies.Assignment.OsType> values)

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.

repeated .google.cloud.osconfig.v1beta.Assignment.OsType os_types = 5;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.osconfig.v1beta.GuestPolicies.Assignment.OsType>
Returns
TypeDescription
GuestPolicies.Assignment.Builder

addAllZones(Iterable<String> values)

public GuestPolicies.Assignment.Builder addAllZones(Iterable<String> values)

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.

repeated string zones = 2;

Parameter
NameDescription
valuesIterable<String>

The zones to add.

Returns
TypeDescription
GuestPolicies.Assignment.Builder

This builder for chaining.

addGroupLabels(GuestPolicies.Assignment.GroupLabel value)

public GuestPolicies.Assignment.Builder addGroupLabels(GuestPolicies.Assignment.GroupLabel value)

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

repeated .google.cloud.osconfig.v1beta.Assignment.GroupLabel group_labels = 1;

Parameter
NameDescription
valueGuestPolicies.Assignment.GroupLabel
Returns
TypeDescription
GuestPolicies.Assignment.Builder

addGroupLabels(GuestPolicies.Assignment.GroupLabel.Builder builderForValue)

public GuestPolicies.Assignment.Builder addGroupLabels(GuestPolicies.Assignment.GroupLabel.Builder builderForValue)

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

repeated .google.cloud.osconfig.v1beta.Assignment.GroupLabel group_labels = 1;

Parameter
NameDescription
builderForValueGuestPolicies.Assignment.GroupLabel.Builder
Returns
TypeDescription
GuestPolicies.Assignment.Builder

addGroupLabels(int index, GuestPolicies.Assignment.GroupLabel value)

public GuestPolicies.Assignment.Builder addGroupLabels(int index, GuestPolicies.Assignment.GroupLabel value)

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

repeated .google.cloud.osconfig.v1beta.Assignment.GroupLabel group_labels = 1;

Parameters
NameDescription
indexint
valueGuestPolicies.Assignment.GroupLabel
Returns
TypeDescription
GuestPolicies.Assignment.Builder

addGroupLabels(int index, GuestPolicies.Assignment.GroupLabel.Builder builderForValue)

public GuestPolicies.Assignment.Builder addGroupLabels(int index, GuestPolicies.Assignment.GroupLabel.Builder builderForValue)

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

repeated .google.cloud.osconfig.v1beta.Assignment.GroupLabel group_labels = 1;

Parameters
NameDescription
indexint
builderForValueGuestPolicies.Assignment.GroupLabel.Builder
Returns
TypeDescription
GuestPolicies.Assignment.Builder

addGroupLabelsBuilder()

public GuestPolicies.Assignment.GroupLabel.Builder addGroupLabelsBuilder()

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

repeated .google.cloud.osconfig.v1beta.Assignment.GroupLabel group_labels = 1;

Returns
TypeDescription
GuestPolicies.Assignment.GroupLabel.Builder

addGroupLabelsBuilder(int index)

public GuestPolicies.Assignment.GroupLabel.Builder addGroupLabelsBuilder(int index)

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

repeated .google.cloud.osconfig.v1beta.Assignment.GroupLabel group_labels = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
GuestPolicies.Assignment.GroupLabel.Builder

addInstanceNamePrefixes(String value)

public GuestPolicies.Assignment.Builder addInstanceNamePrefixes(String value)

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.

repeated string instance_name_prefixes = 4;

Parameter
NameDescription
valueString

The instanceNamePrefixes to add.

Returns
TypeDescription
GuestPolicies.Assignment.Builder

This builder for chaining.

addInstanceNamePrefixesBytes(ByteString value)

public GuestPolicies.Assignment.Builder addInstanceNamePrefixesBytes(ByteString value)

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.

repeated string instance_name_prefixes = 4;

Parameter
NameDescription
valueByteString

The bytes of the instanceNamePrefixes to add.

Returns
TypeDescription
GuestPolicies.Assignment.Builder

This builder for chaining.

addInstances(String value)

public GuestPolicies.Assignment.Builder addInstances(String value)

Targets any of the instances specified. Instances are specified by their URI in the form zones/[ZONE]/instances/[INSTANCE_NAME].

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.

repeated string instances = 3;

Parameter
NameDescription
valueString

The instances to add.

Returns
TypeDescription
GuestPolicies.Assignment.Builder

This builder for chaining.

addInstancesBytes(ByteString value)

public GuestPolicies.Assignment.Builder addInstancesBytes(ByteString value)

Targets any of the instances specified. Instances are specified by their URI in the form zones/[ZONE]/instances/[INSTANCE_NAME].

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.

repeated string instances = 3;

Parameter
NameDescription
valueByteString

The bytes of the instances to add.

Returns
TypeDescription
GuestPolicies.Assignment.Builder

This builder for chaining.

addOsTypes(GuestPolicies.Assignment.OsType value)

public GuestPolicies.Assignment.Builder addOsTypes(GuestPolicies.Assignment.OsType value)

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.

repeated .google.cloud.osconfig.v1beta.Assignment.OsType os_types = 5;

Parameter
NameDescription
valueGuestPolicies.Assignment.OsType
Returns
TypeDescription
GuestPolicies.Assignment.Builder

addOsTypes(GuestPolicies.Assignment.OsType.Builder builderForValue)

public GuestPolicies.Assignment.Builder addOsTypes(GuestPolicies.Assignment.OsType.Builder builderForValue)

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.

repeated .google.cloud.osconfig.v1beta.Assignment.OsType os_types = 5;

Parameter
NameDescription
builderForValueGuestPolicies.Assignment.OsType.Builder
Returns
TypeDescription
GuestPolicies.Assignment.Builder

addOsTypes(int index, GuestPolicies.Assignment.OsType value)

public GuestPolicies.Assignment.Builder addOsTypes(int index, GuestPolicies.Assignment.OsType value)

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.

repeated .google.cloud.osconfig.v1beta.Assignment.OsType os_types = 5;

Parameters
NameDescription
indexint
valueGuestPolicies.Assignment.OsType
Returns
TypeDescription
GuestPolicies.Assignment.Builder

addOsTypes(int index, GuestPolicies.Assignment.OsType.Builder builderForValue)

public GuestPolicies.Assignment.Builder addOsTypes(int index, GuestPolicies.Assignment.OsType.Builder builderForValue)

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.

repeated .google.cloud.osconfig.v1beta.Assignment.OsType os_types = 5;

Parameters
NameDescription
indexint
builderForValueGuestPolicies.Assignment.OsType.Builder
Returns
TypeDescription
GuestPolicies.Assignment.Builder

addOsTypesBuilder()

public GuestPolicies.Assignment.OsType.Builder addOsTypesBuilder()

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.

repeated .google.cloud.osconfig.v1beta.Assignment.OsType os_types = 5;

Returns
TypeDescription
GuestPolicies.Assignment.OsType.Builder

addOsTypesBuilder(int index)

public GuestPolicies.Assignment.OsType.Builder addOsTypesBuilder(int index)

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.

repeated .google.cloud.osconfig.v1beta.Assignment.OsType os_types = 5;

Parameter
NameDescription
indexint
Returns
TypeDescription
GuestPolicies.Assignment.OsType.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public GuestPolicies.Assignment.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
GuestPolicies.Assignment.Builder
Overrides

addZones(String value)

public GuestPolicies.Assignment.Builder addZones(String value)

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.

repeated string zones = 2;

Parameter
NameDescription
valueString

The zones to add.

Returns
TypeDescription
GuestPolicies.Assignment.Builder

This builder for chaining.

addZonesBytes(ByteString value)

public GuestPolicies.Assignment.Builder addZonesBytes(ByteString value)

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.

repeated string zones = 2;

Parameter
NameDescription
valueByteString

The bytes of the zones to add.

Returns
TypeDescription
GuestPolicies.Assignment.Builder

This builder for chaining.

build()

public GuestPolicies.Assignment build()
Returns
TypeDescription
GuestPolicies.Assignment

buildPartial()

public GuestPolicies.Assignment buildPartial()
Returns
TypeDescription
GuestPolicies.Assignment

clear()

public GuestPolicies.Assignment.Builder clear()
Returns
TypeDescription
GuestPolicies.Assignment.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public GuestPolicies.Assignment.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
GuestPolicies.Assignment.Builder
Overrides

clearGroupLabels()

public GuestPolicies.Assignment.Builder clearGroupLabels()

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

repeated .google.cloud.osconfig.v1beta.Assignment.GroupLabel group_labels = 1;

Returns
TypeDescription
GuestPolicies.Assignment.Builder

clearInstanceNamePrefixes()

public GuestPolicies.Assignment.Builder clearInstanceNamePrefixes()

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.

repeated string instance_name_prefixes = 4;

Returns
TypeDescription
GuestPolicies.Assignment.Builder

This builder for chaining.

clearInstances()

public GuestPolicies.Assignment.Builder clearInstances()

Targets any of the instances specified. Instances are specified by their URI in the form zones/[ZONE]/instances/[INSTANCE_NAME].

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.

repeated string instances = 3;

Returns
TypeDescription
GuestPolicies.Assignment.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public GuestPolicies.Assignment.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
GuestPolicies.Assignment.Builder
Overrides

clearOsTypes()

public GuestPolicies.Assignment.Builder clearOsTypes()

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.

repeated .google.cloud.osconfig.v1beta.Assignment.OsType os_types = 5;

Returns
TypeDescription
GuestPolicies.Assignment.Builder

clearZones()

public GuestPolicies.Assignment.Builder clearZones()

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.

repeated string zones = 2;

Returns
TypeDescription
GuestPolicies.Assignment.Builder

This builder for chaining.

clone()

public GuestPolicies.Assignment.Builder clone()
Returns
TypeDescription
GuestPolicies.Assignment.Builder
Overrides

getDefaultInstanceForType()

public GuestPolicies.Assignment getDefaultInstanceForType()
Returns
TypeDescription
GuestPolicies.Assignment

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getGroupLabels(int index)

public GuestPolicies.Assignment.GroupLabel getGroupLabels(int index)

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

repeated .google.cloud.osconfig.v1beta.Assignment.GroupLabel group_labels = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
GuestPolicies.Assignment.GroupLabel

getGroupLabelsBuilder(int index)

public GuestPolicies.Assignment.GroupLabel.Builder getGroupLabelsBuilder(int index)

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

repeated .google.cloud.osconfig.v1beta.Assignment.GroupLabel group_labels = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
GuestPolicies.Assignment.GroupLabel.Builder

getGroupLabelsBuilderList()

public List<GuestPolicies.Assignment.GroupLabel.Builder> getGroupLabelsBuilderList()

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

repeated .google.cloud.osconfig.v1beta.Assignment.GroupLabel group_labels = 1;

Returns
TypeDescription
List<Builder>

getGroupLabelsCount()

public int getGroupLabelsCount()

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

repeated .google.cloud.osconfig.v1beta.Assignment.GroupLabel group_labels = 1;

Returns
TypeDescription
int

getGroupLabelsList()

public List<GuestPolicies.Assignment.GroupLabel> getGroupLabelsList()

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

repeated .google.cloud.osconfig.v1beta.Assignment.GroupLabel group_labels = 1;

Returns
TypeDescription
List<GroupLabel>

getGroupLabelsOrBuilder(int index)

public GuestPolicies.Assignment.GroupLabelOrBuilder getGroupLabelsOrBuilder(int index)

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

repeated .google.cloud.osconfig.v1beta.Assignment.GroupLabel group_labels = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
GuestPolicies.Assignment.GroupLabelOrBuilder

getGroupLabelsOrBuilderList()

public List<? extends GuestPolicies.Assignment.GroupLabelOrBuilder> getGroupLabelsOrBuilderList()

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

repeated .google.cloud.osconfig.v1beta.Assignment.GroupLabel group_labels = 1;

Returns
TypeDescription
List<? extends com.google.cloud.osconfig.v1beta.GuestPolicies.Assignment.GroupLabelOrBuilder>

getInstanceNamePrefixes(int index)

public String getInstanceNamePrefixes(int index)

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.

repeated string instance_name_prefixes = 4;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The instanceNamePrefixes at the given index.

getInstanceNamePrefixesBytes(int index)

public ByteString getInstanceNamePrefixesBytes(int index)

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.

repeated string instance_name_prefixes = 4;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the instanceNamePrefixes at the given index.

getInstanceNamePrefixesCount()

public int getInstanceNamePrefixesCount()

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.

repeated string instance_name_prefixes = 4;

Returns
TypeDescription
int

The count of instanceNamePrefixes.

getInstanceNamePrefixesList()

public ProtocolStringList getInstanceNamePrefixesList()

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.

repeated string instance_name_prefixes = 4;

Returns
TypeDescription
ProtocolStringList

A list containing the instanceNamePrefixes.

getInstances(int index)

public String getInstances(int index)

Targets any of the instances specified. Instances are specified by their URI in the form zones/[ZONE]/instances/[INSTANCE_NAME].

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.

repeated string instances = 3;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The instances at the given index.

getInstancesBytes(int index)

public ByteString getInstancesBytes(int index)

Targets any of the instances specified. Instances are specified by their URI in the form zones/[ZONE]/instances/[INSTANCE_NAME].

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.

repeated string instances = 3;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the instances at the given index.

getInstancesCount()

public int getInstancesCount()

Targets any of the instances specified. Instances are specified by their URI in the form zones/[ZONE]/instances/[INSTANCE_NAME].

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.

repeated string instances = 3;

Returns
TypeDescription
int

The count of instances.

getInstancesList()

public ProtocolStringList getInstancesList()

Targets any of the instances specified. Instances are specified by their URI in the form zones/[ZONE]/instances/[INSTANCE_NAME].

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.

repeated string instances = 3;

Returns
TypeDescription
ProtocolStringList

A list containing the instances.

getOsTypes(int index)

public GuestPolicies.Assignment.OsType getOsTypes(int index)

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.

repeated .google.cloud.osconfig.v1beta.Assignment.OsType os_types = 5;

Parameter
NameDescription
indexint
Returns
TypeDescription
GuestPolicies.Assignment.OsType

getOsTypesBuilder(int index)

public GuestPolicies.Assignment.OsType.Builder getOsTypesBuilder(int index)

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.

repeated .google.cloud.osconfig.v1beta.Assignment.OsType os_types = 5;

Parameter
NameDescription
indexint
Returns
TypeDescription
GuestPolicies.Assignment.OsType.Builder

getOsTypesBuilderList()

public List<GuestPolicies.Assignment.OsType.Builder> getOsTypesBuilderList()

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.

repeated .google.cloud.osconfig.v1beta.Assignment.OsType os_types = 5;

Returns
TypeDescription
List<Builder>

getOsTypesCount()

public int getOsTypesCount()

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.

repeated .google.cloud.osconfig.v1beta.Assignment.OsType os_types = 5;

Returns
TypeDescription
int

getOsTypesList()

public List<GuestPolicies.Assignment.OsType> getOsTypesList()

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.

repeated .google.cloud.osconfig.v1beta.Assignment.OsType os_types = 5;

Returns
TypeDescription
List<OsType>

getOsTypesOrBuilder(int index)

public GuestPolicies.Assignment.OsTypeOrBuilder getOsTypesOrBuilder(int index)

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.

repeated .google.cloud.osconfig.v1beta.Assignment.OsType os_types = 5;

Parameter
NameDescription
indexint
Returns
TypeDescription
GuestPolicies.Assignment.OsTypeOrBuilder

getOsTypesOrBuilderList()

public List<? extends GuestPolicies.Assignment.OsTypeOrBuilder> getOsTypesOrBuilderList()

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.

repeated .google.cloud.osconfig.v1beta.Assignment.OsType os_types = 5;

Returns
TypeDescription
List<? extends com.google.cloud.osconfig.v1beta.GuestPolicies.Assignment.OsTypeOrBuilder>

getZones(int index)

public String getZones(int index)

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.

repeated string zones = 2;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The zones at the given index.

getZonesBytes(int index)

public ByteString getZonesBytes(int index)

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.

repeated string zones = 2;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the zones at the given index.

getZonesCount()

public int getZonesCount()

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.

repeated string zones = 2;

Returns
TypeDescription
int

The count of zones.

getZonesList()

public ProtocolStringList getZonesList()

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.

repeated string zones = 2;

Returns
TypeDescription
ProtocolStringList

A list containing the zones.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(GuestPolicies.Assignment other)

public GuestPolicies.Assignment.Builder mergeFrom(GuestPolicies.Assignment other)
Parameter
NameDescription
otherGuestPolicies.Assignment
Returns
TypeDescription
GuestPolicies.Assignment.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public GuestPolicies.Assignment.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GuestPolicies.Assignment.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public GuestPolicies.Assignment.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
GuestPolicies.Assignment.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final GuestPolicies.Assignment.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
GuestPolicies.Assignment.Builder
Overrides

removeGroupLabels(int index)

public GuestPolicies.Assignment.Builder removeGroupLabels(int index)

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

repeated .google.cloud.osconfig.v1beta.Assignment.GroupLabel group_labels = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
GuestPolicies.Assignment.Builder

removeOsTypes(int index)

public GuestPolicies.Assignment.Builder removeOsTypes(int index)

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.

repeated .google.cloud.osconfig.v1beta.Assignment.OsType os_types = 5;

Parameter
NameDescription
indexint
Returns
TypeDescription
GuestPolicies.Assignment.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public GuestPolicies.Assignment.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
GuestPolicies.Assignment.Builder
Overrides

setGroupLabels(int index, GuestPolicies.Assignment.GroupLabel value)

public GuestPolicies.Assignment.Builder setGroupLabels(int index, GuestPolicies.Assignment.GroupLabel value)

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

repeated .google.cloud.osconfig.v1beta.Assignment.GroupLabel group_labels = 1;

Parameters
NameDescription
indexint
valueGuestPolicies.Assignment.GroupLabel
Returns
TypeDescription
GuestPolicies.Assignment.Builder

setGroupLabels(int index, GuestPolicies.Assignment.GroupLabel.Builder builderForValue)

public GuestPolicies.Assignment.Builder setGroupLabels(int index, GuestPolicies.Assignment.GroupLabel.Builder builderForValue)

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

repeated .google.cloud.osconfig.v1beta.Assignment.GroupLabel group_labels = 1;

Parameters
NameDescription
indexint
builderForValueGuestPolicies.Assignment.GroupLabel.Builder
Returns
TypeDescription
GuestPolicies.Assignment.Builder

setInstanceNamePrefixes(int index, String value)

public GuestPolicies.Assignment.Builder setInstanceNamePrefixes(int index, String value)

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.

repeated string instance_name_prefixes = 4;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The instanceNamePrefixes to set.

Returns
TypeDescription
GuestPolicies.Assignment.Builder

This builder for chaining.

setInstances(int index, String value)

public GuestPolicies.Assignment.Builder setInstances(int index, String value)

Targets any of the instances specified. Instances are specified by their URI in the form zones/[ZONE]/instances/[INSTANCE_NAME].

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.

repeated string instances = 3;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The instances to set.

Returns
TypeDescription
GuestPolicies.Assignment.Builder

This builder for chaining.

setOsTypes(int index, GuestPolicies.Assignment.OsType value)

public GuestPolicies.Assignment.Builder setOsTypes(int index, GuestPolicies.Assignment.OsType value)

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.

repeated .google.cloud.osconfig.v1beta.Assignment.OsType os_types = 5;

Parameters
NameDescription
indexint
valueGuestPolicies.Assignment.OsType
Returns
TypeDescription
GuestPolicies.Assignment.Builder

setOsTypes(int index, GuestPolicies.Assignment.OsType.Builder builderForValue)

public GuestPolicies.Assignment.Builder setOsTypes(int index, GuestPolicies.Assignment.OsType.Builder builderForValue)

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.

repeated .google.cloud.osconfig.v1beta.Assignment.OsType os_types = 5;

Parameters
NameDescription
indexint
builderForValueGuestPolicies.Assignment.OsType.Builder
Returns
TypeDescription
GuestPolicies.Assignment.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public GuestPolicies.Assignment.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
GuestPolicies.Assignment.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final GuestPolicies.Assignment.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
GuestPolicies.Assignment.Builder
Overrides

setZones(int index, String value)

public GuestPolicies.Assignment.Builder setZones(int index, String value)

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.

repeated string zones = 2;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The zones to set.

Returns
TypeDescription
GuestPolicies.Assignment.Builder

This builder for chaining.