Cloud AutoML V1beta1 API - Class Google::Cloud::AutoML::V1beta1::AutoML::Client (v0.6.1)

Reference documentation and code samples for the Cloud AutoML V1beta1 API class Google::Cloud::AutoML::V1beta1::AutoML::Client.

Client for the AutoMl service.

AutoML Server API.

The resource names are assigned by the server. The server never reuses names that it has created after the resources with those names are deleted.

An ID of a resource is the last element of the item's resource name. For projects/{project_id}/locations/{location_id}/datasets/{dataset_id}, then the id for the item is {dataset_id}.

Currently the only supported location_id is "us-central1".

On any input that is documented to expect a string parameter in snake_case or kebab-case, either of those cases is accepted.

Inherits

  • Object

Methods

.configure

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

Configure the AutoMl 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 AutoMl clients
::Google::Cloud::AutoML::V1beta1::AutoML::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the AutoMl 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_dataset

def create_dataset(request, options = nil) -> ::Google::Cloud::AutoML::V1beta1::Dataset
def create_dataset(parent: nil, dataset: nil) -> ::Google::Cloud::AutoML::V1beta1::Dataset

Creates a dataset.

Overloads
def create_dataset(request, options = nil) -> ::Google::Cloud::AutoML::V1beta1::Dataset
Pass arguments to create_dataset via a request object, either of type CreateDatasetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AutoML::V1beta1::CreateDatasetRequest, ::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_dataset(parent: nil, dataset: nil) -> ::Google::Cloud::AutoML::V1beta1::Dataset
Pass arguments to create_dataset 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
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/automl/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::CreateDatasetRequest.new

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

# The returned object is of type Google::Cloud::AutoML::V1beta1::Dataset.
p result

#create_model

def create_model(request, options = nil) -> ::Gapic::Operation
def create_model(parent: nil, model: nil) -> ::Gapic::Operation

Creates a model. Returns a Model in the response field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.

Overloads
def create_model(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_model via a request object, either of type CreateModelRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AutoML::V1beta1::CreateModelRequest, ::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_model(parent: nil, model: nil) -> ::Gapic::Operation
Pass arguments to create_model 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
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/automl/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::CreateModelRequest.new

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

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

Deletes a dataset and all of its contents. Returns empty response in the response field when it completes, and delete_details in the metadata field.

Overloads
def delete_dataset(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_dataset via a request object, either of type DeleteDatasetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AutoML::V1beta1::DeleteDatasetRequest, ::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_dataset(name: nil) -> ::Gapic::Operation
Pass arguments to delete_dataset 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 dataset to delete.
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/automl/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::DeleteDatasetRequest.new

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

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

Deletes a model. Returns google.protobuf.Empty in the response field when it completes, and delete_details in the metadata field.

Overloads
def delete_model(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_model via a request object, either of type DeleteModelRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AutoML::V1beta1::DeleteModelRequest, ::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_model(name: nil) -> ::Gapic::Operation
Pass arguments to delete_model 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. Resource name of the model being deleted.
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/automl/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::DeleteModelRequest.new

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

#deploy_model

def deploy_model(request, options = nil) -> ::Gapic::Operation
def deploy_model(image_object_detection_model_deployment_metadata: nil, image_classification_model_deployment_metadata: nil, name: nil) -> ::Gapic::Operation

Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing

[node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability.

Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically.

Returns an empty response in the response field when it completes.

Overloads
def deploy_model(request, options = nil) -> ::Gapic::Operation
Pass arguments to deploy_model via a request object, either of type DeployModelRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AutoML::V1beta1::DeployModelRequest, ::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 deploy_model(image_object_detection_model_deployment_metadata: nil, image_classification_model_deployment_metadata: nil, name: nil) -> ::Gapic::Operation
Pass arguments to deploy_model 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
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/automl/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::DeployModelRequest.new

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

#export_data

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

Exports dataset's data to the provided output location. Returns an empty response in the response field when it completes.

Overloads
def export_data(request, options = nil) -> ::Gapic::Operation
Pass arguments to export_data via a request object, either of type ExportDataRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AutoML::V1beta1::ExportDataRequest, ::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 export_data(name: nil, output_config: nil) -> ::Gapic::Operation
Pass arguments to export_data 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
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/automl/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::ExportDataRequest.new

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

#export_evaluated_examples

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

Exports examples on which the model was evaluated (i.e. which were in the TEST set of the dataset the model was created from), together with their ground truth annotations and the annotations created (predicted) by the model. The examples, ground truth and predictions are exported in the state they were at the moment the model was evaluated.

This export is available only for 30 days since the model evaluation is created.

Currently only available for Tables.

Returns an empty response in the response field when it completes.

Overloads
def export_evaluated_examples(request, options = nil) -> ::Gapic::Operation
Pass arguments to export_evaluated_examples via a request object, either of type ExportEvaluatedExamplesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AutoML::V1beta1::ExportEvaluatedExamplesRequest, ::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 export_evaluated_examples(name: nil, output_config: nil) -> ::Gapic::Operation
Pass arguments to export_evaluated_examples 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
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/automl/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::ExportEvaluatedExamplesRequest.new

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

#export_model

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

Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in

ModelExportOutputConfig.

Returns an empty response in the response field when it completes.

Overloads
def export_model(request, options = nil) -> ::Gapic::Operation
Pass arguments to export_model via a request object, either of type ExportModelRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AutoML::V1beta1::ExportModelRequest, ::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 export_model(name: nil, output_config: nil) -> ::Gapic::Operation
Pass arguments to export_model 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
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/automl/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::ExportModelRequest.new

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

def get_annotation_spec(request, options = nil) -> ::Google::Cloud::AutoML::V1beta1::AnnotationSpec
def get_annotation_spec(name: nil) -> ::Google::Cloud::AutoML::V1beta1::AnnotationSpec

Gets an annotation spec.

Overloads
def get_annotation_spec(request, options = nil) -> ::Google::Cloud::AutoML::V1beta1::AnnotationSpec
Pass arguments to get_annotation_spec via a request object, either of type GetAnnotationSpecRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AutoML::V1beta1::GetAnnotationSpecRequest, ::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_annotation_spec(name: nil) -> ::Google::Cloud::AutoML::V1beta1::AnnotationSpec
Pass arguments to get_annotation_spec 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 annotation spec to retrieve.
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/automl/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AutoML::V1beta1::GetAnnotationSpecRequest.new

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

# The returned object is of type Google::Cloud::AutoML::V1beta1::AnnotationSpec.
p result

#get_column_spec

def get_column_spec(request, options = nil) -> ::Google::Cloud::AutoML::V1beta1::ColumnSpec
def get_column_spec(name: nil, field_mask: nil) -> ::Google::Cloud::AutoML::V1beta1::ColumnSpec

Gets a column spec.

Overloads
def get_column_spec(request, options = nil) -> ::Google::Cloud::AutoML::V1beta1::ColumnSpec
Pass arguments to get_column_spec via a request object, either of type GetColumnSpecRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AutoML::V1beta1::GetColumnSpecRequest, ::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_column_spec(name: nil, field_mask: nil) -> ::Google::Cloud::AutoML::V1beta1::ColumnSpec
Pass arguments to get_column_spec 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