Vertex AI V1 API - Class Google::Cloud::AIPlatform::V1::VizierService::Client (v0.22.0)

Reference documentation and code samples for the Vertex AI V1 API class Google::Cloud::AIPlatform::V1::VizierService::Client.

Client for the VizierService service.

Vertex AI Vizier API.

Vertex AI Vizier is a service to solve blackbox optimization problems, such as tuning machine learning hyperparameters and searching over deep learning architectures.

Inherits

  • Object

Methods

.configure

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

Configure the VizierService 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 VizierService clients
::Google::Cloud::AIPlatform::V1::VizierService::Client.configure do |config|
  config.timeout = 10.0
end

#add_trial_measurement

def add_trial_measurement(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Trial
def add_trial_measurement(trial_name: nil, measurement: nil) -> ::Google::Cloud::AIPlatform::V1::Trial

Adds a measurement of the objective metrics to a Trial. This measurement is assumed to have been taken before the Trial is complete.

Overloads
def add_trial_measurement(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Trial
Pass arguments to add_trial_measurement via a request object, either of type AddTrialMeasurementRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::AddTrialMeasurementRequest, ::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 add_trial_measurement(trial_name: nil, measurement: nil) -> ::Google::Cloud::AIPlatform::V1::Trial
Pass arguments to add_trial_measurement 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
  • trial_name (::String) — Required. The name of the trial to add measurement. Format: projects/{project}/locations/{location}/studies/{study}/trials/{trial}
  • measurement (::Google::Cloud::AIPlatform::V1::Measurement, ::Hash) — Required. The measurement to be added to a Trial.
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/ai_platform/v1"

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

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

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

# The returned object is of type Google::Cloud::AIPlatform::V1::Trial.
p result

#check_trial_early_stopping_state

def check_trial_early_stopping_state(request, options = nil) -> ::Gapic::Operation
def check_trial_early_stopping_state(trial_name: nil) -> ::Gapic::Operation

Checks whether a Trial should stop or not. Returns a long-running operation. When the operation is successful, it will contain a CheckTrialEarlyStoppingStateResponse.

Overloads
def check_trial_early_stopping_state(request, options = nil) -> ::Gapic::Operation
Pass arguments to check_trial_early_stopping_state via a request object, either of type CheckTrialEarlyStoppingStateRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateRequest, ::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 check_trial_early_stopping_state(trial_name: nil) -> ::Gapic::Operation
Pass arguments to check_trial_early_stopping_state 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
  • trial_name (::String) — Required. The Trial's name. Format: projects/{project}/locations/{location}/studies/{study}/trials/{trial}
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/ai_platform/v1"

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

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

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

#complete_trial

def complete_trial(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Trial
def complete_trial(name: nil, final_measurement: nil, trial_infeasible: nil, infeasible_reason: nil) -> ::Google::Cloud::AIPlatform::V1::Trial

Marks a Trial as complete.

Overloads
def complete_trial(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Trial
Pass arguments to complete_trial via a request object, either of type CompleteTrialRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::CompleteTrialRequest, ::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 complete_trial(name: nil, final_measurement: nil, trial_infeasible: nil, infeasible_reason: nil) -> ::Google::Cloud::AIPlatform::V1::Trial
Pass arguments to complete_trial 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
  • name (::String) — Required. The Trial's name. Format: projects/{project}/locations/{location}/studies/{study}/trials/{trial}
  • final_measurement (::Google::Cloud::AIPlatform::V1::Measurement, ::Hash) — Optional. If provided, it will be used as the completed Trial's final_measurement; Otherwise, the service will auto-select a previously reported measurement as the final-measurement
  • trial_infeasible (::Boolean) — Optional. True if the Trial cannot be run with the given Parameter, and final_measurement will be ignored.
  • infeasible_reason (::String) — Optional. A human readable reason why the trial was infeasible. This should only be provided if trial_infeasible is true.
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/ai_platform/v1"

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

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

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

# The returned object is of type Google::Cloud::AIPlatform::V1::Trial.
p result

#configure

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

Configure the VizierService 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_study

def create_study(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Study
def create_study(parent: nil, study: nil) -> ::Google::Cloud::AIPlatform::V1::Study

Creates a Study. A resource name will be generated after creation of the Study.

Overloads
def create_study(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Study
Pass arguments to create_study via a request object, either of type CreateStudyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::CreateStudyRequest, ::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_study(parent: nil, study: nil) -> ::Google::Cloud::AIPlatform::V1::Study
Pass arguments to create_study 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 Location to create the CustomJob in. Format: projects/{project}/locations/{location}
  • study (::Google::Cloud::AIPlatform::V1::Study, ::Hash) — Required. The Study configuration used to create the Study.
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/ai_platform/v1"

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

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

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

# The returned object is of type Google::Cloud::AIPlatform::V1::Study.
p result

#create_trial

def create_trial(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Trial
def create_trial(parent: nil, trial: nil) -> ::Google::Cloud::AIPlatform::V1::Trial

Adds a user provided Trial to a Study.

Overloads
def create_trial(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Trial
Pass arguments to create_trial via a request object, either of type CreateTrialRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::CreateTrialRequest, ::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_trial(parent: nil, trial: nil) -> ::Google::Cloud::AIPlatform::V1::Trial
Pass arguments to create_trial 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 Study to create the Trial in. Format: projects/{project}/locations/{location}/studies/{study}
  • trial (::Google::Cloud::AIPlatform::V1::Trial, ::Hash) — Required. The Trial to create.
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/ai_platform/v1"

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

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

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

# The returned object is of type Google::Cloud::AIPlatform::V1::Trial.
p result

#delete_study

def delete_study(request, options = nil) -> ::Google::Protobuf::Empty
def delete_study(name: nil) -> ::Google::Protobuf::Empty

Deletes a Study.

Overloads
def delete_study(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_study via a request object, either of type DeleteStudyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::DeleteStudyRequest, ::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_study(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_study 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 Study resource to be deleted. Format: projects/{project}/locations/{location}/studies/{study}
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/ai_platform/v1"

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

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

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

# The returned object is of type Google::Protobuf::Empty.
p result

#delete_trial

def delete_trial(request, options = nil) -> ::Google::Protobuf::Empty
def delete_trial(name: nil) -> ::Google::Protobuf::Empty

Deletes a Trial.

Overloads
def delete_trial(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_trial via a request object, either of type DeleteTrialRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::DeleteTrialRequest, ::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_trial(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_trial 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 Trial's name. Format: projects/{project}/locations/{location}/studies/{study}/trials/{trial}
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/ai_platform/v1"

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

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

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

# The returned object is of type Google::Protobuf::Empty.
p result

#get_study

def get_study(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Study
def get_study(name: nil) -> ::Google::Cloud::AIPlatform::V1::Study

Gets a Study by name.

Overloads
def get_study(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Study
Pass arguments to get_study via a request object, either of type GetStudyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::GetStudyRequest, ::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_study(name: nil) -> ::Google::Cloud::AIPlatform::V1::Study
Pass arguments to get_study 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 Study resource. Format: projects/{project}/locations/{location}/studies/{study}
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/ai_platform/v1"

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

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

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

# The returned object is of type Google::Cloud::AIPlatform::V1::Study.
p result

#get_trial

def get_trial(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Trial
def get_trial(name: nil) -> ::Google::Cloud::AIPlatform::V1::Trial

Gets a Trial.

Overloads
def get_trial(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Trial
Pass arguments to get_trial via a request object, either of type GetTrialRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::GetTrialRequest, ::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_trial(name: nil) -> ::Google::Cloud::AIPlatform::V1::Trial
Pass arguments to get_trial 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 Trial resource. Format: projects/{project}/locations/{location}/studies/{study}/trials/{trial}
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/ai_platform/v1"

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

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

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

# The returned object is of type Google::Cloud::AIPlatform::V1::Trial.
p result

#iam_policy_client

def iam_policy_client() -> Google::Iam::V1::IAMPolicy::Client

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

Returns
  • (Google::Iam::V1::IAMPolicy::Client)

#initialize

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

Create a new VizierService client object.

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

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

#list_optimal_trials

def list_optimal_trials(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse
def list_optimal_trials(parent: nil) -> ::Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse

Lists the pareto-optimal Trials for multi-objective Study or the optimal Trials for single-objective Study. The definition of pareto-optimal can be checked in wiki page. https://en.wikipedia.org/wiki/Pareto_efficiency

Overloads
def list_optimal_trials(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse
Pass arguments to list_optimal_trials via a request object, either of type ListOptimalTrialsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::ListOptimalTrialsRequest, ::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_optimal_trials(parent: nil) -> ::Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse
Pass arguments to list_optimal_trials 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
  • parent (::String) — Required. The name of the Study that the optimal Trial belongs to.
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/ai_platform/v1"

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

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

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

# The returned object is of type Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse.
p result

#list_studies

def list_studies(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Study>
def list_studies(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Study>

Lists all the studies in a region for an associated project.

Overloads
def list_studies(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Study>
Pass arguments to list_studies via a request object, either of type ListStudiesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::ListStudiesRequest, ::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_studies(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Study>
Pass arguments to list_studies 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 Location to list the Study from. Format: projects/{project}/locations/{location}
  • page_token (::String) — Optional. A page token to request the next page of results. If unspecified, there are no subsequent pages.
  • page_size (::Integer) — Optional. The maximum number of studies to return per "page" of results. If unspecified, service will pick an appropriate default.
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/ai_platform/v1"

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

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

# Call the list_studies method.
result = client.list_studies 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::AIPlatform::V1::Study.
  p item
end

#list_trials

def list_trials(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Trial>
def list_trials(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Trial>

Lists the Trials associated with a Study.

Overloads
def list_trials(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Trial>
Pass arguments to list_trials via a request object, either of type ListTrialsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::ListTrialsRequest, ::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_trials(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Trial>
Pass arguments to list_trials 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 Study to list the Trial from. Format: projects/{project}/locations/{location}/studies/{study}
  • page_token (::String) — Optional. A page token to request the next page of results. If unspecified, there are no subsequent pages.
  • page_size (::Integer) — Optional. The number of Trials to retrieve per "page" of results. If unspecified, the service will pick an appropriate default.
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/ai_platform/v1"

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

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

# Call the list_trials method.
result = client.list_trials 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::AIPlatform::V1::Trial.
  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)

#lookup_study

def lookup_study(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Study
def lookup_study(parent: nil, display_name: nil) -> ::Google::Cloud::AIPlatform::V1::Study

Looks a study up using the user-defined display_name field instead of the fully qualified resource name.

Overloads
def lookup_study(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Study
Pass arguments to lookup_study via a request object, either of type LookupStudyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::LookupStudyRequest, ::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 lookup_study(parent: nil, display_name: nil) -> ::Google::Cloud::AIPlatform::V1::Study
Pass arguments to lookup_study 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 Location to get the Study from. Format: projects/{project}/locations/{location}
  • display_name (::String) — Required. The user-defined display name of the Study
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/ai_platform/v1"

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

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

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

# The returned object is of type Google::Cloud::AIPlatform::V1::Study.
p result

#operations_client

def operations_client() -> ::Google::Cloud::AIPlatform::V1::VizierService::Operations

Get the associated client for long-running operations.

#stop_trial

def stop_trial(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Trial
def stop_trial(name: nil) -> ::Google::Cloud::AIPlatform::V1::Trial

Stops a Trial.

Overloads
def stop_trial(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Trial
Pass arguments to stop_trial via a request object, either of type StopTrialRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::StopTrialRequest, ::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 stop_trial(name: nil) -> ::Google::Cloud::AIPlatform::V1::Trial
Pass arguments to stop_trial 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 Trial's name. Format: projects/{project}/locations/{location}/studies/{study}/trials/{trial}
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/ai_platform/v1"

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

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

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

# The returned object is of type Google::Cloud::AIPlatform::V1::Trial.
p result

#suggest_trials

def suggest_trials(request, options = nil) -> ::Gapic::Operation
def suggest_trials(parent: nil, suggestion_count: nil, client_id: nil) -> ::Gapic::Operation

Adds one or more Trials to a Study, with parameter values suggested by Vertex AI Vizier. Returns a long-running operation associated with the generation of Trial suggestions. When this long-running operation succeeds, it will contain a [SuggestTrialsResponse][google.cloud.ml.v1.SuggestTrialsResponse].

Overloads
def suggest_trials(request, options = nil) -> ::Gapic::Operation
Pass arguments to suggest_trials via a request object, either of type SuggestTrialsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::SuggestTrialsRequest, ::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 suggest_trials(parent: nil, suggestion_count: nil, client_id: nil) -> ::Gapic::Operation
Pass arguments to suggest_trials 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 project and location that the Study belongs to. Format: projects/{project}/locations/{location}/studies/{study}
  • suggestion_count (::Integer) — Required. The number of suggestions requested. It must be positive.
  • client_id (::String) — Required. The identifier of the client that is requesting the suggestion.

    If multiple SuggestTrialsRequests have the same client_id, the service will return the identical suggested Trial if the Trial is pending, and provide a new Trial if the last suggested Trial was completed.

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/ai_platform/v1"

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

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

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