Vertex AI V1 API - Class Google::Cloud::AIPlatform::V1::ModelService::Client (v0.2.0)

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

Client for the ModelService service.

A service for managing Vertex AI's machine learning Models.

Inherits

  • Object

Methods

.configure

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

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

#configure

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

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

#delete_model

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

Deletes a Model.

A model cannot be deleted if any Endpoint resource has a DeployedModel based on the model in its deployed_models 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::AIPlatform::V1::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. The name of the Model resource to be deleted. Format: projects/{project}/locations/{location}/models/{model}
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::ModelService::Client.new

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end

#export_model

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

Exports a trained, exportable Model to a location specified by the user. A Model is considered to be exportable if it has at least one supported export format.

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

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end

#get_model

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

Gets a Model.

Overloads
def get_model(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Model
Pass arguments to get_model via a request object, either of type GetModelRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::GetModelRequest, ::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_model(name: nil) -> ::Google::Cloud::AIPlatform::V1::Model
Pass arguments to get_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. The name of the Model resource. Format: projects/{project}/locations/{location}/models/{model}
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::ModelService::Client.new

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

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

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

#get_model_evaluation

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

Gets a ModelEvaluation.

Overloads
def get_model_evaluation(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::ModelEvaluation
Pass arguments to get_model_evaluation via a request object, either of type GetModelEvaluationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::GetModelEvaluationRequest, ::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_model_evaluation(name: nil) -> ::Google::Cloud::AIPlatform::V1::ModelEvaluation
Pass arguments to get_model_evaluation 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 ModelEvaluation resource. Format: projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}
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::ModelService::Client.new

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

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

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

#get_model_evaluation_slice

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

Gets a ModelEvaluationSlice.

Overloads
def get_model_evaluation_slice(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice
Pass arguments to get_model_evaluation_slice via a request object, either of type GetModelEvaluationSliceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::GetModelEvaluationSliceRequest, ::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_model_evaluation_slice(name: nil) -> ::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice
Pass arguments to get_model_evaluation_slice 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 ModelEvaluationSlice resource. Format: projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}
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::ModelService::Client.new

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

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

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

#import_model_evaluation

def import_model_evaluation(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::ModelEvaluation
def import_model_evaluation(parent: nil, model_evaluation: nil) -> ::Google::Cloud::AIPlatform::V1::ModelEvaluation

Imports an externally generated ModelEvaluation.

Overloads
def import_model_evaluation(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::ModelEvaluation
Pass arguments to import_model_evaluation via a request object, either of type ImportModelEvaluationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::ImportModelEvaluationRequest, ::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 import_model_evaluation(parent: nil, model_evaluation: nil) -> ::Google::Cloud::AIPlatform::V1::ModelEvaluation
Pass arguments to import_model_evaluation 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 name of the parent model resource. Format: projects/{project}/locations/{location}/models/{model}
  • model_evaluation (::Google::Cloud::AIPlatform::V1::ModelEvaluation, ::Hash) — Required. Model evaluation resource to be imported.
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::ModelService::Client.new

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

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

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

#initialize

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

Create a new ModelService client object.

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

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

#list_model_evaluation_slices

def list_model_evaluation_slices(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice>
def list_model_evaluation_slices(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice>

Lists ModelEvaluationSlices in a ModelEvaluation.

Overloads
def list_model_evaluation_slices(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice>
Pass arguments to list_model_evaluation_slices via a request object, either of type ListModelEvaluationSlicesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesRequest, ::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_model_evaluation_slices(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice>
Pass arguments to list_model_evaluation_slices 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 ModelEvaluation to list the ModelEvaluationSlices from. Format: projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}
  • filter (::String) —

    The standard list filter.

    • slice.dimension - for =.
  • page_size (::Integer) — The standard list page size.
  • page_token (::String) — The standard list page token. Typically obtained via ListModelEvaluationSlicesResponse.next_page_token of the previous ModelService.ListModelEvaluationSlices call.
  • read_mask (::Google::Protobuf::FieldMask, ::Hash) — Mask specifying which fields to read.
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::ModelService::Client.new

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice.
  p response
end

#list_model_evaluations

def list_model_evaluations(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelEvaluation>
def list_model_evaluations(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelEvaluation>

Lists ModelEvaluations in a Model.

Overloads
def list_model_evaluations(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelEvaluation>
Pass arguments to list_model_evaluations via a request object, either of type ListModelEvaluationsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::ListModelEvaluationsRequest, ::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_model_evaluations(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelEvaluation>
Pass arguments to list_model_evaluations 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 Model to list the ModelEvaluations from. Format: projects/{project}/locations/{location}/models/{model}
  • filter (::String) — The standard list filter.
  • page_size (::Integer) — The standard list page size.
  • page_token (::String) — The standard list page token. Typically obtained via ListModelEvaluationsResponse.next_page_token of the previous ModelService.ListModelEvaluations call.
  • read_mask (::Google::Protobuf::FieldMask, ::Hash) — Mask specifying which fields to read.
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::ModelService::Client.new

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::AIPlatform::V1::ModelEvaluation.
  p response
end

#list_models

def list_models(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Model>
def list_models(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Model>

Lists Models in a Location.

Overloads
def list_models(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Model>
Pass arguments to list_models via a request object, either of type ListModelsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::ListModelsRequest, ::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_models(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Model>
Pass arguments to list_models 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 Models from. Format: projects/{project}/locations/{location}
  • filter (::String) —

    An expression for filtering the results of the request. For field names both snake_case and camelCase are supported.

    • model supports = and !=. model represents the Model ID, i.e. the last segment of the Model's resource name.
    • display_name supports = and !=
    • labels supports general map functions that is:
      • labels.key=value - key:value equality
      • `labels.key:* or labels:key - key existence
      • A key including a space must be quoted. labels."a key".

    Some examples:

    • model=1234
    • displayName="myDisplayName"
    • labels.myKey="myValue"
  • page_size (::Integer) — The standard list page size.
  • page_token (::String) — The standard list page token. Typically obtained via ListModelsResponse.next_page_token of the previous ModelService.ListModels call.
  • read_mask (::Google::Protobuf::FieldMask, ::Hash) — Mask specifying which fields to read.
  • order_by (::String) — A comma-separated list of fields to order by, sorted in ascending order. Use "desc" after a field name for descending. Supported fields:

    • display_name
    • create_time
    • update_time

    Example: display_name, create_time desc.

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::ModelService::Client.new

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::AIPlatform::V1::Model.
  p response
end

#operations_client

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

Get the associated client for long-running operations.

#update_model

def update_model(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Model
def update_model(model: nil, update_mask: nil) -> ::Google::Cloud::AIPlatform::V1::Model

Updates a Model.

Overloads
def update_model(request, options = nil) -> ::Google::Cloud::AIPlatform::V1::Model
Pass arguments to update_model via a request object, either of type UpdateModelRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::UpdateModelRequest, ::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_model(model: nil, update_mask: nil) -> ::Google::Cloud::AIPlatform::V1::Model
Pass arguments to update_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
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::ModelService::Client.new

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

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

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

#upload_model

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

Uploads a Model artifact into Vertex AI.

Overloads
def upload_model(request, options = nil) -> ::Gapic::Operation
Pass arguments to upload_model via a request object, either of type UploadModelRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AIPlatform::V1::UploadModelRequest, ::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 upload_model(parent: nil, model: nil) -> ::Gapic::Operation
Pass arguments to upload_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
  • parent (::String) — Required. The resource name of the Location into which to upload the Model. Format: projects/{project}/locations/{location}
  • model (::Google::Cloud::AIPlatform::V1::Model, ::Hash) — Required. The Model to create.
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::ModelService::Client.new

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end