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 alert 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.
4696 4697 4698 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4696 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
4662 4663 4664 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4662 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
4667 4668 4669 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4667 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
4672 4673 4674 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4672 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
4677 4678 4679 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4677 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.E.g. Extract 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
4688 4689 4690 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4688 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
4694 4695 4696 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4694 def row_count_test @row_count_test end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
4701 4702 4703 4704 4705 4706 4707 4708 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4701 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 |