Class AlertPolicy.Condition.Builder (3.56.0)

public static final class AlertPolicy.Condition.Builder extends GeneratedMessageV3.Builder<AlertPolicy.Condition.Builder> implements AlertPolicy.ConditionOrBuilder

A condition is a true/false test that determines when an alerting policy should open an incident. If a condition evaluates to true, it signifies that something is wrong.

Protobuf type google.monitoring.v3.AlertPolicy.Condition

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public AlertPolicy.Condition.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
AlertPolicy.Condition.Builder
Overrides

build()

public AlertPolicy.Condition build()
Returns
Type Description
AlertPolicy.Condition

buildPartial()

public AlertPolicy.Condition buildPartial()
Returns
Type Description
AlertPolicy.Condition

clear()

public AlertPolicy.Condition.Builder clear()
Returns
Type Description
AlertPolicy.Condition.Builder
Overrides

clearCondition()

public AlertPolicy.Condition.Builder clearCondition()
Returns
Type Description
AlertPolicy.Condition.Builder

clearConditionAbsent()

public AlertPolicy.Condition.Builder clearConditionAbsent()

A condition that checks that a time series continues to receive new data points.

.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2;

Returns
Type Description
AlertPolicy.Condition.Builder

clearConditionMatchedLog()

public AlertPolicy.Condition.Builder clearConditionMatchedLog()

A condition that checks for log messages matching given constraints. If set, no other conditions can be present.

.google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20;

Returns
Type Description
AlertPolicy.Condition.Builder

clearConditionMonitoringQueryLanguage()

public AlertPolicy.Condition.Builder clearConditionMonitoringQueryLanguage()

A condition that uses the Monitoring Query Language to define alerts.

.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19;

Returns
Type Description
AlertPolicy.Condition.Builder

clearConditionPrometheusQueryLanguage()

public AlertPolicy.Condition.Builder clearConditionPrometheusQueryLanguage()

A condition that uses the Prometheus query language to define alerts.

.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21;

Returns
Type Description
AlertPolicy.Condition.Builder

clearConditionThreshold()

public AlertPolicy.Condition.Builder clearConditionThreshold()

A condition that compares a time series against a threshold.

.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1;

Returns
Type Description
AlertPolicy.Condition.Builder

clearDisplayName()

public AlertPolicy.Condition.Builder clearDisplayName()

A short name or phrase used to identify the condition in dashboards, notifications, and incidents. To avoid confusion, don't use the same display name for multiple conditions in the same policy.

string display_name = 6;

Returns
Type Description
AlertPolicy.Condition.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public AlertPolicy.Condition.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
AlertPolicy.Condition.Builder
Overrides

clearName()

public AlertPolicy.Condition.Builder clearName()

Required if the condition exists. The unique resource name for this condition. Its format is:

 projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]

[CONDITION_ID] is assigned by Cloud Monitoring when the condition is created as part of a new or updated alerting policy.

When calling the alertPolicies.create method, do not include the name field in the conditions of the requested alerting policy. Cloud Monitoring creates the condition identifiers and includes them in the new policy.

When calling the alertPolicies.update method to update a policy, including a condition name causes the existing condition to be updated. Conditions without names are added to the updated policy. Existing conditions are deleted if they are not updated.

Best practice is to preserve [CONDITION_ID] if you make only small changes, such as those to condition thresholds, durations, or trigger values. Otherwise, treat the change as a new condition and let the existing condition be deleted.

string name = 12;

Returns
Type Description
AlertPolicy.Condition.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public AlertPolicy.Condition.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
AlertPolicy.Condition.Builder
Overrides

clone()

public AlertPolicy.Condition.Builder clone()
Returns
Type Description
AlertPolicy.Condition.Builder
Overrides

getConditionAbsent()

public AlertPolicy.Condition.MetricAbsence getConditionAbsent()

A condition that checks that a time series continues to receive new data points.

.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2;

Returns
Type Description
AlertPolicy.Condition.MetricAbsence

The conditionAbsent.

getConditionAbsentBuilder()

public AlertPolicy.Condition.MetricAbsence.Builder getConditionAbsentBuilder()

A condition that checks that a time series continues to receive new data points.

.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2;

Returns
Type Description
AlertPolicy.Condition.MetricAbsence.Builder

getConditionAbsentOrBuilder()

public AlertPolicy.Condition.MetricAbsenceOrBuilder getConditionAbsentOrBuilder()

