Class: Google::Apis::MonitoringV3::Condition

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/monitoring_v3/classes.rb,
generated/google/apis/monitoring_v3/representations.rb,
generated/google/apis/monitoring_v3/representations.rb

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Condition

Returns a new instance of Condition



486
487
488
# File 'generated/google/apis/monitoring_v3/classes.rb', line 486

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#condition_absentGoogle::Apis::MonitoringV3::MetricAbsence

A condition type that checks that monitored resources are reporting data. The configuration defines a metric and a set of monitored resources. The predicate is considered in violation when a time series for the specified metric of a monitored resource does not include any data in the specified duration. Corresponds to the JSON property conditionAbsent



454
455
456
# File 'generated/google/apis/monitoring_v3/classes.rb', line 454

def condition_absent
  @condition_absent
end

#condition_thresholdGoogle::Apis::MonitoringV3::MetricThreshold

A condition type that compares a collection of time series against a threshold. Corresponds to the JSON property conditionThreshold



459
460
461
# File 'generated/google/apis/monitoring_v3/classes.rb', line 459

def condition_threshold
  @condition_threshold
end

#display_nameString

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. Corresponds to the JSON property displayName

Returns:

  • (String)


466
467
468
# File 'generated/google/apis/monitoring_v3/classes.rb', line 466

def display_name
  @display_name
end

#nameString

Required if the condition exists. The unique resource name for this condition. Its syntax is: projects/[PROJECT_ID]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID] [CONDITION_ID] is assigned by Stackdriver 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. Stackdriver 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. Corresponds to the JSON property name

Returns:

  • (String)


484
485
486
# File 'generated/google/apis/monitoring_v3/classes.rb', line 484

def name
  @name
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



491
492
493
494
495
496
# File 'generated/google/apis/monitoring_v3/classes.rb', line 491

def update!(**args)
  @condition_absent = args[:condition_absent] if args.key?(:condition_absent)
  @condition_threshold = args[:condition_threshold] if args.key?(:condition_threshold)
  @display_name = args[:display_name] if args.key?(:display_name)
  @name = args[:name] if args.key?(:name)
end