Class: Google::Cloud::AIPlatform::V1::JobService::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/ai_platform/v1/job_service/client.rb

Overview

Client for the JobService service.

A service for creating and managing Vertex AI's jobs.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#batch_prediction_job_path, #custom_job_path, #data_labeling_job_path, #dataset_path, #endpoint_path, #hyperparameter_tuning_job_path, #location_path, #model_deployment_monitoring_job_path, #model_path, #network_path, #tensorboard_path, #trial_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new JobService client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::AIPlatform::V1::JobService::Client.new

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

Yields:

  • (config)

    Configure the JobService client.

Yield Parameters:



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 111

def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/cloud/aiplatform/v1/job_service_services_pb"

  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
                           !@config.endpoint.split(".").first.include?("-")
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end
  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
  end

  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
  end

  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
  end

  @job_service_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::AIPlatform::V1::JobService::Stub,
    credentials:  credentials,
    endpoint:     @config.endpoint,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors
  )
end

Instance Attribute Details

#iam_policy_clientGoogle::Iam::V1::IAMPolicy::Client (readonly)

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

Returns:

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


184
185
186
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 184

def iam_policy_client
  @iam_policy_client
end

#location_clientGoogle::Cloud::Location::Locations::Client (readonly)

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

Returns:

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


177
178
179
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 177

def location_client
  @location_client
end

#operations_client::Google::Cloud::AIPlatform::V1::JobService::Operations (readonly)

Get the associated client for long-running operations.



170
171
172
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 170

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the JobService Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all JobService clients
::Google::Cloud::AIPlatform::V1::JobService::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 58

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "AIPlatform", "V1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#cancel_batch_prediction_job(request, options = nil) ⇒ ::Google::Protobuf::Empty #cancel_batch_prediction_job(name: nil) ⇒ ::Google::Protobuf::Empty

Cancels a BatchPredictionJob.

Starts asynchronous cancellation on the BatchPredictionJob. The server makes the best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetBatchPredictionJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On a successful cancellation, the BatchPredictionJob is not deleted;instead its BatchPredictionJob.state is set to CANCELLED. Any files already outputted by the job are not deleted.

Examples:

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

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

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

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

Overloads:

  • #cancel_batch_prediction_job(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to cancel_batch_prediction_job via a request object, either of type CancelBatchPredictionJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::CancelBatchPredictionJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #cancel_batch_prediction_job(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to cancel_batch_prediction_job 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) (defaults to: nil)

      Required. The name of the BatchPredictionJob to cancel. Format: projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 2102

def cancel_batch_prediction_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelBatchPredictionJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.cancel_batch_prediction_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.cancel_batch_prediction_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.cancel_batch_prediction_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :cancel_batch_prediction_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#cancel_custom_job(request, options = nil) ⇒ ::Google::Protobuf::Empty #cancel_custom_job(name: nil) ⇒ ::Google::Protobuf::Empty

Cancels a CustomJob. Starts asynchronous cancellation on the CustomJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetCustomJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the CustomJob is not deleted; instead it becomes a job with a CustomJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and CustomJob.state is set to CANCELLED.

Examples:

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

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

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

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

Overloads:

  • #cancel_custom_job(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to cancel_custom_job via a request object, either of type CancelCustomJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::CancelCustomJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #cancel_custom_job(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to cancel_custom_job 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) (defaults to: nil)

      Required. The name of the CustomJob to cancel. Format: projects/{project}/locations/{location}/customJobs/{custom_job}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 637

def cancel_custom_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelCustomJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.cancel_custom_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.cancel_custom_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.cancel_custom_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :cancel_custom_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#cancel_data_labeling_job(request, options = nil) ⇒ ::Google::Protobuf::Empty #cancel_data_labeling_job(name: nil) ⇒ ::Google::Protobuf::Empty

Cancels a DataLabelingJob. Success of cancellation is not guaranteed.

Examples:

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

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

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

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

Overloads:

  • #cancel_data_labeling_job(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to cancel_data_labeling_job via a request object, either of type CancelDataLabelingJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::CancelDataLabelingJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #cancel_data_labeling_job(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to cancel_data_labeling_job 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) (defaults to: nil)

      Required. The name of the DataLabelingJob. Format: projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 1121

