Class: Google::Apis::MonitoringV3::SqlCondition
- Inherits:
-
Object
- Object
- Google::Apis::MonitoringV3::SqlCondition
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/monitoring_v3/classes.rb,
lib/google/apis/monitoring_v3/representations.rb,
lib/google/apis/monitoring_v3/representations.rb
Overview
A condition that allows alerting policies to be defined using GoogleSQL. SQL conditions examine a sliding window of logs using GoogleSQL. Alert policies with SQL conditions may incur additional billing.
Instance Attribute Summary collapse
-
#boolean_test ⇒ Google::Apis::MonitoringV3::BooleanTest
A test that uses an alerting result in a boolean column produced by the SQL query.
-
#daily ⇒ Google::Apis::MonitoringV3::Daily
Used to schedule the query to run every so many days.
-
#hourly ⇒ Google::Apis::MonitoringV3::Hourly
Used to schedule the query to run every so many hours.
-
#minutes ⇒ Google::Apis::MonitoringV3::Minutes
Used to schedule the query to run every so many minutes.
-
#query ⇒ String
Required.
-
#row_count_test ⇒ Google::Apis::MonitoringV3::RowCountTest
A test that checks if the number of rows in the result set violates some threshold.
Instance Method Summary collapse
-
#initialize(**args) ⇒ SqlCondition
constructor
A new instance of SqlCondition.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ SqlCondition
Returns a new instance of SqlCondition.
4700 4701 4702 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4700 def initialize(**args) update!(**args) end |
Instance Attribute Details
#boolean_test ⇒ Google::Apis::MonitoringV3::BooleanTest
A test that uses an alerting result in a boolean column produced by the SQL
query.
Corresponds to the JSON property booleanTest
4666 4667 4668 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4666 def boolean_test @boolean_test end |
#daily ⇒ Google::Apis::MonitoringV3::Daily
Used to schedule the query to run every so many days.
Corresponds to the JSON property daily
4671 4672 4673 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4671 def daily @daily end |
#hourly ⇒ Google::Apis::MonitoringV3::Hourly
Used to schedule the query to run every so many hours.
Corresponds to the JSON property hourly
4676 4677 4678 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4676 def hourly @hourly end |
#minutes ⇒ Google::Apis::MonitoringV3::Minutes
Used to schedule the query to run every so many minutes.
Corresponds to the JSON property minutes
4681 4682 4683 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4681 def minutes @minutes end |
#query ⇒ String
Required. The Log Analytics SQL query to run, as a string. The query must
conform to the required shape. Specifically, the query must not try to filter
the input by time. A filter will automatically be applied to filter the input
so that the query receives all rows received since the last time the query was
run.For example, the following query extracts all log entries containing an
HTTP request:SELECT timestamp, log_name, severity, http_request, resource,
labels FROM my-project.global._Default._AllLogs WHERE http_request IS NOT NULL
Corresponds to the JSON property query
4692 4693 4694 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4692 def query @query end |
#row_count_test ⇒ Google::Apis::MonitoringV3::RowCountTest
A test that checks if the number of rows in the result set violates some
threshold.
Corresponds to the JSON property rowCountTest
4698 4699 4700 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4698 def row_count_test @row_count_test end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
4705 4706 4707 4708 4709 4710 4711 4712 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4705 def update!(**args) @boolean_test = args[:boolean_test] if args.key?(:boolean_test) @daily = args[:daily] if args.key?(:daily) @hourly = args[:hourly] if args.key?(:hourly) @minutes = args[:minutes] if args.key?(:minutes) @query = args[:query] if args.key?(:query) @row_count_test = args[:row_count_test] if args.key?(:row_count_test) end |