Class MonitoredResource

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 "instance_id" and "zone": { "type": "gce_instance", "labels": { "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
TypeDescription
int

TYPE_FIELD_NUMBER

public static final int TYPE_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static MonitoredResource getDefaultInstance()
Returns
TypeDescription
MonitoredResource

getDescriptor()

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

newBuilder()

public static MonitoredResource.Builder newBuilder()
Returns
TypeDescription
MonitoredResource.Builder

newBuilder(MonitoredResource prototype)

public static MonitoredResource.Builder newBuilder(MonitoredResource prototype)
Parameter
NameDescription
prototypeMonitoredResource
Returns
TypeDescription
MonitoredResource.Builder

parseDelimitedFrom(InputStream input)

public static MonitoredResource parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
MonitoredResource
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

public static MonitoredResource parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
MonitoredResource
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

public static MonitoredResource parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
MonitoredResource
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

public static MonitoredResource parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
MonitoredResource
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

public static MonitoredResource parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
MonitoredResource
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

public static Parser<MonitoredResource> parser()
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
boolean

equals(Object obj)

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

getDefaultInstanceForType()

public MonitoredResource getDefaultInstanceForType()
Returns
TypeDescription
MonitoredResource

getLabels()

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
keyString
defaultValueString
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
String

getParserForType()

public Parser<MonitoredResource> getParserForType()
Returns
TypeDescription
Parser<MonitoredResource>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
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.

string type = 1;

Returns
TypeDescription
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.

string type = 1;

Returns
TypeDescription
ByteString

The bytes for type.

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public MonitoredResource.Builder newBuilderForType()
Returns
TypeDescription
MonitoredResource.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected MonitoredResource.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
MonitoredResource.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public MonitoredResource.Builder toBuilder()
Returns
TypeDescription
MonitoredResource.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException