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.



3720
3721
3722
# File 'lib/google/apis/logging_v2/classes.rb', line 3720

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



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

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



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

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)


3695
3696
3697
# File 'lib/google/apis/logging_v2/classes.rb', line 3695

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



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

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


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

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)


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

def search_term
  @search_term
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3725
3726
3727
3728
3729
3730
3731
3732
# File 'lib/google/apis/logging_v2/classes.rb', line 3725

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