Reference documentation and code samples for the Chronicle V1 API class Google::Cloud::Chronicle::V1::SearchService::Client.
Client for the SearchService service.
SearchService provides methods for searching data in Chronicle.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the SearchService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all SearchService clients ::Google::Cloud::Chronicle::V1::SearchService::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#initialize
def initialize() { |config| ... } -> ClientCreate a new SearchService client object.
- (config) — Configure the SearchService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Chronicle::V1::SearchService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Chronicle::V1::SearchService::Client.new do |config| config.timeout = 10.0 end
#list_searched_results
def list_searched_results(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Chronicle::V1::SearchedResult>
def list_searched_results(parent: nil, page_size: nil, page_token: nil, order_by: nil, skip: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Chronicle::V1::SearchedResult>Retrieves results from a completed Search operation.
def list_searched_results(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Chronicle::V1::SearchedResult>list_searched_results via a request object, either of type
ListSearchedResultsRequest or an equivalent Hash.
- 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::PagedEnumerable<::Google::Cloud::Chronicle::V1::SearchedResult>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).
- 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
ListSearchedResultscall. 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Chronicle::V1::SearchedResult>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Chronicle::V1::SearchedResult>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::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() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#operations_client
def operations_client() -> ::Google::Cloud::Chronicle::V1::SearchService::OperationsGet 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::OperationInitiates a long-running search operation.
def search(request, options = nil) -> ::Gapic::Operationsearch via a request object, either of type
Google::Cloud::Chronicle::V1::SearchRequest or an equivalent Hash.
- 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::Operationsearch 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).
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::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() -> StringThe effective universe domain
- (String)