Class Group.Builder (3.54.0)

public static final class Group.Builder extends GeneratedMessageV3.Builder<Group.Builder> implements GroupOrBuilder

The description of a dynamic collection of monitored resources. Each group has a filter that is matched against monitored resources and their associated metadata. If a group's filter matches an available monitored resource, then that resource is a member of that group. Groups can contain any number of monitored resources, and each monitored resource can be a member of any number of groups.

Groups can be nested in parent-child hierarchies. The parentName field identifies an optional parent for each group. If a group has a parent, then the only monitored resources available to be matched by the group's filter are the resources contained in the parent group. In other words, a group contains the monitored resources that match its filter and the filters of all the group's ancestors. A group without a parent can contain any monitored resource.

For example, consider an infrastructure running a set of instances with two user-defined tags: "environment" and "role". A parent group has a filter, environment="production". A child of that parent group has a filter, role="transcoder". The parent group contains all instances in the production environment, regardless of their roles. The child group contains instances that have the transcoder role and are in the production environment.

The monitored resources contained in a group can change at any moment, depending on what resources exist and what filters are associated with the group and its ancestors.

Protobuf type google.monitoring.v3.Group

Implements

GroupOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Group.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Group.Builder
Overrides

build()

public Group build()
Returns
Type Description
Group

buildPartial()

public Group buildPartial()
Returns
Type Description
Group

clear()

public Group.Builder clear()
Returns
Type Description
Group.Builder
Overrides

clearDisplayName()

public Group.Builder clearDisplayName()

A user-assigned name for this group, used only for display purposes.

string display_name = 2;

Returns
Type Description
Group.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Group.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Group.Builder
Overrides

clearFilter()

public Group.Builder clearFilter()

The filter used to determine which monitored resources belong to this group.

string filter = 5;

Returns
Type Description
Group.Builder

This builder for chaining.

clearIsCluster()

public Group.Builder clearIsCluster()

If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters.

bool is_cluster = 6;

Returns
Type Description
Group.Builder

This builder for chaining.

clearName()

public Group.Builder clearName()

Output only. The name of this group. The format is:

 projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]

When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique [GROUP_ID] that is generated automatically.

string name = 1;

Returns
Type Description
Group.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Group.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Group.Builder
Overrides

clearParentName()

public Group.Builder clearParentName()

The name of the group's parent, if it has one. The format is:

 projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]

For groups with no parent, parent_name is the empty string, "".

string parent_name = 3;

Returns
Type Description
Group.Builder

This builder for chaining.

clone()

public Group.Builder clone()
Returns
Type Description
Group.Builder
Overrides

getDefaultInstanceForType()

public Group getDefaultInstanceForType()
Returns
Type Description
Group

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getDisplayName()

public String getDisplayName()

A user-assigned name for this group, used only for display purposes.

string display_name = 2;

Returns
Type Description
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

A user-assigned name for this group, used only for display purposes.

string display_name = 2;

Returns
Type Description
ByteString

The bytes for displayName.

getFilter()

public String getFilter()

The filter used to determine which monitored resources belong to this group.

string filter = 5;

Returns
Type Description
String

The filter.

getFilterBytes()

public ByteString getFilterBytes()

The filter used to determine which monitored resources belong to this group.

string filter = 5;

Returns
Type Description
ByteString

The bytes for filter.

getIsCluster()

public boolean getIsCluster()

If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters.

bool is_cluster = 6;

Returns
Type Description
boolean

The isCluster.

getName()

public String getName()

Output only. The name of this group. The format is:

 projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]

When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique [GROUP_ID] that is generated automatically.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Output only. The name of this group. The format is:

 projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]

When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique [GROUP_ID] that is generated automatically.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getParentName()

public String getParentName()

The name of the group's parent, if it has one. The format is:

 projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]

For groups with no parent, parent_name is the empty string, "".

string parent_name = 3;

Returns
Type Description
String

The parentName.

getParentNameBytes()

public ByteString getParentNameBytes()

The name of the group's parent, if it has one. The format is:

 projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]

For groups with no parent, parent_name is the empty string, "".

string parent_name = 3;

Returns
Type Description
ByteString

The bytes for parentName.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Group other)

public Group.Builder mergeFrom(Group other)
Parameter
Name Description
other Group
Returns
Type Description
Group.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Group.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Group.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Group.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Group.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Group.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Group.Builder
Overrides

setDisplayName(String value)

public Group.Builder setDisplayName(String value)

A user-assigned name for this group, used only for display purposes.

string display_name = 2;

Parameter
Name Description
value String

The displayName to set.

Returns
Type Description
Group.Builder

This builder for chaining.

setDisplayNameBytes(ByteString value)

public Group.Builder setDisplayNameBytes(ByteString value)

A user-assigned name for this group, used only for display purposes.

string display_name = 2;

Parameter
Name Description
value ByteString

The bytes for displayName to set.

Returns
Type Description
Group.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Group.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Group.Builder
Overrides

setFilter(String value)

public Group.Builder setFilter(String value)

The filter used to determine which monitored resources belong to this group.

string filter = 5;

Parameter
Name Description
value String

The filter to set.

Returns
Type Description
Group.Builder

This builder for chaining.

setFilterBytes(ByteString value)

public Group.Builder setFilterBytes(ByteString value)

The filter used to determine which monitored resources belong to this group.

string filter = 5;

Parameter
Name Description
value ByteString

The bytes for filter to set.

Returns
Type Description
Group.Builder

This builder for chaining.

setIsCluster(boolean value)

public Group.Builder setIsCluster(boolean value)

If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters.

bool is_cluster = 6;

Parameter
Name Description
value boolean

The isCluster to set.

Returns
Type Description
Group.Builder

This builder for chaining.

setName(String value)

public Group.Builder setName(String value)

Output only. The name of this group. The format is:

 projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]

When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique [GROUP_ID] that is generated automatically.

string name = 1;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
Group.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Group.Builder setNameBytes(ByteString value)

Output only. The name of this group. The format is:

 projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]

When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique [GROUP_ID] that is generated automatically.

string name = 1;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
Group.Builder

This builder for chaining.

setParentName(String value)

public Group.Builder setParentName(String value)

The name of the group's parent, if it has one. The format is:

 projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]

For groups with no parent, parent_name is the empty string, "".

string parent_name = 3;

Parameter
Name Description
value String

The parentName to set.

Returns
Type Description
Group.Builder

This builder for chaining.

setParentNameBytes(ByteString value)

public Group.Builder setParentNameBytes(ByteString value)

The name of the group's parent, if it has one. The format is:

 projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]

For groups with no parent, parent_name is the empty string, "".

string parent_name = 3;

Parameter
Name Description
value ByteString

The bytes for parentName to set.

Returns
Type Description
Group.Builder

This builder for chaining.

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

public Group.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Group.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Group.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Group.Builder
Overrides