def cancel_data_labeling_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelDataLabelingJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.cancel_data_labeling_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.cancel_data_labeling_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.cancel_data_labeling_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :cancel_data_labeling_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#cancel_hyperparameter_tuning_job(request, options = nil) ⇒ ::Google::Protobuf::Empty #cancel_hyperparameter_tuning_job(name: nil) ⇒ ::Google::Protobuf::Empty

Cancels a HyperparameterTuningJob. Starts asynchronous cancellation on the HyperparameterTuningJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetHyperparameterTuningJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the HyperparameterTuningJob is not deleted; instead it becomes a job with a HyperparameterTuningJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and HyperparameterTuningJob.state is set to CANCELLED.

Examples:

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

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

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

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

Overloads:

  • #cancel_hyperparameter_tuning_job(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to cancel_hyperparameter_tuning_job via a request object, either of type CancelHyperparameterTuningJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::CancelHyperparameterTuningJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #cancel_hyperparameter_tuning_job(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to cancel_hyperparameter_tuning_job 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) (defaults to: nil)

      Required. The name of the HyperparameterTuningJob to cancel. Format: projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 1610

def cancel_hyperparameter_tuning_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CancelHyperparameterTuningJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.cancel_hyperparameter_tuning_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.cancel_hyperparameter_tuning_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.cancel_hyperparameter_tuning_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :cancel_hyperparameter_tuning_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#configure {|config| ... } ⇒ Client::Configuration

Configure the JobService 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 configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



90
91
92
93
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 90

def configure
  yield @config if block_given?
  @config
end

#create_batch_prediction_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::BatchPredictionJob #create_batch_prediction_job(parent: nil, batch_prediction_job: nil) ⇒ ::Google::Cloud::AIPlatform::V1::BatchPredictionJob

Creates a BatchPredictionJob. A BatchPredictionJob once created will right away be attempted to start.

Examples:

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

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

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

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

Overloads:

  • #create_batch_prediction_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::BatchPredictionJob

    Pass arguments to create_batch_prediction_job via a request object, either of type CreateBatchPredictionJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::CreateBatchPredictionJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_batch_prediction_job(parent: nil, batch_prediction_job: nil) ⇒ ::Google::Cloud::AIPlatform::V1::BatchPredictionJob

    Pass arguments to create_batch_prediction_job 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) (defaults to: nil)

      Required. The resource name of the Location to create the BatchPredictionJob in. Format: projects/{project}/locations/{location}

    • batch_prediction_job (::Google::Cloud::AIPlatform::V1::BatchPredictionJob, ::Hash) (defaults to: nil)

      Required. The BatchPredictionJob to create.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 1699

def create_batch_prediction_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateBatchPredictionJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_batch_prediction_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_batch_prediction_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_batch_prediction_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :create_batch_prediction_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_custom_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::CustomJob #create_custom_job(parent: nil, custom_job: nil) ⇒ ::Google::Cloud::AIPlatform::V1::CustomJob

Creates a CustomJob. A created CustomJob right away will be attempted to be run.

Examples:

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

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

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

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

Overloads:

  • #create_custom_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::CustomJob

    Pass arguments to create_custom_job via a request object, either of type CreateCustomJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::CreateCustomJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_custom_job(parent: nil, custom_job: nil) ⇒ ::Google::Cloud::AIPlatform::V1::CustomJob

    Pass arguments to create_custom_job 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) (defaults to: nil)

      Required. The resource name of the Location to create the CustomJob in. Format: projects/{project}/locations/{location}

    • custom_job (::Google::Cloud::AIPlatform::V1::CustomJob, ::Hash) (defaults to: nil)

      Required. The CustomJob to create.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 236

def create_custom_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateCustomJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_custom_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_custom_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_custom_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :create_custom_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_data_labeling_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::DataLabelingJob #create_data_labeling_job(parent: nil, data_labeling_job: nil) ⇒ ::Google::Cloud::AIPlatform::V1::DataLabelingJob

Creates a DataLabelingJob.

Examples:

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

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

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

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

