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_FIELD_NUMBER
public static final int TYPE_FIELD_NUMBER
Field Value
Static Methods
getDefaultInstance()
public static MonitoredResource getDefaultInstance()
Returns
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
newBuilder()
public static MonitoredResource.Builder newBuilder()
Returns
newBuilder(MonitoredResource prototype)
public static MonitoredResource.Builder newBuilder(MonitoredResource prototype)
Parameter
Returns
public static MonitoredResource parseDelimitedFrom(InputStream input)
Parameter
Returns
Exceptions
public static MonitoredResource parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static MonitoredResource parseFrom(byte[] data)
Parameter
Name | Description |
data | byte[]
|
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static MonitoredResource parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static MonitoredResource parseFrom(ByteString data)
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static MonitoredResource parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static MonitoredResource parseFrom(CodedInputStream input)
Parameter
Returns
Exceptions
public static MonitoredResource parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static MonitoredResource parseFrom(InputStream input)
Parameter
Returns
Exceptions
public static MonitoredResource parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static MonitoredResource parseFrom(ByteBuffer data)
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static MonitoredResource parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parser()
public static Parser<MonitoredResource> parser()
Returns
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
Returns
equals(Object obj)
public boolean equals(Object obj)
Parameter
Returns
Overrides
getDefaultInstanceForType()
public MonitoredResource getDefaultInstanceForType()
Returns
getLabels()
public Map<String,String> getLabels()
Returns
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
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
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
Returns
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
Returns
getParserForType()
public Parser<MonitoredResource> getParserForType()
Returns
Overrides
getSerializedSize()
public int getSerializedSize()
Returns
Overrides
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
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Returns
Overrides
hashCode()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
internalGetMapField(int number)
protected MapField internalGetMapField(int number)
Parameter
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
newBuilderForType()
public MonitoredResource.Builder newBuilderForType()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected MonitoredResource.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Returns
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Returns
Overrides
toBuilder()
public MonitoredResource.Builder toBuilder()
Returns
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Parameter
Overrides
Exceptions