Class: Google::Apis::MonitoringV3::SqlCondition

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ SqlCondition

Returns a new instance of SqlCondition.



4921
4922
4923
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4921

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

Instance Attribute Details

#boolean_testGoogle::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



4887
4888
4889
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4887

def boolean_test
  @boolean_test
end

#dailyGoogle::Apis::MonitoringV3::Daily

Used to schedule the query to run every so many days. Corresponds to the JSON property daily



4892
4893
4894
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4892

def daily
  @daily
end

#hourlyGoogle::Apis::MonitoringV3::Hourly

Used to schedule the query to run every so many hours. Corresponds to the JSON property hourly



4897
4898
4899
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4897

def hourly
  @hourly
end

#minutesGoogle::Apis::MonitoringV3::Minutes

Used to schedule the query to run every so many minutes. Corresponds to the JSON property minutes



4902
4903
4904
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4902

def minutes
  @minutes
end

#queryString

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

Returns:

  • (String)


4913
4914
4915
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4913

def query
  @query
end

#row_count_testGoogle::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



4919
4920
4921
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4919

def row_count_test
  @row_count_test
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



4926
4927
4928
4929
4930
4931
4932
4933
# File 'lib/google/apis/monitoring_v3/classes.rb', line 4926

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