Overloads:

  • #create_data_labeling_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::DataLabelingJob

    Pass arguments to create_data_labeling_job via a request object, either of type CreateDataLabelingJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::CreateDataLabelingJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_data_labeling_job(parent: nil, data_labeling_job: nil) ⇒ ::Google::Cloud::AIPlatform::V1::DataLabelingJob

    Pass arguments to create_data_labeling_job 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) (defaults to: nil)

      Required. The parent of the DataLabelingJob. Format: projects/{project}/locations/{location}

    • data_labeling_job (::Google::Cloud::AIPlatform::V1::DataLabelingJob, ::Hash) (defaults to: nil)

      Required. The DataLabelingJob to create.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 725

def create_data_labeling_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateDataLabelingJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_data_labeling_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_data_labeling_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_data_labeling_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :create_data_labeling_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_hyperparameter_tuning_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob #create_hyperparameter_tuning_job(parent: nil, hyperparameter_tuning_job: nil) ⇒ ::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob

Creates a HyperparameterTuningJob

Examples:

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

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

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

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

Overloads:

  • #create_hyperparameter_tuning_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob

    Pass arguments to create_hyperparameter_tuning_job via a request object, either of type CreateHyperparameterTuningJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::CreateHyperparameterTuningJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_hyperparameter_tuning_job(parent: nil, hyperparameter_tuning_job: nil) ⇒ ::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob

    Pass arguments to create_hyperparameter_tuning_job 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) (defaults to: nil)

      Required. The resource name of the Location to create the HyperparameterTuningJob in. Format: projects/{project}/locations/{location}

    • hyperparameter_tuning_job (::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob, ::Hash) (defaults to: nil)

      Required. The HyperparameterTuningJob to create.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 1209

def create_hyperparameter_tuning_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateHyperparameterTuningJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_hyperparameter_tuning_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_hyperparameter_tuning_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_hyperparameter_tuning_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :create_hyperparameter_tuning_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_model_deployment_monitoring_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob #create_model_deployment_monitoring_job(parent: nil, model_deployment_monitoring_job: nil) ⇒ ::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob

Creates a ModelDeploymentMonitoringJob. It will run periodically on a configured interval.

Examples:

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

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

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

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

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 2191

def create_model_deployment_monitoring_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateModelDeploymentMonitoringJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_model_deployment_monitoring_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_model_deployment_monitoring_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_model_deployment_monitoring_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :create_model_deployment_monitoring_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_batch_prediction_job(request, options = nil) ⇒ ::Gapic::Operation #delete_batch_prediction_job(name: nil) ⇒ ::Gapic::Operation

Deletes a BatchPredictionJob. Can only be called on jobs that already finished.

Examples:

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

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

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

Overloads:

  • #delete_batch_prediction_job(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_batch_prediction_job via a request object, either of type DeleteBatchPredictionJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::DeleteBatchPredictionJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_batch_prediction_job(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_batch_prediction_job 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) (defaults to: nil)

      Required. The name of the BatchPredictionJob resource to be deleted. Format: projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}

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.



2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 2005

def delete_batch_prediction_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteBatchPredictionJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_batch_prediction_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_batch_prediction_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_batch_prediction_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :delete_batch_prediction_job, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_custom_job(request, options = nil) ⇒ ::Gapic::Operation #delete_custom_job(name: nil) ⇒ ::Gapic::Operation

Deletes a CustomJob.

Examples:

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

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

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

Overloads:

  • #delete_custom_job(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_custom_job via a request object, either of type DeleteCustomJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::DeleteCustomJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_custom_job(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_custom_job 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) (defaults to: nil)

      Required. The name of the CustomJob resource to be deleted. Format: projects/{project}/locations/{location}/customJobs/{custom_job}

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.



540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 540

def delete_custom_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteCustomJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_custom_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_custom_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_custom_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :delete_custom_job, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_data_labeling_job(request, options = nil) ⇒ ::Gapic::Operation #delete_data_labeling_job(name: nil) ⇒ ::Gapic::Operation

Deletes a DataLabelingJob.

Examples:

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

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

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

Overloads:

  • #delete_data_labeling_job(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_data_labeling_job via a request object, either of type DeleteDataLabelingJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::DeleteDataLabelingJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_data_labeling_job(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_data_labeling_job 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) (defaults to: nil)

      Required. The name of the DataLabelingJob to be deleted. Format: projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}

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.



1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 1033