A condition that checks that a time series continues to receive new data points.

.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2;

Returns
Type Description
AlertPolicy.Condition.MetricAbsenceOrBuilder

getConditionCase()

public AlertPolicy.Condition.ConditionCase getConditionCase()
Returns
Type Description
AlertPolicy.Condition.ConditionCase

getConditionMatchedLog()

public AlertPolicy.Condition.LogMatch getConditionMatchedLog()

A condition that checks for log messages matching given constraints. If set, no other conditions can be present.

.google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20;

Returns
Type Description
AlertPolicy.Condition.LogMatch

The conditionMatchedLog.

getConditionMatchedLogBuilder()

public AlertPolicy.Condition.LogMatch.Builder getConditionMatchedLogBuilder()

A condition that checks for log messages matching given constraints. If set, no other conditions can be present.

.google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20;

Returns
Type Description
AlertPolicy.Condition.LogMatch.Builder

getConditionMatchedLogOrBuilder()

public AlertPolicy.Condition.LogMatchOrBuilder getConditionMatchedLogOrBuilder()

A condition that checks for log messages matching given constraints. If set, no other conditions can be present.

.google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20;

Returns
Type Description
AlertPolicy.Condition.LogMatchOrBuilder

getConditionMonitoringQueryLanguage()

public AlertPolicy.Condition.MonitoringQueryLanguageCondition getConditionMonitoringQueryLanguage()

A condition that uses the Monitoring Query Language to define alerts.

.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19;

Returns
Type Description
AlertPolicy.Condition.MonitoringQueryLanguageCondition

The conditionMonitoringQueryLanguage.

getConditionMonitoringQueryLanguageBuilder()

public AlertPolicy.Condition.MonitoringQueryLanguageCondition.Builder getConditionMonitoringQueryLanguageBuilder()

A condition that uses the Monitoring Query Language to define alerts.

.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19;

Returns
Type Description
AlertPolicy.Condition.MonitoringQueryLanguageCondition.Builder

getConditionMonitoringQueryLanguageOrBuilder()

public AlertPolicy.Condition.MonitoringQueryLanguageConditionOrBuilder getConditionMonitoringQueryLanguageOrBuilder()

A condition that uses the Monitoring Query Language to define alerts.

.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19;

Returns
Type Description
AlertPolicy.Condition.MonitoringQueryLanguageConditionOrBuilder

getConditionPrometheusQueryLanguage()

public AlertPolicy.Condition.PrometheusQueryLanguageCondition getConditionPrometheusQueryLanguage()

A condition that uses the Prometheus query language to define alerts.

.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21;

Returns
Type Description
AlertPolicy.Condition.PrometheusQueryLanguageCondition

The conditionPrometheusQueryLanguage.

getConditionPrometheusQueryLanguageBuilder()

public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder getConditionPrometheusQueryLanguageBuilder()

A condition that uses the Prometheus query language to define alerts.

.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21;

Returns
Type Description
AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder

getConditionPrometheusQueryLanguageOrBuilder()

public AlertPolicy.Condition.PrometheusQueryLanguageConditionOrBuilder getConditionPrometheusQueryLanguageOrBuilder()

A condition that uses the Prometheus query language to define alerts.

.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21;

Returns
Type Description
AlertPolicy.Condition.PrometheusQueryLanguageConditionOrBuilder

getConditionThreshold()

public AlertPolicy.Condition.MetricThreshold getConditionThreshold()

A condition that compares a time series against a threshold.

.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1;

Returns
Type Description
AlertPolicy.Condition.MetricThreshold

The conditionThreshold.

getConditionThresholdBuilder()

public AlertPolicy.Condition.MetricThreshold.Builder getConditionThresholdBuilder()

A condition that compares a time series against a threshold.

.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1;

Returns
Type Description
AlertPolicy.Condition.MetricThreshold.Builder

getConditionThresholdOrBuilder()

public AlertPolicy.Condition.MetricThresholdOrBuilder getConditionThresholdOrBuilder()

A condition that compares a time series against a threshold.

.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1;

Returns
Type Description
AlertPolicy.Condition.MetricThresholdOrBuilder

getDefaultInstanceForType()

public AlertPolicy.Condition getDefaultInstanceForType()
Returns
Type Description
AlertPolicy.Condition

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getDisplayName()

public String getDisplayName()

