google-cloud-ai_platform-v1 0.5.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/google/cloud/ai_platform/v1/dataset_service/client.rb +140 -0
- data/lib/google/cloud/ai_platform/v1/endpoint_service/client.rb +28 -0
- data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/client.rb +28 -0
- data/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb +29 -0
- data/lib/google/cloud/ai_platform/v1/index_endpoint_service/client.rb +28 -0
- data/lib/google/cloud/ai_platform/v1/index_service/client.rb +28 -0
- data/lib/google/cloud/ai_platform/v1/job_service/client.rb +28 -0
- data/lib/google/cloud/ai_platform/v1/metadata_service/client.rb +28 -0
- data/lib/google/cloud/ai_platform/v1/migration_service/client.rb +28 -0
- data/lib/google/cloud/ai_platform/v1/model_service/client.rb +480 -1
- data/lib/google/cloud/ai_platform/v1/pipeline_service/client.rb +28 -0
- data/lib/google/cloud/ai_platform/v1/prediction_service/client.rb +28 -0
- data/lib/google/cloud/ai_platform/v1/specialist_pool_service/client.rb +28 -0
- data/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb +28 -0
- data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
- data/lib/google/cloud/ai_platform/v1/vizier_service/client.rb +28 -0
- data/lib/google/cloud/aiplatform/v1/batch_prediction_job_pb.rb +1 -0
- data/lib/google/cloud/aiplatform/v1/completion_stats_pb.rb +1 -0
- data/lib/google/cloud/aiplatform/v1/dataset_service_pb.rb +15 -0
- data/lib/google/cloud/aiplatform/v1/dataset_service_services_pb.rb +2 -0
- data/lib/google/cloud/aiplatform/v1/endpoint_pb.rb +1 -0
- data/lib/google/cloud/aiplatform/v1/explanation_pb.rb +27 -0
- data/lib/google/cloud/aiplatform/v1/model_deployment_monitoring_job_pb.rb +1 -0
- data/lib/google/cloud/aiplatform/v1/model_monitoring_pb.rb +2 -0
- data/lib/google/cloud/aiplatform/v1/model_pb.rb +5 -0
- data/lib/google/cloud/aiplatform/v1/model_service_pb.rb +34 -0
- data/lib/google/cloud/aiplatform/v1/model_service_services_pb.rb +12 -0
- data/lib/google/cloud/aiplatform/v1/prediction_service_pb.rb +1 -0
- data/lib/google/cloud/aiplatform/v1/saved_query_pb.rb +36 -0
- data/lib/google/cloud/aiplatform/v1/training_pipeline_pb.rb +3 -0
- data/proto_docs/google/cloud/aiplatform/v1/batch_prediction_job.rb +6 -0
- data/proto_docs/google/cloud/aiplatform/v1/completion_stats.rb +4 -0
- data/proto_docs/google/cloud/aiplatform/v1/dataset_service.rb +39 -0
- data/proto_docs/google/cloud/aiplatform/v1/endpoint.rb +6 -0
- data/proto_docs/google/cloud/aiplatform/v1/explanation.rb +69 -0
- data/proto_docs/google/cloud/aiplatform/v1/featurestore_online_service.rb +0 -1
- data/proto_docs/google/cloud/aiplatform/v1/featurestore_service.rb +1 -0
- data/proto_docs/google/cloud/aiplatform/v1/model.rb +26 -0
- data/proto_docs/google/cloud/aiplatform/v1/model_deployment_monitoring_job.rb +10 -0
- data/proto_docs/google/cloud/aiplatform/v1/model_monitoring.rb +10 -0
- data/proto_docs/google/cloud/aiplatform/v1/model_service.rb +135 -0
- data/proto_docs/google/cloud/aiplatform/v1/prediction_service.rb +4 -0
- data/proto_docs/google/cloud/aiplatform/v1/saved_query.rb +78 -0
- data/proto_docs/google/cloud/aiplatform/v1/training_pipeline.rb +25 -0
- data/proto_docs/google/type/expr.rb +75 -0
- metadata +45 -2
@@ -18,6 +18,8 @@
|
|
18
18
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/aiplatform/v1/model_service_pb"
|
21
|
+
require "google/cloud/location"
|
22
|
+
require "google/iam/v1/iam_policy"
|
21
23
|
|
22
24
|
module Google
|
23
25
|
module Cloud
|
@@ -139,6 +141,18 @@ module Google
|
|
139
141
|
config.endpoint = @config.endpoint
|
140
142
|
end
|
141
143
|
|
144
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
145
|
+
config.credentials = credentials
|
146
|
+
config.quota_project = @quota_project_id
|
147
|
+
config.endpoint = @config.endpoint
|
148
|
+
end
|
149
|
+
|
150
|
+
@iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
|
151
|
+
config.credentials = credentials
|
152
|
+
config.quota_project = @quota_project_id
|
153
|
+
config.endpoint = @config.endpoint
|
154
|
+
end
|
155
|
+
|
142
156
|
@model_service_stub = ::Gapic::ServiceStub.new(
|
143
157
|
::Google::Cloud::AIPlatform::V1::ModelService::Stub,
|
144
158
|
credentials: credentials,
|
@@ -155,6 +169,20 @@ module Google
|
|
155
169
|
#
|
156
170
|
attr_reader :operations_client
|
157
171
|
|
172
|
+
##
|
173
|
+
# Get the associated client for mix-in of the Locations.
|
174
|
+
#
|
175
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
176
|
+
#
|
177
|
+
attr_reader :location_client
|
178
|
+
|
179
|
+
##
|
180
|
+
# Get the associated client for mix-in of the IAMPolicy.
|
181
|
+
#
|
182
|
+
# @return [Google::Iam::V1::IAMPolicy::Client]
|
183
|
+
#
|
184
|
+
attr_reader :iam_policy_client
|
185
|
+
|
158
186
|
# Service calls
|
159
187
|
|
160
188
|
##
|
@@ -170,7 +198,7 @@ module Google
|
|
170
198
|
# @param options [::Gapic::CallOptions, ::Hash]
|
171
199
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
172
200
|
#
|
173
|
-
# @overload upload_model(parent: nil, model: nil)
|
201
|
+
# @overload upload_model(parent: nil, parent_model: nil, model_id: nil, model: nil)
|
174
202
|
# Pass arguments to `upload_model` via keyword arguments. Note that at
|
175
203
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
176
204
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -178,6 +206,15 @@ module Google
|
|
178
206
|
# @param parent [::String]
|
179
207
|
# Required. The resource name of the Location into which to upload the Model.
|
180
208
|
# Format: `projects/{project}/locations/{location}`
|
209
|
+
# @param parent_model [::String]
|
210
|
+
# Optional. The resource name of the model into which to upload the version. Only
|
211
|
+
# specify this field when uploading a new version.
|
212
|
+
# @param model_id [::String]
|
213
|
+
# Optional. The ID to use for the uploaded Model, which will become the final
|
214
|
+
# component of the model resource name.
|
215
|
+
#
|
216
|
+
# This value may be up to 63 characters, and valid characters are
|
217
|
+
# `[a-z0-9_-]`. The first character cannot be a number or hyphen.
|
181
218
|
# @param model [::Google::Cloud::AIPlatform::V1::Model, ::Hash]
|
182
219
|
# Required. The Model to create.
|
183
220
|
#
|
@@ -275,6 +312,16 @@ module Google
|
|
275
312
|
# Required. The name of the Model resource.
|
276
313
|
# Format: `projects/{project}/locations/{location}/models/{model}`
|
277
314
|
#
|
315
|
+
# In order to retrieve a specific version of the model, also provide
|
316
|
+
# the version ID or version alias.
|
317
|
+
# Example: `projects/{project}/locations/{location}/models/{model}@2`
|
318
|
+
# or
|
319
|
+
# `projects/{project}/locations/{location}/models/{model}@golden`
|
320
|
+
# If no version ID or alias is specified, the "default" version will be
|
321
|
+
# returned. The "default" version alias is created for the first version of
|
322
|
+
# the model, and can be moved to other versions later on. There will be
|
323
|
+
# exactly one default version.
|
324
|
+
#
|
278
325
|
# @yield [response, operation] Access the result along with the RPC operation
|
279
326
|
# @yieldparam response [::Google::Cloud::AIPlatform::V1::Model]
|
280
327
|
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
@@ -466,6 +513,118 @@ module Google
|
|
466
513
|
raise ::Google::Cloud::Error.from_error(e)
|
467
514
|
end
|
468
515
|
|
516
|
+
##
|
517
|
+
# Lists versions of the specified model.
|
518
|
+
#
|
519
|
+
# @overload list_model_versions(request, options = nil)
|
520
|
+
# Pass arguments to `list_model_versions` via a request object, either of type
|
521
|
+
# {::Google::Cloud::AIPlatform::V1::ListModelVersionsRequest} or an equivalent Hash.
|
522
|
+
#
|
523
|
+
# @param request [::Google::Cloud::AIPlatform::V1::ListModelVersionsRequest, ::Hash]
|
524
|
+
# A request object representing the call parameters. Required. To specify no
|
525
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
526
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
527
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
528
|
+
#
|
529
|
+
# @overload list_model_versions(name: nil, page_size: nil, page_token: nil, filter: nil, read_mask: nil)
|
530
|
+
# Pass arguments to `list_model_versions` via keyword arguments. Note that at
|
531
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
532
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
533
|
+
#
|
534
|
+
# @param name [::String]
|
535
|
+
# Required. The name of the model to list versions for.
|
536
|
+
# @param page_size [::Integer]
|
537
|
+
# The standard list page size.
|
538
|
+
# @param page_token [::String]
|
539
|
+
# The standard list page token.
|
540
|
+
# Typically obtained via
|
541
|
+
# {::Google::Cloud::AIPlatform::V1::ListModelVersionsResponse#next_page_token ListModelVersionsResponse.next_page_token} of the previous
|
542
|
+
# [ModelService.ListModelversions][] call.
|
543
|
+
# @param filter [::String]
|
544
|
+
# An expression for filtering the results of the request. For field names
|
545
|
+
# both snake_case and camelCase are supported.
|
546
|
+
#
|
547
|
+
# * `labels` supports general map functions that is:
|
548
|
+
# * `labels.key=value` - key:value equality
|
549
|
+
# * `labels.key:* or labels:key - key existence
|
550
|
+
# * A key including a space must be quoted. `labels."a key"`.
|
551
|
+
#
|
552
|
+
# Some examples:
|
553
|
+
# * `labels.myKey="myValue"`
|
554
|
+
# @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
|
555
|
+
# Mask specifying which fields to read.
|
556
|
+
#
|
557
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
558
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Model>]
|
559
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
560
|
+
#
|
561
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::Model>]
|
562
|
+
#
|
563
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
564
|
+
#
|
565
|
+
# @example Basic example
|
566
|
+
# require "google/cloud/ai_platform/v1"
|
567
|
+
#
|
568
|
+
# # Create a client object. The client can be reused for multiple calls.
|
569
|
+
# client = Google::Cloud::AIPlatform::V1::ModelService::Client.new
|
570
|
+
#
|
571
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
572
|
+
# request = Google::Cloud::AIPlatform::V1::ListModelVersionsRequest.new
|
573
|
+
#
|
574
|
+
# # Call the list_model_versions method.
|
575
|
+
# result = client.list_model_versions request
|
576
|
+
#
|
577
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
578
|
+
# # iterate over all elements by calling #each, and the enumerable
|
579
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
580
|
+
# # methods are also available for managing paging directly.
|
581
|
+
# result.each do |response|
|
582
|
+
# # Each element is of type ::Google::Cloud::AIPlatform::V1::Model.
|
583
|
+
# p response
|
584
|
+
# end
|
585
|
+
#
|
586
|
+
def list_model_versions request, options = nil
|
587
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
588
|
+
|
589
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListModelVersionsRequest
|
590
|
+
|
591
|
+
# Converts hash and nil to an options object
|
592
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
593
|
+
|
594
|
+
# Customize the options with defaults
|
595
|
+
metadata = @config.rpcs.list_model_versions.metadata.to_h
|
596
|
+
|
597
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
598
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
599
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
600
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
601
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
602
|
+
|
603
|
+
header_params = {}
|
604
|
+
if request.name
|
605
|
+
header_params["name"] = request.name
|
606
|
+
end
|
607
|
+
|
608
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
609
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
610
|
+
|
611
|
+
options.apply_defaults timeout: @config.rpcs.list_model_versions.timeout,
|
612
|
+
metadata: metadata,
|
613
|
+
retry_policy: @config.rpcs.list_model_versions.retry_policy
|
614
|
+
|
615
|
+
options.apply_defaults timeout: @config.timeout,
|
616
|
+
metadata: @config.metadata,
|
617
|
+
retry_policy: @config.retry_policy
|
618
|
+
|
619
|
+
@model_service_stub.call_rpc :list_model_versions, request, options: options do |response, operation|
|
620
|
+
response = ::Gapic::PagedEnumerable.new @model_service_stub, :list_model_versions, request, response, operation, options
|
621
|
+
yield response, operation if block_given?
|
622
|
+
return response
|
623
|
+
end
|
624
|
+
rescue ::GRPC::BadStatus => e
|
625
|
+
raise ::Google::Cloud::Error.from_error(e)
|
626
|
+
end
|
627
|
+
|
469
628
|
##
|
470
629
|
# Updates a Model.
|
471
630
|
#
|
@@ -669,6 +828,207 @@ module Google
|
|
669
828
|
raise ::Google::Cloud::Error.from_error(e)
|
670
829
|
end
|
671
830
|
|
831
|
+
##
|
832
|
+
# Deletes a Model version.
|
833
|
+
#
|
834
|
+
# Model version can only be deleted if there are no [DeployedModels][]
|
835
|
+
# created from it. Deleting the only version in the Model is not allowed. Use
|
836
|
+
# {::Google::Cloud::AIPlatform::V1::ModelService::Client#delete_model DeleteModel} for deleting the Model instead.
|
837
|
+
#
|
838
|
+
# @overload delete_model_version(request, options = nil)
|
839
|
+
# Pass arguments to `delete_model_version` via a request object, either of type
|
840
|
+
# {::Google::Cloud::AIPlatform::V1::DeleteModelVersionRequest} or an equivalent Hash.
|
841
|
+
#
|
842
|
+
# @param request [::Google::Cloud::AIPlatform::V1::DeleteModelVersionRequest, ::Hash]
|
843
|
+
# A request object representing the call parameters. Required. To specify no
|
844
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
845
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
846
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
847
|
+
#
|
848
|
+
# @overload delete_model_version(name: nil)
|
849
|
+
# Pass arguments to `delete_model_version` via keyword arguments. Note that at
|
850
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
851
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
852
|
+
#
|
853
|
+
# @param name [::String]
|
854
|
+
# Required. The name of the model version to be deleted, with a version ID explicitly
|
855
|
+
# included.
|
856
|
+
#
|
857
|
+
# Example: `projects/{project}/locations/{location}/models/{model}@1234`
|
858
|
+
#
|
859
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
860
|
+
# @yieldparam response [::Gapic::Operation]
|
861
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
862
|
+
#
|
863
|
+
# @return [::Gapic::Operation]
|
864
|
+
#
|
865
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
866
|
+
#
|
867
|
+
# @example Basic example
|
868
|
+
# require "google/cloud/ai_platform/v1"
|
869
|
+
#
|
870
|
+
# # Create a client object. The client can be reused for multiple calls.
|
871
|
+
# client = Google::Cloud::AIPlatform::V1::ModelService::Client.new
|
872
|
+
#
|
873
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
874
|
+
# request = Google::Cloud::AIPlatform::V1::DeleteModelVersionRequest.new
|
875
|
+
#
|
876
|
+
# # Call the delete_model_version method.
|
877
|
+
# result = client.delete_model_version request
|
878
|
+
#
|
879
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
880
|
+
# # object to check the status of an operation, cancel it, or wait
|
881
|
+
# # for results. Here is how to block until completion:
|
882
|
+
# result.wait_until_done! timeout: 60
|
883
|
+
# if result.response?
|
884
|
+
# p result.response
|
885
|
+
# else
|
886
|
+
# puts "Error!"
|
887
|
+
# end
|
888
|
+
#
|
889
|
+
def delete_model_version request, options = nil
|
890
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
891
|
+
|
892
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteModelVersionRequest
|
893
|
+
|
894
|
+
# Converts hash and nil to an options object
|
895
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
896
|
+
|
897
|
+
# Customize the options with defaults
|
898
|
+
metadata = @config.rpcs.delete_model_version.metadata.to_h
|
899
|
+
|
900
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
901
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
902
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
903
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
904
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
905
|
+
|
906
|
+
header_params = {}
|
907
|
+
if request.name
|
908
|
+
header_params["name"] = request.name
|
909
|
+
end
|
910
|
+
|
911
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
912
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
913
|
+
|
914
|
+
options.apply_defaults timeout: @config.rpcs.delete_model_version.timeout,
|
915
|
+
metadata: metadata,
|
916
|
+
retry_policy: @config.rpcs.delete_model_version.retry_policy
|
917
|
+
|
918
|
+
options.apply_defaults timeout: @config.timeout,
|
919
|
+
metadata: @config.metadata,
|
920
|
+
retry_policy: @config.retry_policy
|
921
|
+
|
922
|
+
@model_service_stub.call_rpc :delete_model_version, request, options: options do |response, operation|
|
923
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
924
|
+
yield response, operation if block_given?
|
925
|
+
return response
|
926
|
+
end
|
927
|
+
rescue ::GRPC::BadStatus => e
|
928
|
+
raise ::Google::Cloud::Error.from_error(e)
|
929
|
+
end
|
930
|
+
|
931
|
+
##
|
932
|
+
# Merges a set of aliases for a Model version.
|
933
|
+
#
|
934
|
+
# @overload merge_version_aliases(request, options = nil)
|
935
|
+
# Pass arguments to `merge_version_aliases` via a request object, either of type
|
936
|
+
# {::Google::Cloud::AIPlatform::V1::MergeVersionAliasesRequest} or an equivalent Hash.
|
937
|
+
#
|
938
|
+
# @param request [::Google::Cloud::AIPlatform::V1::MergeVersionAliasesRequest, ::Hash]
|
939
|
+
# A request object representing the call parameters. Required. To specify no
|
940
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
941
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
942
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
943
|
+
#
|
944
|
+
# @overload merge_version_aliases(name: nil, version_aliases: nil)
|
945
|
+
# Pass arguments to `merge_version_aliases` via keyword arguments. Note that at
|
946
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
947
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
948
|
+
#
|
949
|
+
# @param name [::String]
|
950
|
+
# Required. The name of the model version to merge aliases, with a version ID
|
951
|
+
# explicitly included.
|
952
|
+
#
|
953
|
+
# Example: `projects/{project}/locations/{location}/models/{model}@1234`
|
954
|
+
# @param version_aliases [::Array<::String>]
|
955
|
+
# Required. The set of version aliases to merge.
|
956
|
+
# The alias should be at most 128 characters, and match
|
957
|
+
# `[a-z][a-z0-9-]{0,126}[a-z-0-9]`.
|
958
|
+
# Add the `-` prefix to an alias means removing that alias from the version.
|
959
|
+
# `-` is NOT counted in the 128 characters. Example: `-golden` means removing
|
960
|
+
# the `golden` alias from the version.
|
961
|
+
#
|
962
|
+
# There is NO ordering in aliases, which means
|
963
|
+
# 1) The aliases returned from GetModel API might not have the exactly same
|
964
|
+
# order from this MergeVersionAliases API. 2) Adding and deleting the same
|
965
|
+
# alias in the request is not recommended, and the 2 operations will be
|
966
|
+
# cancelled out.
|
967
|
+
#
|
968
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
969
|
+
# @yieldparam response [::Google::Cloud::AIPlatform::V1::Model]
|
970
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
971
|
+
#
|
972
|
+
# @return [::Google::Cloud::AIPlatform::V1::Model]
|
973
|
+
#
|
974
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
975
|
+
#
|
976
|
+
# @example Basic example
|
977
|
+
# require "google/cloud/ai_platform/v1"
|
978
|
+
#
|
979
|
+
# # Create a client object. The client can be reused for multiple calls.
|
980
|
+
# client = Google::Cloud::AIPlatform::V1::ModelService::Client.new
|
981
|
+
#
|
982
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
983
|
+
# request = Google::Cloud::AIPlatform::V1::MergeVersionAliasesRequest.new
|
984
|
+
#
|
985
|
+
# # Call the merge_version_aliases method.
|
986
|
+
# result = client.merge_version_aliases request
|
987
|
+
#
|
988
|
+
# # The returned object is of type Google::Cloud::AIPlatform::V1::Model.
|
989
|
+
# p result
|
990
|
+
#
|
991
|
+
def merge_version_aliases request, options = nil
|
992
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
993
|
+
|
994
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::MergeVersionAliasesRequest
|
995
|
+
|
996
|
+
# Converts hash and nil to an options object
|
997
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
998
|
+
|
999
|
+
# Customize the options with defaults
|
1000
|
+
metadata = @config.rpcs.merge_version_aliases.metadata.to_h
|
1001
|
+
|
1002
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1003
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1004
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1005
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
1006
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1007
|
+
|
1008
|
+
header_params = {}
|
1009
|
+
if request.name
|
1010
|
+
header_params["name"] = request.name
|
1011
|
+
end
|
1012
|
+
|
1013
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1014
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1015
|
+
|
1016
|
+
options.apply_defaults timeout: @config.rpcs.merge_version_aliases.timeout,
|
1017
|
+
metadata: metadata,
|
1018
|
+
retry_policy: @config.rpcs.merge_version_aliases.retry_policy
|
1019
|
+
|
1020
|
+
options.apply_defaults timeout: @config.timeout,
|
1021
|
+
metadata: @config.metadata,
|
1022
|
+
retry_policy: @config.retry_policy
|
1023
|
+
|
1024
|
+
@model_service_stub.call_rpc :merge_version_aliases, request, options: options do |response, operation|
|
1025
|
+
yield response, operation if block_given?
|
1026
|
+
return response
|
1027
|
+
end
|
1028
|
+
rescue ::GRPC::BadStatus => e
|
1029
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1030
|
+
end
|
1031
|
+
|
672
1032
|
##
|
673
1033
|
# Exports a trained, exportable Model to a location specified by the
|
674
1034
|
# user. A Model is considered to be exportable if it has at least one
|
@@ -691,6 +1051,8 @@ module Google
|
|
691
1051
|
#
|
692
1052
|
# @param name [::String]
|
693
1053
|
# Required. The resource name of the Model to export.
|
1054
|
+
# The resource name may contain version id or version alias to specify the
|
1055
|
+
# version, if no version is specified, the default version will be exported.
|
694
1056
|
# @param output_config [::Google::Cloud::AIPlatform::V1::ExportModelRequest::OutputConfig, ::Hash]
|
695
1057
|
# Required. The desired output location and configuration.
|
696
1058
|
#
|
@@ -854,6 +1216,95 @@ module Google
|
|
854
1216
|
raise ::Google::Cloud::Error.from_error(e)
|
855
1217
|
end
|
856
1218
|
|
1219
|
+
##
|
1220
|
+
# Imports a list of externally generated ModelEvaluationSlice.
|
1221
|
+
#
|
1222
|
+
# @overload batch_import_model_evaluation_slices(request, options = nil)
|
1223
|
+
# Pass arguments to `batch_import_model_evaluation_slices` via a request object, either of type
|
1224
|
+
# {::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesRequest} or an equivalent Hash.
|
1225
|
+
#
|
1226
|
+
# @param request [::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesRequest, ::Hash]
|
1227
|
+
# A request object representing the call parameters. Required. To specify no
|
1228
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1229
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1230
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1231
|
+
#
|
1232
|
+
# @overload batch_import_model_evaluation_slices(parent: nil, model_evaluation_slices: nil)
|
1233
|
+
# Pass arguments to `batch_import_model_evaluation_slices` via keyword arguments. Note that at
|
1234
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1235
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1236
|
+
#
|
1237
|
+
# @param parent [::String]
|
1238
|
+
# Required. The name of the parent ModelEvaluation resource.
|
1239
|
+
# Format:
|
1240
|
+
# `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}`
|
1241
|
+
# @param model_evaluation_slices [::Array<::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice, ::Hash>]
|
1242
|
+
# Required. Model evaluation slice resource to be imported.
|
1243
|
+
#
|
1244
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1245
|
+
# @yieldparam response [::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesResponse]
|
1246
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1247
|
+
#
|
1248
|
+
# @return [::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesResponse]
|
1249
|
+
#
|
1250
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1251
|
+
#
|
1252
|
+
# @example Basic example
|
1253
|
+
# require "google/cloud/ai_platform/v1"
|
1254
|
+
#
|
1255
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1256
|
+
# client = Google::Cloud::AIPlatform::V1::ModelService::Client.new
|
1257
|
+
#
|
1258
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1259
|
+
# request = Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesRequest.new
|
1260
|
+
#
|
1261
|
+
# # Call the batch_import_model_evaluation_slices method.
|
1262
|
+
# result = client.batch_import_model_evaluation_slices request
|
1263
|
+
#
|
1264
|
+
# # The returned object is of type Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesResponse.
|
1265
|
+
# p result
|
1266
|
+
#
|
1267
|
+
def batch_import_model_evaluation_slices request, options = nil
|
1268
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1269
|
+
|
1270
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesRequest
|
1271
|
+
|
1272
|
+
# Converts hash and nil to an options object
|
1273
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1274
|
+
|
1275
|
+
# Customize the options with defaults
|
1276
|
+
metadata = @config.rpcs.batch_import_model_evaluation_slices.metadata.to_h
|
1277
|
+
|
1278
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1279
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1280
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1281
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
1282
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1283
|
+
|
1284
|
+
header_params = {}
|
1285
|
+
if request.parent
|
1286
|
+
header_params["parent"] = request.parent
|
1287
|
+
end
|
1288
|
+
|
1289
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1290
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1291
|
+
|
1292
|
+
options.apply_defaults timeout: @config.rpcs.batch_import_model_evaluation_slices.timeout,
|
1293
|
+
metadata: metadata,
|
1294
|
+
retry_policy: @config.rpcs.batch_import_model_evaluation_slices.retry_policy
|
1295
|
+
|
1296
|
+
options.apply_defaults timeout: @config.timeout,
|
1297
|
+
metadata: @config.metadata,
|
1298
|
+
retry_policy: @config.retry_policy
|
1299
|
+
|
1300
|
+
@model_service_stub.call_rpc :batch_import_model_evaluation_slices, request, options: options do |response, operation|
|
1301
|
+
yield response, operation if block_given?
|
1302
|
+
return response
|
1303
|
+
end
|
1304
|
+
rescue ::GRPC::BadStatus => e
|
1305
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1306
|
+
end
|
1307
|
+
|
857
1308
|
##
|
858
1309
|
# Gets a ModelEvaluation.
|
859
1310
|
#
|
@@ -1390,6 +1841,11 @@ module Google
|
|
1390
1841
|
#
|
1391
1842
|
attr_reader :list_models
|
1392
1843
|
##
|
1844
|
+
# RPC-specific configuration for `list_model_versions`
|
1845
|
+
# @return [::Gapic::Config::Method]
|
1846
|
+
#
|
1847
|
+
attr_reader :list_model_versions
|
1848
|
+
##
|
1393
1849
|
# RPC-specific configuration for `update_model`
|
1394
1850
|
# @return [::Gapic::Config::Method]
|
1395
1851
|
#
|
@@ -1400,6 +1856,16 @@ module Google
|
|
1400
1856
|
#
|
1401
1857
|
attr_reader :delete_model
|
1402
1858
|
##
|
1859
|
+
# RPC-specific configuration for `delete_model_version`
|
1860
|
+
# @return [::Gapic::Config::Method]
|
1861
|
+
#
|
1862
|
+
attr_reader :delete_model_version
|
1863
|
+
##
|
1864
|
+
# RPC-specific configuration for `merge_version_aliases`
|
1865
|
+
# @return [::Gapic::Config::Method]
|
1866
|
+
#
|
1867
|
+
attr_reader :merge_version_aliases
|
1868
|
+
##
|
1403
1869
|
# RPC-specific configuration for `export_model`
|
1404
1870
|
# @return [::Gapic::Config::Method]
|
1405
1871
|
#
|
@@ -1410,6 +1876,11 @@ module Google
|
|
1410
1876
|
#
|
1411
1877
|
attr_reader :import_model_evaluation
|
1412
1878
|
##
|
1879
|
+
# RPC-specific configuration for `batch_import_model_evaluation_slices`
|
1880
|
+
# @return [::Gapic::Config::Method]
|
1881
|
+
#
|
1882
|
+
attr_reader :batch_import_model_evaluation_slices
|
1883
|
+
##
|
1413
1884
|
# RPC-specific configuration for `get_model_evaluation`
|
1414
1885
|
# @return [::Gapic::Config::Method]
|
1415
1886
|
#
|
@@ -1438,14 +1909,22 @@ module Google
|
|
1438
1909
|
@get_model = ::Gapic::Config::Method.new get_model_config
|
1439
1910
|
list_models_config = parent_rpcs.list_models if parent_rpcs.respond_to? :list_models
|
1440
1911
|
@list_models = ::Gapic::Config::Method.new list_models_config
|
1912
|
+
list_model_versions_config = parent_rpcs.list_model_versions if parent_rpcs.respond_to? :list_model_versions
|
1913
|
+
@list_model_versions = ::Gapic::Config::Method.new list_model_versions_config
|
1441
1914
|
update_model_config = parent_rpcs.update_model if parent_rpcs.respond_to? :update_model
|
1442
1915
|
@update_model = ::Gapic::Config::Method.new update_model_config
|
1443
1916
|
delete_model_config = parent_rpcs.delete_model if parent_rpcs.respond_to? :delete_model
|
1444
1917
|
@delete_model = ::Gapic::Config::Method.new delete_model_config
|
1918
|
+
delete_model_version_config = parent_rpcs.delete_model_version if parent_rpcs.respond_to? :delete_model_version
|
1919
|
+
@delete_model_version = ::Gapic::Config::Method.new delete_model_version_config
|
1920
|
+
merge_version_aliases_config = parent_rpcs.merge_version_aliases if parent_rpcs.respond_to? :merge_version_aliases
|
1921
|
+
@merge_version_aliases = ::Gapic::Config::Method.new merge_version_aliases_config
|
1445
1922
|
export_model_config = parent_rpcs.export_model if parent_rpcs.respond_to? :export_model
|
1446
1923
|
@export_model = ::Gapic::Config::Method.new export_model_config
|
1447
1924
|
import_model_evaluation_config = parent_rpcs.import_model_evaluation if parent_rpcs.respond_to? :import_model_evaluation
|
1448
1925
|
@import_model_evaluation = ::Gapic::Config::Method.new import_model_evaluation_config
|
1926
|
+
batch_import_model_evaluation_slices_config = parent_rpcs.batch_import_model_evaluation_slices if parent_rpcs.respond_to? :batch_import_model_evaluation_slices
|
1927
|
+
@batch_import_model_evaluation_slices = ::Gapic::Config::Method.new batch_import_model_evaluation_slices_config
|
1449
1928
|
get_model_evaluation_config = parent_rpcs.get_model_evaluation if parent_rpcs.respond_to? :get_model_evaluation
|
1450
1929
|
@get_model_evaluation = ::Gapic::Config::Method.new get_model_evaluation_config
|
1451
1930
|
list_model_evaluations_config = parent_rpcs.list_model_evaluations if parent_rpcs.respond_to? :list_model_evaluations
|
@@ -18,6 +18,8 @@
|
|
18
18
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/aiplatform/v1/pipeline_service_pb"
|
21
|
+
require "google/cloud/location"
|
22
|
+
require "google/iam/v1/iam_policy"
|
21
23
|
|
22
24
|
module Google
|
23
25
|
module Cloud
|
@@ -141,6 +143,18 @@ module Google
|
|
141
143
|
config.endpoint = @config.endpoint
|
142
144
|
end
|
143
145
|
|
146
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
147
|
+
config.credentials = credentials
|
148
|
+
config.quota_project = @quota_project_id
|
149
|
+
config.endpoint = @config.endpoint
|
150
|
+
end
|
151
|
+
|
152
|
+
@iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
|
153
|
+
config.credentials = credentials
|
154
|
+
config.quota_project = @quota_project_id
|
155
|
+
config.endpoint = @config.endpoint
|
156
|
+
end
|
157
|
+
|
144
158
|
@pipeline_service_stub = ::Gapic::ServiceStub.new(
|
145
159
|
::Google::Cloud::AIPlatform::V1::PipelineService::Stub,
|
146
160
|
credentials: credentials,
|
@@ -157,6 +171,20 @@ module Google
|
|
157
171
|
#
|
158
172
|
attr_reader :operations_client
|
159
173
|
|
174
|
+
##
|
175
|
+
# Get the associated client for mix-in of the Locations.
|
176
|
+
#
|
177
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
178
|
+
#
|
179
|
+
attr_reader :location_client
|
180
|
+
|
181
|
+
##
|
182
|
+
# Get the associated client for mix-in of the IAMPolicy.
|
183
|
+
#
|
184
|
+
# @return [Google::Iam::V1::IAMPolicy::Client]
|
185
|
+
#
|
186
|
+
attr_reader :iam_policy_client
|
187
|
+
|
160
188
|
# Service calls
|
161
189
|
|
162
190
|
##
|
@@ -18,6 +18,8 @@
|
|
18
18
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/aiplatform/v1/prediction_service_pb"
|
21
|
+
require "google/cloud/location"
|
22
|
+
require "google/iam/v1/iam_policy"
|
21
23
|
|
22
24
|
module Google
|
23
25
|
module Cloud
|
@@ -133,6 +135,18 @@ module Google
|
|
133
135
|
@quota_project_id = @config.quota_project
|
134
136
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
135
137
|
|
138
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
139
|
+
config.credentials = credentials
|
140
|
+
config.quota_project = @quota_project_id
|
141
|
+
config.endpoint = @config.endpoint
|
142
|
+
end
|
143
|
+
|
144
|
+
@iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
|
145
|
+
config.credentials = credentials
|
146
|
+
config.quota_project = @quota_project_id
|
147
|
+
config.endpoint = @config.endpoint
|
148
|
+
end
|
149
|
+
|
136
150
|
@prediction_service_stub = ::Gapic::ServiceStub.new(
|
137
151
|
::Google::Cloud::AIPlatform::V1::PredictionService::Stub,
|
138
152
|
credentials: credentials,
|
@@ -142,6 +156,20 @@ module Google
|
|
142
156
|
)
|
143
157
|
end
|
144
158
|
|
159
|
+
##
|
160
|
+
# Get the associated client for mix-in of the Locations.
|
161
|
+
#
|
162
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
163
|
+
#
|
164
|
+
attr_reader :location_client
|
165
|
+
|
166
|
+
##
|
167
|
+
# Get the associated client for mix-in of the IAMPolicy.
|
168
|
+
#
|
169
|
+
# @return [Google::Iam::V1::IAMPolicy::Client]
|
170
|
+
#
|
171
|
+
attr_reader :iam_policy_client
|
172
|
+
|
145
173
|
# Service calls
|
146
174
|
|
147
175
|
##
|