def delete_data_labeling_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteDataLabelingJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_data_labeling_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_data_labeling_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_data_labeling_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :delete_data_labeling_job, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_hyperparameter_tuning_job(request, options = nil) ⇒ ::Gapic::Operation #delete_hyperparameter_tuning_job(name: nil) ⇒ ::Gapic::Operation

Deletes a HyperparameterTuningJob.

Examples:

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

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

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

Overloads:

  • #delete_hyperparameter_tuning_job(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_hyperparameter_tuning_job via a request object, either of type DeleteHyperparameterTuningJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::DeleteHyperparameterTuningJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_hyperparameter_tuning_job(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_hyperparameter_tuning_job 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) (defaults to: nil)

      Required. The name of the HyperparameterTuningJob resource to be deleted. Format: projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}

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.



1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 1513

def delete_hyperparameter_tuning_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteHyperparameterTuningJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_hyperparameter_tuning_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_hyperparameter_tuning_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_hyperparameter_tuning_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :delete_hyperparameter_tuning_job, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_model_deployment_monitoring_job(request, options = nil) ⇒ ::Gapic::Operation #delete_model_deployment_monitoring_job(name: nil) ⇒ ::Gapic::Operation

Deletes a ModelDeploymentMonitoringJob.

Examples:

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

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

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

Overloads:

  • #delete_model_deployment_monitoring_job(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_model_deployment_monitoring_job via a request object, either of type DeleteModelDeploymentMonitoringJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::DeleteModelDeploymentMonitoringJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_model_deployment_monitoring_job(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_model_deployment_monitoring_job 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) (defaults to: nil)

      Required. The resource name of the model monitoring job to delete. Format: projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}

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.



2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 2730

def delete_model_deployment_monitoring_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteModelDeploymentMonitoringJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_model_deployment_monitoring_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_model_deployment_monitoring_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_model_deployment_monitoring_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :delete_model_deployment_monitoring_job, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_batch_prediction_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::BatchPredictionJob #get_batch_prediction_job(name: nil) ⇒ ::Google::Cloud::AIPlatform::V1::BatchPredictionJob

Gets a BatchPredictionJob

Examples:

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

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

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

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

Overloads:

  • #get_batch_prediction_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::BatchPredictionJob

    Pass arguments to get_batch_prediction_job via a request object, either of type GetBatchPredictionJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::GetBatchPredictionJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_batch_prediction_job(name: nil) ⇒ ::Google::Cloud::AIPlatform::V1::BatchPredictionJob

    Pass arguments to get_batch_prediction_job 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) (defaults to: nil)

      Required. The name of the BatchPredictionJob resource. Format: projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 1786

def get_batch_prediction_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetBatchPredictionJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_batch_prediction_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_batch_prediction_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_batch_prediction_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :get_batch_prediction_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_custom_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::CustomJob #get_custom_job(name: nil) ⇒ ::Google::Cloud::AIPlatform::V1::CustomJob

Gets a CustomJob.

Examples:

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

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

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

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

Overloads:

  • #get_custom_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::CustomJob

    Pass arguments to get_custom_job via a request object, either of type GetCustomJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::GetCustomJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_custom_job(name: nil) ⇒ ::Google::Cloud::AIPlatform::V1::CustomJob

    Pass arguments to get_custom_job 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) (defaults to: nil)

      Required. The name of the CustomJob resource. Format: projects/{project}/locations/{location}/customJobs/{custom_job}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 323

def get_custom_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetCustomJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_custom_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_custom_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_custom_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :get_custom_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_data_labeling_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::DataLabelingJob #get_data_labeling_job(name: nil) ⇒ ::Google::Cloud::AIPlatform::V1::DataLabelingJob

Gets a DataLabelingJob.

Examples:

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

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

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

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

Overloads:

  • #get_data_labeling_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::DataLabelingJob

    Pass arguments to get_data_labeling_job via a request object, either of type GetDataLabelingJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::GetDataLabelingJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_data_labeling_job(name: nil) ⇒ ::Google::Cloud::AIPlatform::V1::DataLabelingJob

    Pass arguments to get_data_labeling_job 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) (defaults to: nil)

      Required. The name of the DataLabelingJob. Format: projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 812

def get_data_labeling_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetDataLabelingJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_data_labeling_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_data_labeling_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_data_labeling_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :get_data_labeling_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_hyperparameter_tuning_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob #get_hyperparameter_tuning_job(name: nil) ⇒ ::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob

