public static final class MonitoredResource.Builder extends GeneratedMessageV3.Builder<MonitoredResource.Builder> implements MonitoredResourceOrBuilder
An object representing a resource that can be used for monitoring, logging,
billing, or other purposes. Examples include virtual machine instances,
databases, and storage devices such as disks. The type
field identifies a
MonitoredResourceDescriptor object
that describes the resource's schema. Information in the labels
field
identifies the actual resource and its attributes according to the schema.
For example, a particular Compute Engine VM instance could be represented by
the following object, because the
MonitoredResourceDescriptor for
"gce_instance"
has labels
"project_id"
, "instance_id"
and "zone"
:
{ "type": "gce_instance",
"labels": { "project_id": "my-project",
"instance_id": "12345678901234",
"zone": "us-central1-a" }}
Protobuf type google.api.MonitoredResource
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public MonitoredResource.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Overrides
build()
public MonitoredResource build()
buildPartial()
public MonitoredResource buildPartial()
clear()
public MonitoredResource.Builder clear()
Overrides
clearField(Descriptors.FieldDescriptor field)
public MonitoredResource.Builder clearField(Descriptors.FieldDescriptor field)
Overrides
clearLabels()
public MonitoredResource.Builder clearLabels()
clearOneof(Descriptors.OneofDescriptor oneof)
public MonitoredResource.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Overrides
clearType()
public MonitoredResource.Builder clearType()
Required. The monitored resource type. This field must match
the type
field of a
MonitoredResourceDescriptor
object. For example, the type of a Compute Engine VM instance is
gce_instance
. Some descriptors include the service name in the type; for
example, the type of a Datastream stream is
datastream.googleapis.com/Stream
.
string type = 1;
clone()
public MonitoredResource.Builder clone()
Overrides
containsLabels(String key)
public boolean containsLabels(String key)
Required. Values for all of the labels listed in the associated monitored
resource descriptor. For example, Compute Engine VM instances use the
labels "project_id"
, "instance_id"
, and "zone"
.
map<string, string> labels = 2;
Parameter |
Name |
Description |
key |
String
|
getDefaultInstanceForType()
public MonitoredResource getDefaultInstanceForType()
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Overrides
getLabels() (deprecated)
public Map<String,String> getLabels()
getLabelsCount()
public int getLabelsCount()
Required. Values for all of the labels listed in the associated monitored
resource descriptor. For example, Compute Engine VM instances use the
labels "project_id"
, "instance_id"
, and "zone"
.
map<string, string> labels = 2;
Returns |
Type |
Description |
int |
|
getLabelsMap()
public Map<String,String> getLabelsMap()
Required. Values for all of the labels listed in the associated monitored
resource descriptor. For example, Compute Engine VM instances use the
labels "project_id"
, "instance_id"
, and "zone"
.
map<string, string> labels = 2;
getLabelsOrDefault(String key, String defaultValue)
public String getLabelsOrDefault(String key, String defaultValue)
Required. Values for all of the labels listed in the associated monitored
resource descriptor. For example, Compute Engine VM instances use the
labels "project_id"
, "instance_id"
, and "zone"
.
map<string, string> labels = 2;
Returns |
Type |
Description |
String |
|
getLabelsOrThrow(String key)
public String getLabelsOrThrow(String key)
Required. Values for all of the labels listed in the associated monitored
resource descriptor. For example, Compute Engine VM instances use the
labels "project_id"
, "instance_id"
, and "zone"
.
map<string, string> labels = 2;
Parameter |
Name |
Description |
key |
String
|
Returns |
Type |
Description |
String |
|
getMutableLabels() (deprecated)
public Map<String,String> getMutableLabels()
Use alternate mutation accessors instead.
getType()
Required. The monitored resource type. This field must match
the type
field of a
MonitoredResourceDescriptor
object. For example, the type of a Compute Engine VM instance is
gce_instance
. Some descriptors include the service name in the type; for
example, the type of a Datastream stream is
datastream.googleapis.com/Stream
.
string type = 1;
Returns |
Type |
Description |
String |
The type.
|
getTypeBytes()
public ByteString getTypeBytes()
Required. The monitored resource type. This field must match
the type
field of a
MonitoredResourceDescriptor
object. For example, the type of a Compute Engine VM instance is
gce_instance
. Some descriptors include the service name in the type; for
example, the type of a Datastream stream is
datastream.googleapis.com/Stream
.
string type = 1;
Returns |
Type |
Description |
ByteString |
The bytes for type.
|
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
internalGetMapFieldReflection(int number)
protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter |
Name |
Description |
number |
int
|
Returns |
Type |
Description |
com.google.protobuf.MapFieldReflectionAccessor |
|
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
internalGetMutableMapFieldReflection(int number)
protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter |
Name |
Description |
number |
int
|
Returns |
Type |
Description |
com.google.protobuf.MapFieldReflectionAccessor |
|
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
isInitialized()
public final boolean isInitialized()
Overrides
mergeFrom(MonitoredResource other)
public MonitoredResource.Builder mergeFrom(MonitoredResource other)
public MonitoredResource.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Overrides
mergeFrom(Message other)
public MonitoredResource.Builder mergeFrom(Message other)
Parameter |
Name |
Description |
other |
Message
|
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final MonitoredResource.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Overrides
putAllLabels(Map<String,String> values)
public MonitoredResource.Builder putAllLabels(Map<String,String> values)
Required. Values for all of the labels listed in the associated monitored
resource descriptor. For example, Compute Engine VM instances use the
labels "project_id"
, "instance_id"
, and "zone"
.
map<string, string> labels = 2;
putLabels(String key, String value)
public MonitoredResource.Builder putLabels(String key, String value)
Required. Values for all of the labels listed in the associated monitored
resource descriptor. For example, Compute Engine VM instances use the
labels "project_id"
, "instance_id"
, and "zone"
.
map<string, string> labels = 2;
removeLabels(String key)
public MonitoredResource.Builder removeLabels(String key)
Required. Values for all of the labels listed in the associated monitored
resource descriptor. For example, Compute Engine VM instances use the
labels "project_id"
, "instance_id"
, and "zone"
.
map<string, string> labels = 2;
Parameter |
Name |
Description |
key |
String
|
setField(Descriptors.FieldDescriptor field, Object value)
public MonitoredResource.Builder setField(Descriptors.FieldDescriptor field, Object value)
Overrides
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public MonitoredResource.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Overrides
setType(String value)
public MonitoredResource.Builder setType(String value)
Required. The monitored resource type. This field must match
the type
field of a
MonitoredResourceDescriptor
object. For example, the type of a Compute Engine VM instance is
gce_instance
. Some descriptors include the service name in the type; for
example, the type of a Datastream stream is
datastream.googleapis.com/Stream
.
string type = 1;
Parameter |
Name |
Description |
value |
String
The type to set.
|
setTypeBytes(ByteString value)
public MonitoredResource.Builder setTypeBytes(ByteString value)
Required. The monitored resource type. This field must match
the type
field of a
MonitoredResourceDescriptor
object. For example, the type of a Compute Engine VM instance is
gce_instance
. Some descriptors include the service name in the type; for
example, the type of a Datastream stream is
datastream.googleapis.com/Stream
.
string type = 1;
Parameter |
Name |
Description |
value |
ByteString
The bytes for type to set.
|
setUnknownFields(UnknownFieldSet unknownFields)
public final MonitoredResource.Builder setUnknownFields(UnknownFieldSet unknownFields)
Overrides