Stackdriver Monitoring V3 Client - Class Condition (1.5.1)

Reference documentation and code samples for the Stackdriver Monitoring V3 Client class Condition.

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.

Generated from protobuf message google.monitoring.v3.AlertPolicy.Condition

Namespace

Google \ Cloud \ Monitoring \ V3 \ AlertPolicy

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ name string

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.

↳ display_name string

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.

↳ condition_threshold Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold

A condition that compares a time series against a threshold.

↳ condition_absent Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricAbsence

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

↳ condition_matched_log Google\Cloud\Monitoring\V3\AlertPolicy\Condition\LogMatch

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

↳ condition_monitoring_query_language Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MonitoringQueryLanguageCondition

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

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.

Returns
TypeDescription
string

setName

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.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

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.

Returns
TypeDescription
string

setDisplayName

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.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getConditionThreshold

A condition that compares a time series against a threshold.

Returns
TypeDescription
Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold|null

hasConditionThreshold

setConditionThreshold

A condition that compares a time series against a threshold.

Parameter
NameDescription
var Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricThreshold
Returns
TypeDescription
$this

getConditionAbsent

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

Returns
TypeDescription
Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricAbsence|null

hasConditionAbsent

setConditionAbsent

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

Parameter
NameDescription
var Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MetricAbsence
Returns
TypeDescription
$this

getConditionMatchedLog

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

Returns
TypeDescription
Google\Cloud\Monitoring\V3\AlertPolicy\Condition\LogMatch|null

hasConditionMatchedLog

setConditionMatchedLog

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

Parameter
NameDescription
var Google\Cloud\Monitoring\V3\AlertPolicy\Condition\LogMatch
Returns
TypeDescription
$this

getConditionMonitoringQueryLanguage

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

Returns
TypeDescription
Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MonitoringQueryLanguageCondition|null

hasConditionMonitoringQueryLanguage

setConditionMonitoringQueryLanguage

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

Parameter
NameDescription
var Google\Cloud\Monitoring\V3\AlertPolicy\Condition\MonitoringQueryLanguageCondition
Returns
TypeDescription
$this

getCondition

Returns
TypeDescription
string