public final class MonitoredResource extends Object implements Serializable
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, the monitored resource for Google Compute Engine VM instances has gce_instance
type and specifies values for the labels instance_id
and zone
to
identify particular VM instances.
Modifier and Type | Class and Description |
---|---|
static class |
MonitoredResource.Builder
A builder for
MonitoredResource objects. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
static MonitoredResource |
fromPb(com.google.api.MonitoredResource descriptorPb) |
Map<String,String> |
getLabels()
Returns the values for all the labels required by the corresponding monitored resource
descriptor (see
MonitoredResourceDescriptor.getLabels() . |
String |
getType()
Returns the monitored resource type.
|
int |
hashCode() |
static MonitoredResource.Builder |
newBuilder(String type)
Returns a builder for
MonitoredResource objects given the resource's type. |
static MonitoredResource |
of(String type,
Map<String,String> labels)
Creates a
MonitoredResource object given the resource's type and labels. |
MonitoredResource.Builder |
toBuilder()
Returns a builder for this
MonitoredResource object. |
com.google.api.MonitoredResource |
toPb() |
String |
toString() |
public String getType()
MonitoredResourceDescriptor.getType()
of a MonitoredResourceDescriptor
object. For
example, the type cloudsql_database
represent databases in Google Cloud SQL.public Map<String,String> getLabels()
MonitoredResourceDescriptor.getLabels()
. For example, Google Compute
Engine VM instances use the labels instance_id
and zone
.public com.google.api.MonitoredResource toPb()
public MonitoredResource.Builder toBuilder()
MonitoredResource
object.public static MonitoredResource.Builder newBuilder(String type)
MonitoredResource
objects given the resource's type.public static MonitoredResource of(String type, Map<String,String> labels)
MonitoredResource
object given the resource's type and labels.public static MonitoredResource fromPb(com.google.api.MonitoredResource descriptorPb)
Copyright © 2019 Google LLC. All rights reserved.