Chronicle V1 API - Class Google::Cloud::Chronicle::V1::SearchService::Rest::Client (v1.4.0)

Reference documentation and code samples for the Chronicle V1 API class Google::Cloud::Chronicle::V1::SearchService::Rest::Client.

REST client for the SearchService service.

SearchService provides methods for searching data in Chronicle.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the SearchService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all SearchService clients
::Google::Cloud::Chronicle::V1::SearchService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the SearchService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#initialize

def initialize() { |config| ... } -> Client

Create a new SearchService REST client object.

Yields
  • (config) — Configure the SearchService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Chronicle::V1::SearchService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Chronicle::V1::SearchService::Rest::Client.new do |config|
  config.timeout = 10.0
end

#list_searched_results

def list_searched_results(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::SearchedResult>
def list_searched_results(parent: nil, page_size: nil, page_token: nil, order_by: nil, skip: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::SearchedResult>

Retrieves results from a completed Search operation.

Overloads
def list_searched_results(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::SearchedResult>
Pass arguments to list_searched_results via a request object, either of type ListSearchedResultsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Chronicle::V1::ListSearchedResultsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_searched_results(parent: nil, page_size: nil, page_token: nil, order_by: nil, skip: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Chronicle::V1::SearchedResult>
Pass arguments to list_searched_results via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent SearchSession resource name. Format: projects/{project}/locations/{location}/instances/{instance}/searchSessions/{search_session}
  • page_size (::Integer) — Optional. The maximum number of results to return. The service may return fewer. If unspecified, at most 100 results will be returned. The maximum value is 1000.
  • page_token (::String) — Optional. A page token, received from a previous ListSearchedResults call. Provide this to retrieve the subsequent page.
  • order_by (::String) — Optional. The column to sort the results on. Example: "event_timestamp desc", "principal.hostname asc". Multi-columnar sorting is not supported.
  • skip (::Integer) — Optional. The number of results to skip before starting to return results. This field should not be used in conjunction with page_token.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/chronicle/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Chronicle::V1::SearchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Chronicle::V1::ListSearchedResultsRequest.new

# Call the list_searched_results method.
result = client.list_searched_results request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Chronicle::V1::SearchedResult.
  p item
end

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#operations_client

def operations_client() -> ::Google::Cloud::Chronicle::V1::SearchService::Rest::Operations

Get the associated client for long-running operations.

#search

def search(request, options = nil) -> ::Gapic::Operation
def search(parent: nil, query: nil, time_range: nil, dialect: nil, draft_data_access_scope: nil, result_limit: nil, simulated_data_visibility: nil) -> ::Gapic::Operation

Initiates a long-running search operation.

Overloads
def search(request, options = nil) -> ::Gapic::Operation
Pass arguments to search via a request object, either of type Google::Cloud::Chronicle::V1::SearchRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Chronicle::V1::SearchRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def search(parent: nil, query: nil, time_range: nil, dialect: nil, draft_data_access_scope: nil, result_limit: nil, simulated_data_visibility: nil) -> ::Gapic::Operation
Pass arguments to search via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The resource name of the instance on which to perform the search. Format: projects/{project}/locations/{location}/instances/{instance}
  • query (::String) — Required. The search query, in the dialect set in dialect. Example: 'ip=/172.*/ AND metadata.event_type!="NETWORK_CONNECTION" AND ( target.ip = "3.225.179.73" OR target.ip = "23.47.48.70")'
  • time_range (::Google::Type::Interval, ::Hash) — Required. Time range to search for [Inclusive start time, exclusive end time).
  • dialect (::Google::Cloud::Chronicle::V1::QueryDialect) — Optional. Specifies the dialect the Search Query is written in. If not specified, the query will be parsed as YL2.
  • draft_data_access_scope (::Google::Cloud::Chronicle::V1::DataAccessScope, ::Hash) — Optional. Data access scope used to filter events. This is intended to be used by admins to preview in-development scopes. Should only be called by users with global access. If the caller does not have global access, the request will fail.
  • result_limit (::Integer) — Optional. Requested maximum number of rows to materialize. The service may return fewer. If unspecified, a server-side default of 10,000 is used. The maximum value is 1,000,000. Some dialects have a lower maximum; see QueryDialect.
  • simulated_data_visibility (::Google::Cloud::Chronicle::V1::SimulatedDataVisibility) — Optional. Specifies visibility of simulated data to include in search results.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/chronicle/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Chronicle::V1::SearchService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Chronicle::V1::SearchRequest.new

# Call the search method.
result = client.search request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)