Gets a HyperparameterTuningJob

Examples:

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

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

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

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

Overloads:

  • #get_hyperparameter_tuning_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob

    Pass arguments to get_hyperparameter_tuning_job via a request object, either of type GetHyperparameterTuningJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::GetHyperparameterTuningJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_hyperparameter_tuning_job(name: nil) ⇒ ::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob

    Pass arguments to get_hyperparameter_tuning_job 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) (defaults to: nil)

      Required. The name of the HyperparameterTuningJob resource. Format: projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 1296

def get_hyperparameter_tuning_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetHyperparameterTuningJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_hyperparameter_tuning_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_hyperparameter_tuning_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_hyperparameter_tuning_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :get_hyperparameter_tuning_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_model_deployment_monitoring_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob #get_model_deployment_monitoring_job(name: nil) ⇒ ::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob

Gets a ModelDeploymentMonitoringJob.

Examples:

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

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

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

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

Overloads:

  • #get_model_deployment_monitoring_job(request, options = nil) ⇒ ::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob

    Pass arguments to get_model_deployment_monitoring_job via a request object, either of type GetModelDeploymentMonitoringJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::GetModelDeploymentMonitoringJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_model_deployment_monitoring_job(name: nil) ⇒ ::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob

    Pass arguments to get_model_deployment_monitoring_job 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) (defaults to: nil)

      Required. The resource name of the ModelDeploymentMonitoringJob. Format: projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 2394

def get_model_deployment_monitoring_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetModelDeploymentMonitoringJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_model_deployment_monitoring_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_model_deployment_monitoring_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_model_deployment_monitoring_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :get_model_deployment_monitoring_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_batch_prediction_jobs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::BatchPredictionJob> #list_batch_prediction_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::BatchPredictionJob>

Lists BatchPredictionJobs in a Location.

Examples:

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

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

# Call the list_batch_prediction_jobs method.
result = client.list_batch_prediction_jobs 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::BatchPredictionJob.
  p response
end

Overloads:

  • #list_batch_prediction_jobs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::BatchPredictionJob>

    Pass arguments to list_batch_prediction_jobs via a request object, either of type ListBatchPredictionJobsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_batch_prediction_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::BatchPredictionJob>

    Pass arguments to list_batch_prediction_jobs 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) (defaults to: nil)

      Required. The resource name of the Location to list the BatchPredictionJobs from. Format: projects/{project}/locations/{location}

    • filter (::String) (defaults to: nil)

      The standard list filter.

      Supported fields:

      • display_name supports =, != comparisons, and : wildcard.
      • model_display_name supports =, != comparisons.
      • state supports =, != comparisons.
      • create_time supports =, !=,<, <=,>, >= comparisons. create_time must be in RFC 3339 format.
      • labels supports general map functions that is: labels.key=value - key:value equality `labels.key:* - key existence

      Some examples of using the filter are:

      • state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"
      • state!="JOB_STATE_FAILED" OR display_name="my_job"
      • NOT display_name="my_job"
      • create_time>"2021-05-18T00:00:00Z"
      • labels.keyA=valueA
      • labels.keyB:*
    • page_size (::Integer) (defaults to: nil)

      The standard list page size.

    • page_token (::String) (defaults to: nil)

      The standard list page token. Typically obtained via ListBatchPredictionJobsResponse.next_page_token of the previous JobService.ListBatchPredictionJobs call.

    • read_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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.



1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 1909

def list_batch_prediction_jobs request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_batch_prediction_jobs..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_batch_prediction_jobs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_batch_prediction_jobs.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :list_batch_prediction_jobs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_batch_prediction_jobs, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_custom_jobs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::CustomJob> #list_custom_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::CustomJob>

Lists CustomJobs in a Location.

Examples:

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

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

# Call the list_custom_jobs method.
result = client.list_custom_jobs 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::CustomJob.
  p response
end

Overloads:

  • #list_custom_jobs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::CustomJob>

    Pass arguments to list_custom_jobs via a request object, either of type ListCustomJobsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::ListCustomJobsRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_custom_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::CustomJob>

    Pass arguments to list_custom_jobs 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) (defaults to: nil)

      Required. The resource name of the Location to list the CustomJobs from. Format: projects/{project}/locations/{location}

    • filter (::String) (defaults to: nil)

      The standard list filter.

      Supported fields:

      • display_name supports =, != comparisons, and : wildcard.
      • state supports =, != comparisons.
      • create_time supports =, !=,<, <=,>, >= comparisons. create_time must be in RFC 3339 format.
      • labels supports general map functions that is: labels.key=value - key:value equality `labels.key:* - key existence

      Some examples of using the filter are:

      • state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"
      • state!="JOB_STATE_FAILED" OR display_name="my_job"
      • NOT display_name="my_job"
      • create_time>"2021-05-18T00:00:00Z"
      • labels.keyA=valueA
      • labels.keyB:*
    • page_size (::Integer) (defaults to: nil)

      The standard list page size.

    • page_token (::String) (defaults to: nil)

      The standard list page token. Typically obtained via ListCustomJobsResponse.next_page_token of the previous JobService.ListCustomJobs call.

    • read_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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.



