Class MonitoredResource (2.49.0)

public final class MonitoredResource extends GeneratedMessageV3 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

Static Fields

LABELS_FIELD_NUMBER

public static final int LABELS_FIELD_NUMBER
Field Value
Type Description
int

TYPE_FIELD_NUMBER

public static final int TYPE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static MonitoredResource getDefaultInstance()
Returns
Type Description
MonitoredResource

getDescriptor()

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

newBuilder()

public static MonitoredResource.Builder newBuilder()
Returns
Type Description
MonitoredResource.Builder

newBuilder(MonitoredResource prototype)

public static MonitoredResource.Builder newBuilder(MonitoredResource prototype)
Parameter
Name Description
prototype MonitoredResource
Returns
Type Description
MonitoredResource.Builder

parseDelimitedFrom(InputStream input)

public static MonitoredResource parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
MonitoredResource
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static MonitoredResource parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
MonitoredResource
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static MonitoredResource parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
MonitoredResource
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static MonitoredResource parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
MonitoredResource
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static MonitoredResource parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
MonitoredResource
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static MonitoredResource parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
MonitoredResource
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static MonitoredResource parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
MonitoredResource
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static MonitoredResource parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
MonitoredResource
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static MonitoredResource parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
MonitoredResource
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static MonitoredResource parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
MonitoredResource
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static MonitoredResource parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
MonitoredResource
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static MonitoredResource parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
MonitoredResource
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<MonitoredResource> parser()
Returns
Type Description
Parser<MonitoredResource>

Methods

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
Returns
Type Description
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public MonitoredResource getDefaultInstanceForType()
Returns
Type Description
MonitoredResource

getLabels() (deprecated)

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
Type Description
Map<String,String>

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;

Returns
Type Description
Map<String,String>

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;

Parameters
Name Description
key String
defaultValue String
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

getParserForType()

public Parser<MonitoredResource> getParserForType()
Returns
Type Description
Parser<MonitoredResource>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getType()

public String 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.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
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.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public MonitoredResource.Builder newBuilderForType()
Returns
Type Description
MonitoredResource.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected MonitoredResource.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
MonitoredResource.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public MonitoredResource.Builder toBuilder()
Returns
Type Description
MonitoredResource.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException