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.
4711 4712 4713 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4711 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
4677 4678 4679 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4677 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
4682 4683 4684 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4682 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
4687 4688 4689 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4687 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
4692 4693 4694 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4692 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
4703 4704 4705 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4703 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
4709 4710 4711 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4709 def row_count_test @row_count_test end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
4716 4717 4718 4719 4720 4721 4722 4723 |
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4716 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 |