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.



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

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



3672
3673
3674
# File 'lib/google/apis/logging_v2/classes.rb', line 3672

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



3677
3678
3679
# File 'lib/google/apis/logging_v2/classes.rb', line 3677

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)


3683
3684
3685
# File 'lib/google/apis/logging_v2/classes.rb', line 3683

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



3689
3690
3691
# File 'lib/google/apis/logging_v2/classes.rb', line 3689

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>)


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

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)


3706
3707
3708
# File 'lib/google/apis/logging_v2/classes.rb', line 3706

def search_term
  @search_term
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3713
3714
3715
3716
3717
3718
3719
3720
# File 'lib/google/apis/logging_v2/classes.rb', line 3713

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