Package com.google.cloud
Class MonitoredResource.Builder
java.lang.Object
com.google.cloud.MonitoredResource.Builder
- Enclosing class:
- MonitoredResource
A builder for
MonitoredResource objects.-
Method Summary
Modifier and TypeMethodDescriptionAdds a label to the labels of the monitored resource.build()Clears all the labels of the monitored resource.Sets the values for all the labels required by the corresponding monitored resource descriptor (seeMonitoredResourceDescriptor.getLabels().Sets the monitored resource type.
-
Method Details
-
setType
Sets the monitored resource type. This value must match the one ofMonitoredResourceDescriptor.getType()of aMonitoredResourceDescriptorobject. For example, the typecloudsql_databaserepresent databases in Google Cloud SQL. -
setLabels
Sets the values for all the labels required by the corresponding monitored resource descriptor (seeMonitoredResourceDescriptor.getLabels(). For example, Google Compute Engine VM instances use the labelsinstance_idandzone. -
addLabel
Adds a label to the labels of the monitored resource. -
clearLabels
Clears all the labels of the monitored resource. -
build
-