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.



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

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



3667
3668
3669
# File 'lib/google/apis/logging_v2/classes.rb', line 3667

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



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

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)


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

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



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

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


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

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)


3701
3702
3703
# File 'lib/google/apis/logging_v2/classes.rb', line 3701

def search_term
  @search_term
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3708
3709
3710
3711
3712
3713
3714
3715
# File 'lib/google/apis/logging_v2/classes.rb', line 3708

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