# Cloud Monitoring V3 API - Class Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition (v1.10.0)

1.10.0 (latest) 1.9.0 1.8.0 1.7.1 1.6.1 1.5.1 1.4.0 1.3.0 1.2.0 1.1.0 1.0.1 0.18.0 0.17.0 0.16.0 0.15.2 0.14.0 0.13.0 0.12.1 0.11.0 0.10.0 0.9.0 0.8.0 0.7.1 Reference documentation and code samples for the Cloud Monitoring V3 API class Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition.

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.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #boolean_test

    def boolean_test() -> ::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::BooleanTest

**Returns**

- ([::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::BooleanTest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-SqlCondition-BooleanTest)) --- Test the boolean value in the indicated column.


  Note: The following fields are mutually exclusive: `boolean_test`, `row_count_test`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #boolean_test=

    def boolean_test=(value) -> ::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::BooleanTest

**Parameter**

- **value** ([::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::BooleanTest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-SqlCondition-BooleanTest)) --- Test the boolean value in the indicated column.


  Note: The following fields are mutually exclusive: `boolean_test`, `row_count_test`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::BooleanTest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-SqlCondition-BooleanTest)) --- Test the boolean value in the indicated column.


  Note: The following fields are mutually exclusive: `boolean_test`, `row_count_test`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #daily

    def daily() -> ::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::Daily

**Returns**

- ([::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::Daily](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-SqlCondition-Daily)) --- Schedule the query to execute every so many days.


  Note: The following fields are mutually exclusive: `daily`, `minutes`, `hourly`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #daily=

    def daily=(value) -> ::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::Daily

**Parameter**

- **value** ([::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::Daily](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-SqlCondition-Daily)) --- Schedule the query to execute every so many days.


  Note: The following fields are mutually exclusive: `daily`, `minutes`, `hourly`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::Daily](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-SqlCondition-Daily)) --- Schedule the query to execute every so many days.


  Note: The following fields are mutually exclusive: `daily`, `minutes`, `hourly`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #hourly

    def hourly() -> ::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::Hourly

**Returns**

- ([::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::Hourly](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-SqlCondition-Hourly)) --- Schedule the query to execute every so many hours.


  Note: The following fields are mutually exclusive: `hourly`, `minutes`, `daily`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #hourly=

    def hourly=(value) -> ::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::Hourly

**Parameter**

- **value** ([::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::Hourly](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-SqlCondition-Hourly)) --- Schedule the query to execute every so many hours.


  Note: The following fields are mutually exclusive: `hourly`, `minutes`, `daily`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::Hourly](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-SqlCondition-Hourly)) --- Schedule the query to execute every so many hours.


  Note: The following fields are mutually exclusive: `hourly`, `minutes`, `daily`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #minutes

    def minutes() -> ::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::Minutes

**Returns**

- ([::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::Minutes](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-SqlCondition-Minutes)) --- Schedule the query to execute every so many minutes.


  Note: The following fields are mutually exclusive: `minutes`, `hourly`, `daily`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #minutes=

    def minutes=(value) -> ::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::Minutes

**Parameter**

- **value** ([::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::Minutes](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-SqlCondition-Minutes)) --- Schedule the query to execute every so many minutes.


  Note: The following fields are mutually exclusive: `minutes`, `hourly`, `daily`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::Minutes](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-SqlCondition-Minutes)) --- Schedule the query to execute every so many minutes.


  Note: The following fields are mutually exclusive: `minutes`, `hourly`, `daily`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #query

    def query() -> ::String

**Returns**

- (::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

### #query=

    def query=(value) -> ::String

**Parameter**

- **value** (::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

**Returns**

- (::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

### #row_count_test

    def row_count_test() -> ::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::RowCountTest

**Returns**

- ([::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::RowCountTest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-SqlCondition-RowCountTest)) --- Test the row count against a threshold.


  Note: The following fields are mutually exclusive: `row_count_test`, `boolean_test`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #row_count_test=

    def row_count_test=(value) -> ::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::RowCountTest

**Parameter**

- **value** ([::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::RowCountTest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-SqlCondition-RowCountTest)) --- Test the row count against a threshold.


  Note: The following fields are mutually exclusive: `row_count_test`, `boolean_test`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::RowCountTest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-AlertPolicy-Condition-SqlCondition-RowCountTest)) --- Test the row count against a threshold.


  Note: The following fields are mutually exclusive: `row_count_test`, `boolean_test`. If a field in that set is populated, all other fields in the set will automatically be cleared.