Class: Google::Apis::LoggingV2::QueryBuilderConfig

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/logging_v2/classes.rb,
lib/google/apis/logging_v2/representations.rb,
lib/google/apis/logging_v2/representations.rb

Overview

Defines a structured query configuration that can be used instead of writing raw SQL. This configuration represents the components of a SQL query (FROM, SELECT, WHERE, ORDER BY, LIMIT) and is typically converted into an executable query (e.g., BigQuery SQL) by the backend service to retrieve data for analysis or visualization.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ QueryBuilderConfig

Returns a new instance of QueryBuilderConfig.



3728
3729
3730
# File 'lib/google/apis/logging_v2/classes.rb', line 3728

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

Instance Attribute Details

#field_sourcesArray<Google::Apis::LoggingV2::FieldSource>

Defines the items to include in the query result, analogous to a SQL SELECT clause. Corresponds to the JSON property fieldSources



3692
3693
3694
# File 'lib/google/apis/logging_v2/classes.rb', line 3692

def field_sources
  @field_sources
end

#filterGoogle::Apis::LoggingV2::FilterPredicate

A filter for a query. This equates to the WHERE clause in SQL. Corresponds to the JSON property filter



3697
3698
3699
# File 'lib/google/apis/logging_v2/classes.rb', line 3697

def filter
  @filter
end

#limitFixnum

The limit to use for the query. This equates to the LIMIT clause in SQL. A limit of 0 will be treated as not enabled. Corresponds to the JSON property limit

Returns:

  • (Fixnum)


3703
3704
3705
# File 'lib/google/apis/logging_v2/classes.rb', line 3703

def limit
  @limit
end

#order_bysArray<Google::Apis::LoggingV2::SortOrderParameter>

The sort orders to use for the query. This equates to the ORDER BY clause in SQL. Corresponds to the JSON property orderBys



3709
3710
3711
# File 'lib/google/apis/logging_v2/classes.rb', line 3709

def order_bys
  @order_bys
end

#resource_namesArray<String>

Required. The view/resource to query. For now only a single view/resource will be sent, but there are plans to allow multiple views in the future. Marking as repeated for that purpose. Example: - "projects/123/locations/global/buckets/ 456/views/_Default" - "projects/123/locations/global/metricBuckets/456/views/ _Default" Corresponds to the JSON property resourceNames

Returns:

  • (Array<String>)


3718
3719
3720
# File 'lib/google/apis/logging_v2/classes.rb', line 3718

def resource_names
  @resource_names
end

#search_termString

The plain text search to use for the query. There is no support for multiple search terms. This uses the SEARCH functionality in BigQuery. For example, a search_term = 'ERROR' would result in the following SQL:SELECT * FROM resource WHERE SEARCH(resource, 'ERROR') LIMIT 100 Corresponds to the JSON property searchTerm

Returns:

  • (String)


3726
3727
3728
# File 'lib/google/apis/logging_v2/classes.rb', line 3726

def search_term
  @search_term
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3733
3734
3735
3736
3737
3738
3739
3740
# File 'lib/google/apis/logging_v2/classes.rb', line 3733

def update!(**args)
  @field_sources = args[:field_sources] if args.key?(:field_sources)
  @filter = args[:filter] if args.key?(:filter)
  @limit = args[:limit] if args.key?(:limit)
  @order_bys = args[:order_bys] if args.key?(:order_bys)
  @resource_names = args[:resource_names] if args.key?(:resource_names)
  @search_term = args[:search_term] if args.key?(:search_term)
end