A short name or phrase used to identify the condition in dashboards, notifications, and incidents. To avoid confusion, don't use the same display name for multiple conditions in the same policy.

string display_name = 6;

Returns
Type Description
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

A short name or phrase used to identify the condition in dashboards, notifications, and incidents. To avoid confusion, don't use the same display name for multiple conditions in the same policy.

string display_name = 6;

Returns
Type Description
ByteString

The bytes for displayName.

getName()

public String getName()

Required if the condition exists. The unique resource name for this condition. Its format is:

 projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]

[CONDITION_ID] is assigned by Cloud Monitoring when the condition is created as part of a new or updated alerting policy.

When calling the alertPolicies.create method, do not include the name field in the conditions of the requested alerting policy. Cloud Monitoring creates the condition identifiers and includes them in the new policy.

When calling the alertPolicies.update method to update a policy, including a condition name causes the existing condition to be updated. Conditions without names are added to the updated policy. Existing conditions are deleted if they are not updated.

Best practice is to preserve [CONDITION_ID] if you make only small changes, such as those to condition thresholds, durations, or trigger values. Otherwise, treat the change as a new condition and let the existing condition be deleted.

string name = 12;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Required if the condition exists. The unique resource name for this condition. Its format is:

 projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]

[CONDITION_ID] is assigned by Cloud Monitoring when the condition is created as part of a new or updated alerting policy.

When calling the alertPolicies.create method, do not include the name field in the conditions of the requested alerting policy. Cloud Monitoring creates the condition identifiers and includes them in the new policy.

When calling the alertPolicies.update method to update a policy, including a condition name causes the existing condition to be updated. Conditions without names are added to the updated policy. Existing conditions are deleted if they are not updated.

Best practice is to preserve [CONDITION_ID] if you make only small changes, such as those to condition thresholds, durations, or trigger values. Otherwise, treat the change as a new condition and let the existing condition be deleted.

string name = 12;

Returns
Type Description
ByteString

The bytes for name.

hasConditionAbsent()

public boolean hasConditionAbsent()

A condition that checks that a time series continues to receive new data points.

.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2;

Returns
Type Description
boolean

Whether the conditionAbsent field is set.

hasConditionMatchedLog()

public boolean hasConditionMatchedLog()

A condition that checks for log messages matching given constraints. If set, no other conditions can be present.

.google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20;

Returns
Type Description
boolean

Whether the conditionMatchedLog field is set.

hasConditionMonitoringQueryLanguage()

public boolean hasConditionMonitoringQueryLanguage()

A condition that uses the Monitoring Query Language to define alerts.

.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19;

Returns
Type Description
boolean

Whether the conditionMonitoringQueryLanguage field is set.

hasConditionPrometheusQueryLanguage()

public boolean hasConditionPrometheusQueryLanguage()

A condition that uses the Prometheus query language to define alerts.

.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21;

Returns
Type Description
boolean

Whether the conditionPrometheusQueryLanguage field is set.

hasConditionThreshold()

public boolean hasConditionThreshold()

A condition that compares a time series against a threshold.

.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1;

Returns
Type Description
boolean

Whether the conditionThreshold field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeConditionAbsent(AlertPolicy.Condition.MetricAbsence value)

public AlertPolicy.Condition.Builder mergeConditionAbsent(AlertPolicy.Condition.MetricAbsence value)

A condition that checks that a time series continues to receive new data points.

.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2;

Parameter
Name Description
value AlertPolicy.Condition.MetricAbsence
Returns
Type Description
AlertPolicy.Condition.Builder

mergeConditionMatchedLog(AlertPolicy.Condition.LogMatch value)

public AlertPolicy.Condition.Builder mergeConditionMatchedLog(AlertPolicy.Condition.LogMatch value)

A condition that checks for log messages matching given constraints. If set, no other conditions can be present.

.google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20;

Parameter
Name Description
value AlertPolicy.Condition.LogMatch
Returns
Type Description
AlertPolicy.Condition.Builder

mergeConditionMonitoringQueryLanguage(AlertPolicy.Condition.MonitoringQueryLanguageCondition value)

public AlertPolicy.Condition.Builder mergeConditionMonitoringQueryLanguage(AlertPolicy.Condition.MonitoringQueryLanguageCondition value)

A condition that uses the Monitoring Query Language to define alerts.

.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19;

Parameter
Name Description
value AlertPolicy.Condition.MonitoringQueryLanguageCondition
Returns
Type Description
AlertPolicy.Condition.Builder

