#[non_exhaustive]pub struct Condition {
pub name: String,
pub display_name: String,
pub condition: Option<Condition>,
}Expand description
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.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringRequired 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.
display_name: StringA 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.
condition: Option<Condition>Only one of the following condition types will be specified.
Implementations§
Source§impl Condition
impl Condition
Sourcepub fn set_display_name<T: Into<String>>(self, v: T) -> Self
pub fn set_display_name<T: Into<String>>(self, v: T) -> Self
Sets the value of display_name.
Sourcepub fn set_condition<T: Into<Option<Condition>>>(self, v: T) -> Self
pub fn set_condition<T: Into<Option<Condition>>>(self, v: T) -> Self
Sets the value of condition.
Sourcepub fn get_condition_threshold(&self) -> Option<&Box<MetricThreshold>>
pub fn get_condition_threshold(&self) -> Option<&Box<MetricThreshold>>
The value of condition
if it holds a ConditionThreshold, None if the field is not set or
holds a different branch.
Sourcepub fn get_condition_absent(&self) -> Option<&Box<MetricAbsence>>
pub fn get_condition_absent(&self) -> Option<&Box<MetricAbsence>>
The value of condition
if it holds a ConditionAbsent, None if the field is not set or
holds a different branch.
Sourcepub fn get_condition_matched_log(&self) -> Option<&Box<LogMatch>>
pub fn get_condition_matched_log(&self) -> Option<&Box<LogMatch>>
The value of condition
if it holds a ConditionMatchedLog, None if the field is not set or
holds a different branch.
Sourcepub fn get_condition_monitoring_query_language(
&self,
) -> Option<&Box<MonitoringQueryLanguageCondition>>
pub fn get_condition_monitoring_query_language( &self, ) -> Option<&Box<MonitoringQueryLanguageCondition>>
The value of condition
if it holds a ConditionMonitoringQueryLanguage, None if the field is not set or
holds a different branch.
Sourcepub fn get_condition_prometheus_query_language(
&self,
) -> Option<&Box<PrometheusQueryLanguageCondition>>
pub fn get_condition_prometheus_query_language( &self, ) -> Option<&Box<PrometheusQueryLanguageCondition>>
The value of condition
if it holds a ConditionPrometheusQueryLanguage, None if the field is not set or
holds a different branch.
Sourcepub fn get_condition_sql(&self) -> Option<&Box<SqlCondition>>
pub fn get_condition_sql(&self) -> Option<&Box<SqlCondition>>
The value of condition
if it holds a ConditionSql, None if the field is not set or
holds a different branch.
Sourcepub fn set_condition_threshold<T: Into<Box<MetricThreshold>>>(
self,
v: T,
) -> Self
pub fn set_condition_threshold<T: Into<Box<MetricThreshold>>>( self, v: T, ) -> Self
Sets the value of condition
to hold a ConditionThreshold.
Note that all the setters affecting condition are
mutually exclusive.
Sourcepub fn set_condition_absent<T: Into<Box<MetricAbsence>>>(self, v: T) -> Self
pub fn set_condition_absent<T: Into<Box<MetricAbsence>>>(self, v: T) -> Self
Sets the value of condition
to hold a ConditionAbsent.
Note that all the setters affecting condition are
mutually exclusive.
Sourcepub fn set_condition_matched_log<T: Into<Box<LogMatch>>>(self, v: T) -> Self
pub fn set_condition_matched_log<T: Into<Box<LogMatch>>>(self, v: T) -> Self
Sets the value of condition
to hold a ConditionMatchedLog.
Note that all the setters affecting condition are
mutually exclusive.
Sourcepub fn set_condition_monitoring_query_language<T: Into<Box<MonitoringQueryLanguageCondition>>>(
self,
v: T,
) -> Self
pub fn set_condition_monitoring_query_language<T: Into<Box<MonitoringQueryLanguageCondition>>>( self, v: T, ) -> Self
Sets the value of condition
to hold a ConditionMonitoringQueryLanguage.
Note that all the setters affecting condition are
mutually exclusive.
Sourcepub fn set_condition_prometheus_query_language<T: Into<Box<PrometheusQueryLanguageCondition>>>(
self,
v: T,
) -> Self
pub fn set_condition_prometheus_query_language<T: Into<Box<PrometheusQueryLanguageCondition>>>( self, v: T, ) -> Self
Sets the value of condition
to hold a ConditionPrometheusQueryLanguage.
Note that all the setters affecting condition are
mutually exclusive.
Sourcepub fn set_condition_sql<T: Into<Box<SqlCondition>>>(self, v: T) -> Self
pub fn set_condition_sql<T: Into<Box<SqlCondition>>>(self, v: T) -> Self
Sets the value of condition
to hold a ConditionSql.
Note that all the setters affecting condition are
mutually exclusive.