Discovery Engine V1BETA API - Class Google::Cloud::DiscoveryEngine::V1beta::EngineService::Client (v0.11.0)

Reference documentation and code samples for the Discovery Engine V1BETA API class Google::Cloud::DiscoveryEngine::V1beta::EngineService::Client.

Client for the EngineService service.

Service for managing Engine configuration.

Inherits

  • Object

Methods

.configure

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

Configure the EngineService 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 EngineService clients
::Google::Cloud::DiscoveryEngine::V1beta::EngineService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the EngineService 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

#create_engine

def create_engine(request, options = nil) -> ::Gapic::Operation
def create_engine(parent: nil, engine: nil, engine_id: nil) -> ::Gapic::Operation

Creates a Engine.

Overloads
def create_engine(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_engine via a request object, either of type CreateEngineRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1beta::CreateEngineRequest, ::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 create_engine(parent: nil, engine: nil, engine_id: nil) -> ::Gapic::Operation
Pass arguments to create_engine 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 resource name, such as projects/{project}/locations/{location}/collections/{collection}.
  • engine (::Google::Cloud::DiscoveryEngine::V1beta::Engine, ::Hash) — Required. The Engine to create.
  • engine_id (::String) — Required. The ID to use for the Engine, which will become the final component of the Engine's resource name.

    This field must conform to RFC-1034 standard with a length limit of 63 characters. Otherwise, an INVALID_ARGUMENT error is returned.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::EngineService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::CreateEngineRequest.new

# Call the create_engine method.
result = client.create_engine 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

#delete_engine

def delete_engine(request, options = nil) -> ::Gapic::Operation
def delete_engine(name: nil) -> ::Gapic::Operation

Deletes a Engine.

Overloads
def delete_engine(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_engine via a request object, either of type DeleteEngineRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1beta::DeleteEngineRequest, ::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 delete_engine(name: nil) -> ::Gapic::Operation
Pass arguments to delete_engine 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).
Parameter
  • name (::String) — Required. Full resource name of Engine, such as projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}.

    If the caller does not have permission to delete the Engine, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

    If the Engine to delete does not exist, a NOT_FOUND error is returned.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::EngineService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::DeleteEngineRequest.new

# Call the delete_engine method.
result = client.delete_engine 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

#get_engine

def get_engine(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Engine
def get_engine(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Engine

Gets a Engine.

Overloads
def get_engine(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Engine
Pass arguments to get_engine via a request object, either of type GetEngineRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1beta::GetEngineRequest, ::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 get_engine(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Engine
Pass arguments to get_engine 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).
Parameter
  • name (::String) — Required. Full resource name of Engine, such as projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::EngineService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::GetEngineRequest.new

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

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Engine.
p result

#initialize

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

Create a new EngineService client object.

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

# Create a client using a custom configuration
client = ::Google::Cloud::DiscoveryEngine::V1beta::EngineService::Client.new do |config|
  config.timeout = 10.0
end

#list_engines

def list_engines(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Engine>
def list_engines(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Engine>

Lists all the {::Google::Cloud::DiscoveryEngine::V1beta::Engine Engine}s associated with the project.

Overloads
def list_engines(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Engine>
Pass arguments to list_engines via a request object, either of type ListEnginesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1beta::ListEnginesRequest, ::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_engines(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Engine>
Pass arguments to list_engines 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 resource name, such as projects/{project}/locations/{location}/collections/{collection_id}.
  • page_size (::Integer) — Optional. Not supported.
  • page_token (::String) — Optional. Not supported.
  • filter (::String) — Optional. Filter by solution type. For example: solution_type=SOLUTION_TYPE_SEARCH
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::EngineService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::ListEnginesRequest.new

# Call the list_engines method.
result = client.list_engines 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::DiscoveryEngine::V1beta::Engine.
  p item
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Client)

#operations_client

def operations_client() -> ::Google::Cloud::DiscoveryEngine::V1beta::EngineService::Operations

Get the associated client for long-running operations.

#pause_engine

def pause_engine(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Engine
def pause_engine(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Engine

Pauses the training of an existing engine. Only applicable if SolutionType is SOLUTION_TYPE_RECOMMENDATION.

Overloads
def pause_engine(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Engine
Pass arguments to pause_engine via a request object, either of type PauseEngineRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1beta::PauseEngineRequest, ::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 pause_engine(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Engine
Pass arguments to pause_engine 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).
Parameter
  • name (::String) — Required. The name of the engine to pause. Format: projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::EngineService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::PauseEngineRequest.new

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

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Engine.
p result

#resume_engine

def resume_engine(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Engine
def resume_engine(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Engine

Resumes the training of an existing engine. Only applicable if SolutionType is SOLUTION_TYPE_RECOMMENDATION.

Overloads
def resume_engine(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Engine
Pass arguments to resume_engine via a request object, either of type ResumeEngineRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1beta::ResumeEngineRequest, ::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 resume_engine(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Engine
Pass arguments to resume_engine 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).
Parameter
  • name (::String) — Required. The name of the engine to resume. Format: projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::EngineService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::ResumeEngineRequest.new

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

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Engine.
p result

#tune_engine

def tune_engine(request, options = nil) -> ::Gapic::Operation
def tune_engine(name: nil) -> ::Gapic::Operation

Tunes an existing engine. Only applicable if SolutionType is SOLUTION_TYPE_RECOMMENDATION.

Overloads
def tune_engine(request, options = nil) -> ::Gapic::Operation
Pass arguments to tune_engine via a request object, either of type TuneEngineRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1beta::TuneEngineRequest, ::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 tune_engine(name: nil) -> ::Gapic::Operation
Pass arguments to tune_engine 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).
Parameter
  • name (::String) — Required. The resource name of the engine to tune. Format: projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::EngineService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::TuneEngineRequest.new

# Call the tune_engine method.
result = client.tune_engine 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)

#update_engine

def update_engine(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Engine
def update_engine(engine: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Engine

Updates an Engine

Overloads
def update_engine(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Engine
Pass arguments to update_engine via a request object, either of type UpdateEngineRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1beta::UpdateEngineRequest, ::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 update_engine(engine: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Engine
Pass arguments to update_engine 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
  • engine (::Google::Cloud::DiscoveryEngine::V1beta::Engine, ::Hash) — Required. The Engine to update.

    If the caller does not have permission to update the Engine, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

    If the Engine to update does not exist, a NOT_FOUND error is returned.

  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Indicates which fields in the provided Engine to update.

    If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::EngineService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::UpdateEngineRequest.new

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

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Engine.
p result