445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 445

def list_custom_jobs request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListCustomJobsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_custom_jobs..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_custom_jobs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_custom_jobs.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :list_custom_jobs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_custom_jobs, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_data_labeling_jobs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DataLabelingJob> #list_data_labeling_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DataLabelingJob>

Lists DataLabelingJobs in a Location.

Examples:

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

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

# Call the list_data_labeling_jobs method.
result = client.list_data_labeling_jobs 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::DataLabelingJob.
  p response
end

Overloads:

  • #list_data_labeling_jobs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DataLabelingJob>

    Pass arguments to list_data_labeling_jobs via a request object, either of type ListDataLabelingJobsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::ListDataLabelingJobsRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_data_labeling_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DataLabelingJob>

    Pass arguments to list_data_labeling_jobs 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) (defaults to: nil)

      Required. The parent of the DataLabelingJob. Format: projects/{project}/locations/{location}

    • filter (::String) (defaults to: nil)

      The standard list filter.

      Supported fields:

      • display_name supports =, != comparisons, and : wildcard.
      • state supports =, != comparisons.
      • create_time supports =, !=,<, <=,>, >= comparisons. create_time must be in RFC 3339 format.
      • labels supports general map functions that is: labels.key=value - key:value equality `labels.key:* - key existence

      Some examples of using the filter are:

      • state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"
      • state!="JOB_STATE_FAILED" OR display_name="my_job"
      • NOT display_name="my_job"
      • create_time>"2021-05-18T00:00:00Z"
      • labels.keyA=valueA
      • labels.keyB:*
    • page_size (::Integer) (defaults to: nil)

      The standard list page size.

    • page_token (::String) (defaults to: nil)

      The standard list page token.

    • read_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Mask specifying which fields to read. FieldMask represents a set of symbolic field paths. For example, the mask can be paths: "name". The "name" here is a field in DataLabelingJob. If this field is not set, all fields of the DataLabelingJob are returned.

    • order_by (::String) (defaults to: nil)

      A comma-separated list of fields to order by, sorted in ascending order by default. Use desc after a field name for descending.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 938

def list_data_labeling_jobs request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListDataLabelingJobsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_data_labeling_jobs..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_data_labeling_jobs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_data_labeling_jobs.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :list_data_labeling_jobs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_data_labeling_jobs, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_hyperparameter_tuning_jobs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob> #list_hyperparameter_tuning_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob>

Lists HyperparameterTuningJobs in a Location.

Examples:

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

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

# Call the list_hyperparameter_tuning_jobs method.
result = client.list_hyperparameter_tuning_jobs 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::HyperparameterTuningJob.
  p response
end

Overloads:

  • #list_hyperparameter_tuning_jobs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob>

    Pass arguments to list_hyperparameter_tuning_jobs via a request object, either of type ListHyperparameterTuningJobsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_hyperparameter_tuning_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob>

    Pass arguments to list_hyperparameter_tuning_jobs 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) (defaults to: nil)

      Required. The resource name of the Location to list the HyperparameterTuningJobs from. Format: projects/{project}/locations/{location}

    • filter (::String) (defaults to: nil)

      The standard list filter.

      Supported fields:

      • display_name supports =, != comparisons, and : wildcard.
      • state supports =, != comparisons.
      • create_time supports =, !=,<, <=,>, >= comparisons. create_time must be in RFC 3339 format.
      • labels supports general map functions that is: labels.key=value - key:value equality `labels.key:* - key existence

      Some examples of using the filter are:

      • state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"
      • state!="JOB_STATE_FAILED" OR display_name="my_job"
      • NOT display_name="my_job"
      • create_time>"2021-05-18T00:00:00Z"
      • labels.keyA=valueA
      • labels.keyB:*
    • page_size (::Integer) (defaults to: nil)

      The standard list page size.

    • page_token (::String) (defaults to: nil)

      The standard list page token. Typically obtained via ListHyperparameterTuningJobsResponse.next_page_token of the previous JobService.ListHyperparameterTuningJobs call.

    • read_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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.