mergeConditionPrometheusQueryLanguage(AlertPolicy.Condition.PrometheusQueryLanguageCondition value)

public AlertPolicy.Condition.Builder mergeConditionPrometheusQueryLanguage(AlertPolicy.Condition.PrometheusQueryLanguageCondition value)

A condition that uses the Prometheus query language to define alerts.

.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21;

Parameter
Name Description
value AlertPolicy.Condition.PrometheusQueryLanguageCondition
Returns
Type Description
AlertPolicy.Condition.Builder

mergeConditionThreshold(AlertPolicy.Condition.MetricThreshold value)

public AlertPolicy.Condition.Builder mergeConditionThreshold(AlertPolicy.Condition.MetricThreshold value)

A condition that compares a time series against a threshold.

.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1;

Parameter
Name Description
value AlertPolicy.Condition.MetricThreshold
Returns
Type Description
AlertPolicy.Condition.Builder

mergeFrom(AlertPolicy.Condition other)

public AlertPolicy.Condition.Builder mergeFrom(AlertPolicy.Condition other)
Parameter
Name Description
other AlertPolicy.Condition
Returns
Type Description
AlertPolicy.Condition.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public AlertPolicy.Condition.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AlertPolicy.Condition.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public AlertPolicy.Condition.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
AlertPolicy.Condition.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final AlertPolicy.Condition.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AlertPolicy.Condition.Builder
Overrides

setConditionAbsent(AlertPolicy.Condition.MetricAbsence value)

public AlertPolicy.Condition.Builder setConditionAbsent(AlertPolicy.Condition.MetricAbsence value)

A condition that checks that a time series continues to receive new data points.

.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2;

Parameter
Name Description
value AlertPolicy.Condition.MetricAbsence
Returns
Type Description
AlertPolicy.Condition.Builder

setConditionAbsent(AlertPolicy.Condition.MetricAbsence.Builder builderForValue)

public AlertPolicy.Condition.Builder setConditionAbsent(AlertPolicy.Condition.MetricAbsence.Builder builderForValue)

A condition that checks that a time series continues to receive new data points.

.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2;

Parameter
Name Description
builderForValue AlertPolicy.Condition.MetricAbsence.Builder
Returns
Type Description
AlertPolicy.Condition.Builder

setConditionMatchedLog(AlertPolicy.Condition.LogMatch value)

public AlertPolicy.Condition.Builder setConditionMatchedLog(AlertPolicy.Condition.LogMatch value)

A condition that checks for log messages matching given constraints. If set, no other conditions can be present.

.google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20;

Parameter
Name Description
value AlertPolicy.Condition.LogMatch
Returns
Type Description
AlertPolicy.Condition.Builder

setConditionMatchedLog(AlertPolicy.Condition.LogMatch.Builder builderForValue)

public AlertPolicy.Condition.Builder setConditionMatchedLog(AlertPolicy.Condition.LogMatch.Builder builderForValue)

A condition that checks for log messages matching given constraints. If set, no other conditions can be present.

.google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20;

Parameter
Name Description
builderForValue AlertPolicy.Condition.LogMatch.Builder
Returns
Type Description
AlertPolicy.Condition.Builder

setConditionMonitoringQueryLanguage(AlertPolicy.Condition.MonitoringQueryLanguageCondition value)

public AlertPolicy.Condition.Builder setConditionMonitoringQueryLanguage(AlertPolicy.Condition.MonitoringQueryLanguageCondition value)

A condition that uses the Monitoring Query Language to define alerts.

.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19;

Parameter
Name Description
value AlertPolicy.Condition.MonitoringQueryLanguageCondition
Returns
Type Description
AlertPolicy.Condition.Builder

setConditionMonitoringQueryLanguage(AlertPolicy.Condition.MonitoringQueryLanguageCondition.Builder builderForValue)

public AlertPolicy.Condition.Builder setConditionMonitoringQueryLanguage(AlertPolicy.Condition.MonitoringQueryLanguageCondition.Builder builderForValue)

A condition that uses the Monitoring Query Language to define alerts.

.google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19;

Parameter
Name Description
builderForValue AlertPolicy.Condition.MonitoringQueryLanguageCondition.Builder
Returns
Type Description
AlertPolicy.Condition.Builder

setConditionPrometheusQueryLanguage(AlertPolicy.Condition.PrometheusQueryLanguageCondition value)

