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