1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 1418

def list_hyperparameter_tuning_jobs request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_hyperparameter_tuning_jobs..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_hyperparameter_tuning_jobs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_hyperparameter_tuning_jobs.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :list_hyperparameter_tuning_jobs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_hyperparameter_tuning_jobs, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_model_deployment_monitoring_jobs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob> #list_model_deployment_monitoring_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob>

Lists ModelDeploymentMonitoringJobs in a Location.

Examples:

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

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

# Call the list_model_deployment_monitoring_jobs method.
result = client.list_model_deployment_monitoring_jobs 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::ModelDeploymentMonitoringJob.
  p response
end

Overloads:

  • #list_model_deployment_monitoring_jobs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob>

    Pass arguments to list_model_deployment_monitoring_jobs via a request object, either of type ListModelDeploymentMonitoringJobsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::ListModelDeploymentMonitoringJobsRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_model_deployment_monitoring_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob>

    Pass arguments to list_model_deployment_monitoring_jobs 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) (defaults to: nil)

      Required. The parent of the ModelDeploymentMonitoringJob. Format: projects/{project}/locations/{location}

    • filter (::String) (defaults to: nil)

      The standard list filter.

      Supported fields:

      • display_name supports =, != comparisons, and : wildcard.
      • state supports =, != comparisons.
      • create_time supports =, !=,<, <=,>, >= comparisons. create_time must be in RFC 3339 format.
      • labels supports general map functions that is: labels.key=value - key:value equality `labels.key:* - key existence

      Some examples of using the filter are:

      • state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"
      • state!="JOB_STATE_FAILED" OR display_name="my_job"
      • NOT display_name="my_job"
      • create_time>"2021-05-18T00:00:00Z"
      • labels.keyA=valueA
      • labels.keyB:*
    • page_size (::Integer) (defaults to: nil)

      The standard list page size.

    • page_token (::String) (defaults to: nil)

      The standard list page token.

    • read_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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.



2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 2513

def list_model_deployment_monitoring_jobs request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListModelDeploymentMonitoringJobsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_model_deployment_monitoring_jobs..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_model_deployment_monitoring_jobs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_model_deployment_monitoring_jobs.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :list_model_deployment_monitoring_jobs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_model_deployment_monitoring_jobs, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#pause_model_deployment_monitoring_job(request, options = nil) ⇒ ::Google::Protobuf::Empty #pause_model_deployment_monitoring_job(name: nil) ⇒ ::Google::Protobuf::Empty

Pauses a ModelDeploymentMonitoringJob. If the job is running, the server makes a best effort to cancel the job. Will mark ModelDeploymentMonitoringJob.state to 'PAUSED'.

Examples:

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

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

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

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

Overloads:

  • #pause_model_deployment_monitoring_job(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to pause_model_deployment_monitoring_job via a request object, either of type PauseModelDeploymentMonitoringJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::PauseModelDeploymentMonitoringJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #pause_model_deployment_monitoring_job(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to pause_model_deployment_monitoring_job 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) (defaults to: nil)

      Required. The resource name of the ModelDeploymentMonitoringJob to pause. Format: projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 2820

def pause_model_deployment_monitoring_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::PauseModelDeploymentMonitoringJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.pause_model_deployment_monitoring_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.pause_model_deployment_monitoring_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.pause_model_deployment_monitoring_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :pause_model_deployment_monitoring_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#resume_model_deployment_monitoring_job(request, options = nil) ⇒ ::Google::Protobuf::Empty #resume_model_deployment_monitoring_job(name: nil) ⇒ ::Google::Protobuf::Empty

Resumes a paused ModelDeploymentMonitoringJob. It will start to run from next scheduled time. A deleted ModelDeploymentMonitoringJob can't be resumed.

Examples:

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

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

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

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

Overloads:

  • #resume_model_deployment_monitoring_job(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to resume_model_deployment_monitoring_job via a request object, either of type ResumeModelDeploymentMonitoringJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::ResumeModelDeploymentMonitoringJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #resume_model_deployment_monitoring_job(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to resume_model_deployment_monitoring_job 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) (defaults to: nil)

      Required. The resource name of the ModelDeploymentMonitoringJob to resume. Format: projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 2909

def resume_model_deployment_monitoring_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ResumeModelDeploymentMonitoringJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.resume_model_deployment_monitoring_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.resume_model_deployment_monitoring_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.resume_model_deployment_monitoring_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :resume_model_deployment_monitoring_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#search_model_deployment_monitoring_stats_anomalies(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelMonitoringStatsAnomalies> #search_model_deployment_monitoring_stats_anomalies(model_deployment_monitoring_job: nil, deployed_model_id: nil, feature_display_name: nil, objectives: nil, page_size: nil, page_token: nil, start_time: nil, end_time: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::ModelMonitoringStatsAnomalies>

Searches Model Monitoring Statistics generated within a given time window.

Examples:

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

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

# Call the search_model_deployment_monitoring_stats_anomalies method.
result = client.search_model_deployment_monitoring_stats_anomalies 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::ModelMonitoringStatsAnomalies.
  p response
end

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 2306

def search_model_deployment_monitoring_stats_anomalies request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.search_model_deployment_monitoring_stats_anomalies..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.model_deployment_monitoring_job
    header_params["model_deployment_monitoring_job"] = request.model_deployment_monitoring_job
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.search_model_deployment_monitoring_stats_anomalies.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.search_model_deployment_monitoring_stats_anomalies.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :search_model_deployment_monitoring_stats_anomalies, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @job_service_stub, :search_model_deployment_monitoring_stats_anomalies, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_model_deployment_monitoring_job(request, options = nil) ⇒ ::Gapic::Operation #update_model_deployment_monitoring_job(model_deployment_monitoring_job: nil, update_mask: nil) ⇒ ::Gapic::Operation

Updates a ModelDeploymentMonitoringJob.

Examples:

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

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

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

Overloads:

  • #update_model_deployment_monitoring_job(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_model_deployment_monitoring_job via a request object, either of type UpdateModelDeploymentMonitoringJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::AIPlatform::V1::UpdateModelDeploymentMonitoringJobRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_model_deployment_monitoring_job(model_deployment_monitoring_job: nil, update_mask: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_model_deployment_monitoring_job 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:

    • model_deployment_monitoring_job (::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob, ::Hash) (defaults to: nil)

      Required. The model monitoring configuration which replaces the resource on the server.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. The update mask is used to specify the fields to be overwritten in the ModelDeploymentMonitoringJob resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then only the non-empty fields present in the request will be overwritten. Set the update_mask to * to override all fields. For the objective config, the user can either provide the update mask for model_deployment_monitoring_objective_configs or any combination of its nested fields, such as: model_deployment_monitoring_objective_configs.objective_config.training_dataset.

      Updatable fields:

      • display_name
      • model_deployment_monitoring_schedule_config
      • model_monitoring_alert_config
      • logging_sampling_strategy
      • labels
      • log_ttl
      • enable_monitoring_pipeline_logs . and
      • model_deployment_monitoring_objective_configs . or
      • model_deployment_monitoring_objective_configs.objective_config.training_dataset
      • model_deployment_monitoring_objective_configs.objective_config.training_prediction_skew_detection_config
      • model_deployment_monitoring_objective_configs.objective_config.prediction_drift_detection_config

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.



2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
# File 'lib/google/cloud/ai_platform/v1/job_service/client.rb', line 2635

def update_model_deployment_monitoring_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateModelDeploymentMonitoringJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_model_deployment_monitoring_job..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.model_deployment_monitoring_job&.name
    header_params["model_deployment_monitoring_job.name"] = request.model_deployment_monitoring_job.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_model_deployment_monitoring_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_model_deployment_monitoring_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @job_service_stub.call_rpc :update_model_deployment_monitoring_job, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end