public AlertPolicy.Condition.Builder setConditionPrometheusQueryLanguage(AlertPolicy.Condition.PrometheusQueryLanguageCondition value)

A condition that uses the Prometheus query language to define alerts.

.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21;

Parameter
Name Description
value AlertPolicy.Condition.PrometheusQueryLanguageCondition
Returns
Type Description
AlertPolicy.Condition.Builder

setConditionPrometheusQueryLanguage(AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder builderForValue)

public AlertPolicy.Condition.Builder setConditionPrometheusQueryLanguage(AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder builderForValue)

A condition that uses the Prometheus query language to define alerts.

.google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21;

Parameter
Name Description
builderForValue AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder
Returns
Type Description
AlertPolicy.Condition.Builder

setConditionThreshold(AlertPolicy.Condition.MetricThreshold value)

public AlertPolicy.Condition.Builder setConditionThreshold(AlertPolicy.Condition.MetricThreshold value)

A condition that compares a time series against a threshold.

.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1;

Parameter
Name Description
value AlertPolicy.Condition.MetricThreshold
Returns
Type Description
AlertPolicy.Condition.Builder

setConditionThreshold(AlertPolicy.Condition.MetricThreshold.Builder builderForValue)

public AlertPolicy.Condition.Builder setConditionThreshold(AlertPolicy.Condition.MetricThreshold.Builder builderForValue)

A condition that compares a time series against a threshold.

.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1;

Parameter
Name Description
builderForValue AlertPolicy.Condition.MetricThreshold.Builder
Returns
Type Description
AlertPolicy.Condition.Builder

setDisplayName(String value)

public AlertPolicy.Condition.Builder setDisplayName(String value)

A short name or phrase used to identify the condition in dashboards, notifications, and incidents. To avoid confusion, don't use the same display name for multiple conditions in the same policy.

string display_name = 6;

Parameter
Name Description
value String

The displayName to set.

Returns
Type Description
AlertPolicy.Condition.Builder

This builder for chaining.

setDisplayNameBytes(ByteString value)

public AlertPolicy.Condition.Builder setDisplayNameBytes(ByteString value)

A short name or phrase used to identify the condition in dashboards, notifications, and incidents. To avoid confusion, don't use the same display name for multiple conditions in the same policy.

string display_name = 6;

Parameter
Name Description
value ByteString

The bytes for displayName to set.

Returns
Type Description
AlertPolicy.Condition.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public AlertPolicy.Condition.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
AlertPolicy.Condition.Builder
Overrides

setName(String value)

public AlertPolicy.Condition.Builder setName(String value)

Required if the condition exists. The unique resource name for this condition. Its format is:

 projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]

[CONDITION_ID] is assigned by Cloud Monitoring when the condition is created as part of a new or updated alerting policy.

When calling the alertPolicies.create method, do not include the name field in the conditions of the requested alerting policy. Cloud Monitoring creates the condition identifiers and includes them in the new policy.

When calling the alertPolicies.update method to update a policy, including a condition name causes the existing condition to be updated. Conditions without names are added to the updated policy. Existing conditions are deleted if they are not updated.

Best practice is to preserve [CONDITION_ID] if you make only small changes, such as those to condition thresholds, durations, or trigger values. Otherwise, treat the change as a new condition and let the existing condition be deleted.

string name = 12;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
AlertPolicy.Condition.Builder

This builder for chaining.

setNameBytes(ByteString value)

public AlertPolicy.Condition.Builder setNameBytes(ByteString value)

Required if the condition exists. The unique resource name for this condition. Its format is:

 projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]

[CONDITION_ID] is assigned by Cloud Monitoring when the condition is created as part of a new or updated alerting policy.

When calling the alertPolicies.create method, do not include the name field in the conditions of the requested alerting policy. Cloud Monitoring creates the condition identifiers and includes them in the new policy.

When calling the alertPolicies.update method to update a policy, including a condition name causes the existing condition to be updated. Conditions without names are added to the updated policy. Existing conditions are deleted if they are not updated.

Best practice is to preserve [CONDITION_ID] if you make only small changes, such as those to condition thresholds, durations, or trigger values. Otherwise, treat the change as a new condition and let the existing condition be deleted.

string name = 12;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
AlertPolicy.Condition.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public AlertPolicy.Condition.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
AlertPolicy.Condition.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final AlertPolicy.Condition.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AlertPolicy.Condition.Builder
Overrides