Class GuestPolicies.Assignment (2.5.2)

Stay organized with collections Save and categorize content based on your preferences.
public static final class GuestPolicies.Assignment extends GeneratedMessageV3 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 Fields

GROUP_LABELS_FIELD_NUMBER

public static final int GROUP_LABELS_FIELD_NUMBER
Field Value
TypeDescription
int

INSTANCES_FIELD_NUMBER

public static final int INSTANCES_FIELD_NUMBER
Field Value
TypeDescription
int

INSTANCE_NAME_PREFIXES_FIELD_NUMBER

public static final int INSTANCE_NAME_PREFIXES_FIELD_NUMBER
Field Value
TypeDescription
int

OS_TYPES_FIELD_NUMBER

public static final int OS_TYPES_FIELD_NUMBER
Field Value
TypeDescription
int

ZONES_FIELD_NUMBER

public static final int ZONES_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static GuestPolicies.Assignment getDefaultInstance()
Returns
TypeDescription
GuestPolicies.Assignment

getDescriptor()

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

newBuilder()

public static GuestPolicies.Assignment.Builder newBuilder()
Returns
TypeDescription
GuestPolicies.Assignment.Builder

newBuilder(GuestPolicies.Assignment prototype)

public static GuestPolicies.Assignment.Builder newBuilder(GuestPolicies.Assignment prototype)
Parameter
NameDescription
prototypeGuestPolicies.Assignment
Returns
TypeDescription
GuestPolicies.Assignment.Builder

parseDelimitedFrom(InputStream input)

public static GuestPolicies.Assignment parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
GuestPolicies.Assignment
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static GuestPolicies.Assignment parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GuestPolicies.Assignment
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static GuestPolicies.Assignment parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
GuestPolicies.Assignment
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static GuestPolicies.Assignment parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GuestPolicies.Assignment
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static GuestPolicies.Assignment parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
GuestPolicies.Assignment
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static GuestPolicies.Assignment parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GuestPolicies.Assignment
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static GuestPolicies.Assignment parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
GuestPolicies.Assignment
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static GuestPolicies.Assignment parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GuestPolicies.Assignment
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static GuestPolicies.Assignment parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
GuestPolicies.Assignment
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static GuestPolicies.Assignment parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GuestPolicies.Assignment
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static GuestPolicies.Assignment parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
GuestPolicies.Assignment
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static GuestPolicies.Assignment parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GuestPolicies.Assignment
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<GuestPolicies.Assignment> parser()
Returns
TypeDescription
Parser<Assignment>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

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

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

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