google-cloud-ai_platform-v1 0.35.0 → 0.37.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +72 -99
- data/README.md +1 -1
- data/lib/google/cloud/ai_platform/v1/dataset_service/client.rb +43 -17
- data/lib/google/cloud/ai_platform/v1/dataset_service/operations.rb +28 -6
- data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/client.rb +896 -0
- data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/credentials.rb +47 -0
- data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/operations.rb +809 -0
- data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/paths.rb +83 -0
- data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service.rb +50 -0
- data/lib/google/cloud/ai_platform/v1/endpoint_service/client.rb +43 -17
- data/lib/google/cloud/ai_platform/v1/endpoint_service/operations.rb +28 -6
- data/lib/google/cloud/ai_platform/v1/endpoint_service/paths.rb +19 -0
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/client.rb +46 -18
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/operations.rb +28 -6
- data/lib/google/cloud/ai_platform/v1/feature_online_store_service/client.rb +146 -17
- data/lib/google/cloud/ai_platform/v1/feature_online_store_service.rb +2 -0
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/client.rb +44 -18
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/operations.rb +28 -6
- data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/client.rb +42 -17
- data/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb +44 -18
- data/lib/google/cloud/ai_platform/v1/featurestore_service/operations.rb +28 -6
- data/lib/google/cloud/ai_platform/v1/index_endpoint_service/client.rb +43 -17
- data/lib/google/cloud/ai_platform/v1/index_endpoint_service/operations.rb +28 -6
- data/lib/google/cloud/ai_platform/v1/index_service/client.rb +52 -18
- data/lib/google/cloud/ai_platform/v1/index_service/operations.rb +28 -6
- data/lib/google/cloud/ai_platform/v1/job_service/client.rb +43 -17
- data/lib/google/cloud/ai_platform/v1/job_service/operations.rb +28 -6
- data/lib/google/cloud/ai_platform/v1/llm_utility_service/client.rb +49 -18
- data/lib/google/cloud/ai_platform/v1/match_service/client.rb +42 -17
- data/lib/google/cloud/ai_platform/v1/metadata_service/client.rb +43 -17
- data/lib/google/cloud/ai_platform/v1/metadata_service/operations.rb +28 -6
- data/lib/google/cloud/ai_platform/v1/migration_service/client.rb +43 -17
- data/lib/google/cloud/ai_platform/v1/migration_service/operations.rb +28 -6
- data/lib/google/cloud/ai_platform/v1/model_garden_service/client.rb +42 -17
- data/lib/google/cloud/ai_platform/v1/model_service/client.rb +47 -21
- data/lib/google/cloud/ai_platform/v1/model_service/operations.rb +28 -6
- data/lib/google/cloud/ai_platform/v1/pipeline_service/client.rb +43 -17
- data/lib/google/cloud/ai_platform/v1/pipeline_service/operations.rb +28 -6
- data/lib/google/cloud/ai_platform/v1/prediction_service/client.rb +544 -20
- data/lib/google/cloud/ai_platform/v1/schedule_service/client.rb +43 -17
- data/lib/google/cloud/ai_platform/v1/schedule_service/operations.rb +28 -6
- data/lib/google/cloud/ai_platform/v1/specialist_pool_service/client.rb +43 -17
- data/lib/google/cloud/ai_platform/v1/specialist_pool_service/operations.rb +28 -6
- data/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb +43 -17
- data/lib/google/cloud/ai_platform/v1/tensorboard_service/operations.rb +28 -6
- data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
- data/lib/google/cloud/ai_platform/v1/vizier_service/client.rb +43 -17
- data/lib/google/cloud/ai_platform/v1/vizier_service/operations.rb +28 -6
- data/lib/google/cloud/ai_platform/v1.rb +1 -0
- data/lib/google/cloud/aiplatform/v1/accelerator_type_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/annotation_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/annotation_spec_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/artifact_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/batch_prediction_job_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/completion_stats_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/content_pb.rb +64 -0
- data/lib/google/cloud/aiplatform/v1/context_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/custom_job_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/data_item_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/data_labeling_job_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/dataset_pb.rb +4 -2
- data/lib/google/cloud/aiplatform/v1/dataset_service_pb.rb +4 -2
- data/lib/google/cloud/aiplatform/v1/dataset_version_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/deployed_index_ref_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/deployed_model_ref_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/deployment_resource_pool_pb.rb +49 -0
- data/lib/google/cloud/aiplatform/v1/deployment_resource_pool_service_pb.rb +65 -0
- data/lib/google/cloud/aiplatform/v1/deployment_resource_pool_service_services_pb.rb +53 -0
- data/lib/google/cloud/aiplatform/v1/encryption_spec_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/endpoint_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/endpoint_service_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/entity_type_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/env_var_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/evaluated_annotation_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/event_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/execution_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/explanation_metadata_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/explanation_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/feature_group_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/feature_monitoring_stats_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/feature_online_store_admin_service_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/feature_online_store_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/feature_online_store_service_pb.rb +11 -2
- data/lib/google/cloud/aiplatform/v1/feature_online_store_service_services_pb.rb +5 -0
- data/lib/google/cloud/aiplatform/v1/feature_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/feature_registry_service_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/feature_selector_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/feature_view_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/feature_view_sync_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/featurestore_monitoring_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/featurestore_online_service_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/featurestore_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/featurestore_service_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/hyperparameter_tuning_job_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/index_endpoint_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/index_endpoint_service_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/index_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/index_service_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/io_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/job_service_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/job_state_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/lineage_subgraph_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/llm_utility_service_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/machine_resources_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/manual_batch_tuning_parameters_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/match_service_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/metadata_schema_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/metadata_service_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/metadata_store_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/migratable_resource_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/migration_service_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/model_deployment_monitoring_job_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/model_evaluation_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/model_evaluation_slice_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/model_garden_service_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/model_monitoring_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/model_pb.rb +3 -2
- data/lib/google/cloud/aiplatform/v1/model_service_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/nas_job_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/openapi_pb.rb +47 -0
- data/lib/google/cloud/aiplatform/v1/operation_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/pipeline_failure_policy_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/pipeline_job_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/pipeline_service_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/pipeline_state_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/prediction_service_pb.rb +16 -2
- data/lib/google/cloud/aiplatform/v1/prediction_service_services_pb.rb +16 -3
- data/lib/google/cloud/aiplatform/v1/publisher_model_pb.rb +6 -2
- data/lib/google/cloud/aiplatform/v1/saved_query_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/schedule_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/schedule_service_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/service_networking_pb.rb +4 -2
- data/lib/google/cloud/aiplatform/v1/specialist_pool_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/specialist_pool_service_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/study_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/tensorboard_data_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/tensorboard_experiment_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/tensorboard_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/tensorboard_run_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/tensorboard_service_pb.rb +2 -2
- data/lib/google/cloud/aiplatform/v1/tensorboard_time_series_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/tool_pb.rb +51 -0
- data/lib/google/cloud/aiplatform/v1/training_pipeline_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/types_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/unmanaged_container_model_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/user_action_reference_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/value_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/vizier_service_pb.rb +2 -2
- data/proto_docs/google/api/client.rb +1 -0
- data/proto_docs/google/cloud/aiplatform/v1/batch_prediction_job.rb +2 -2
- data/proto_docs/google/cloud/aiplatform/v1/content.rb +312 -0
- data/proto_docs/google/cloud/aiplatform/v1/custom_job.rb +15 -0
- data/proto_docs/google/cloud/aiplatform/v1/dataset.rb +102 -0
- data/proto_docs/google/cloud/aiplatform/v1/dataset_service.rb +12 -1
- data/proto_docs/google/cloud/aiplatform/v1/deployed_index_ref.rb +3 -0
- data/proto_docs/google/cloud/aiplatform/v1/deployment_resource_pool.rb +45 -0
- data/proto_docs/google/cloud/aiplatform/v1/deployment_resource_pool_service.rb +170 -0
- data/proto_docs/google/cloud/aiplatform/v1/endpoint.rb +6 -0
- data/proto_docs/google/cloud/aiplatform/v1/explanation.rb +8 -0
- data/proto_docs/google/cloud/aiplatform/v1/feature.rb +5 -1
- data/proto_docs/google/cloud/aiplatform/v1/feature_group.rb +2 -2
- data/proto_docs/google/cloud/aiplatform/v1/feature_online_store.rb +2 -2
- data/proto_docs/google/cloud/aiplatform/v1/feature_online_store_admin_service.rb +3 -1
- data/proto_docs/google/cloud/aiplatform/v1/feature_online_store_service.rb +150 -0
- data/proto_docs/google/cloud/aiplatform/v1/feature_view.rb +3 -2
- data/proto_docs/google/cloud/aiplatform/v1/feature_view_sync.rb +2 -2
- data/proto_docs/google/cloud/aiplatform/v1/featurestore_service.rb +1 -1
- data/proto_docs/google/cloud/aiplatform/v1/index_endpoint.rb +5 -0
- data/proto_docs/google/cloud/aiplatform/v1/index_service.rb +28 -0
- data/proto_docs/google/cloud/aiplatform/v1/metadata_service.rb +1 -0
- data/proto_docs/google/cloud/aiplatform/v1/model.rb +55 -4
- data/proto_docs/google/cloud/aiplatform/v1/model_deployment_monitoring_job.rb +4 -0
- data/proto_docs/google/cloud/aiplatform/v1/model_evaluation.rb +1 -1
- data/proto_docs/google/cloud/aiplatform/v1/model_monitoring.rb +1 -0
- data/proto_docs/google/cloud/aiplatform/v1/model_service.rb +4 -4
- data/proto_docs/google/cloud/aiplatform/v1/nas_job.rb +1 -0
- data/proto_docs/google/cloud/aiplatform/v1/openapi.rb +102 -0
- data/proto_docs/google/cloud/aiplatform/v1/pipeline_job.rb +1 -0
- data/proto_docs/google/cloud/aiplatform/v1/prediction_service.rb +195 -0
- data/proto_docs/google/cloud/aiplatform/v1/publisher_model.rb +73 -1
- data/proto_docs/google/cloud/aiplatform/v1/service_networking.rb +16 -0
- data/proto_docs/google/cloud/aiplatform/v1/tool.rb +112 -0
- data/proto_docs/google/protobuf/any.rb +2 -1
- data/proto_docs/google/type/date.rb +53 -0
- metadata +27 -122
@@ -0,0 +1,896 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/aiplatform/v1/deployment_resource_pool_service_pb"
|
21
|
+
require "google/cloud/location"
|
22
|
+
require "google/iam/v1"
|
23
|
+
|
24
|
+
module Google
|
25
|
+
module Cloud
|
26
|
+
module AIPlatform
|
27
|
+
module V1
|
28
|
+
module DeploymentResourcePoolService
|
29
|
+
##
|
30
|
+
# Client for the DeploymentResourcePoolService service.
|
31
|
+
#
|
32
|
+
# A service that manages the DeploymentResourcePool resource.
|
33
|
+
#
|
34
|
+
class Client
|
35
|
+
# @private
|
36
|
+
DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$"
|
37
|
+
|
38
|
+
include Paths
|
39
|
+
|
40
|
+
# @private
|
41
|
+
attr_reader :deployment_resource_pool_service_stub
|
42
|
+
|
43
|
+
##
|
44
|
+
# Configure the DeploymentResourcePoolService Client class.
|
45
|
+
#
|
46
|
+
# See {::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client::Configuration}
|
47
|
+
# for a description of the configuration fields.
|
48
|
+
#
|
49
|
+
# @example
|
50
|
+
#
|
51
|
+
# # Modify the configuration for all DeploymentResourcePoolService clients
|
52
|
+
# ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client.configure do |config|
|
53
|
+
# config.timeout = 10.0
|
54
|
+
# end
|
55
|
+
#
|
56
|
+
# @yield [config] Configure the Client client.
|
57
|
+
# @yieldparam config [Client::Configuration]
|
58
|
+
#
|
59
|
+
# @return [Client::Configuration]
|
60
|
+
#
|
61
|
+
def self.configure
|
62
|
+
@configure ||= begin
|
63
|
+
namespace = ["Google", "Cloud", "AIPlatform", "V1"]
|
64
|
+
parent_config = while namespace.any?
|
65
|
+
parent_name = namespace.join "::"
|
66
|
+
parent_const = const_get parent_name
|
67
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
68
|
+
namespace.pop
|
69
|
+
end
|
70
|
+
default_config = Client::Configuration.new parent_config
|
71
|
+
|
72
|
+
default_config
|
73
|
+
end
|
74
|
+
yield @configure if block_given?
|
75
|
+
@configure
|
76
|
+
end
|
77
|
+
|
78
|
+
##
|
79
|
+
# Configure the DeploymentResourcePoolService Client instance.
|
80
|
+
#
|
81
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
82
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
83
|
+
# should be made on {Client.configure}.
|
84
|
+
#
|
85
|
+
# See {::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client::Configuration}
|
86
|
+
# for a description of the configuration fields.
|
87
|
+
#
|
88
|
+
# @yield [config] Configure the Client client.
|
89
|
+
# @yieldparam config [Client::Configuration]
|
90
|
+
#
|
91
|
+
# @return [Client::Configuration]
|
92
|
+
#
|
93
|
+
def configure
|
94
|
+
yield @config if block_given?
|
95
|
+
@config
|
96
|
+
end
|
97
|
+
|
98
|
+
##
|
99
|
+
# The effective universe domain
|
100
|
+
#
|
101
|
+
# @return [String]
|
102
|
+
#
|
103
|
+
def universe_domain
|
104
|
+
@deployment_resource_pool_service_stub.universe_domain
|
105
|
+
end
|
106
|
+
|
107
|
+
##
|
108
|
+
# Create a new DeploymentResourcePoolService client object.
|
109
|
+
#
|
110
|
+
# @example
|
111
|
+
#
|
112
|
+
# # Create a client using the default configuration
|
113
|
+
# client = ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client.new
|
114
|
+
#
|
115
|
+
# # Create a client using a custom configuration
|
116
|
+
# client = ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client.new do |config|
|
117
|
+
# config.timeout = 10.0
|
118
|
+
# end
|
119
|
+
#
|
120
|
+
# @yield [config] Configure the DeploymentResourcePoolService client.
|
121
|
+
# @yieldparam config [Client::Configuration]
|
122
|
+
#
|
123
|
+
def initialize
|
124
|
+
# These require statements are intentionally placed here to initialize
|
125
|
+
# the gRPC module only when it's required.
|
126
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
127
|
+
require "gapic/grpc"
|
128
|
+
require "google/cloud/aiplatform/v1/deployment_resource_pool_service_services_pb"
|
129
|
+
|
130
|
+
# Create the configuration object
|
131
|
+
@config = Configuration.new Client.configure
|
132
|
+
|
133
|
+
# Yield the configuration if needed
|
134
|
+
yield @config if block_given?
|
135
|
+
|
136
|
+
# Create credentials
|
137
|
+
credentials = @config.credentials
|
138
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
139
|
+
# but only if the default endpoint does not have a region prefix.
|
140
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
141
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
142
|
+
!@config.endpoint.split(".").first.include?("-"))
|
143
|
+
credentials ||= Credentials.default scope: @config.scope,
|
144
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
145
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
146
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
147
|
+
end
|
148
|
+
@quota_project_id = @config.quota_project
|
149
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
150
|
+
|
151
|
+
@operations_client = Operations.new do |config|
|
152
|
+
config.credentials = credentials
|
153
|
+
config.quota_project = @quota_project_id
|
154
|
+
config.endpoint = @config.endpoint
|
155
|
+
config.universe_domain = @config.universe_domain
|
156
|
+
end
|
157
|
+
|
158
|
+
@deployment_resource_pool_service_stub = ::Gapic::ServiceStub.new(
|
159
|
+
::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Stub,
|
160
|
+
credentials: credentials,
|
161
|
+
endpoint: @config.endpoint,
|
162
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
163
|
+
universe_domain: @config.universe_domain,
|
164
|
+
channel_args: @config.channel_args,
|
165
|
+
interceptors: @config.interceptors,
|
166
|
+
channel_pool_config: @config.channel_pool
|
167
|
+
)
|
168
|
+
|
169
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
170
|
+
config.credentials = credentials
|
171
|
+
config.quota_project = @quota_project_id
|
172
|
+
config.endpoint = @deployment_resource_pool_service_stub.endpoint
|
173
|
+
config.universe_domain = @deployment_resource_pool_service_stub.universe_domain
|
174
|
+
end
|
175
|
+
|
176
|
+
@iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
|
177
|
+
config.credentials = credentials
|
178
|
+
config.quota_project = @quota_project_id
|
179
|
+
config.endpoint = @deployment_resource_pool_service_stub.endpoint
|
180
|
+
config.universe_domain = @deployment_resource_pool_service_stub.universe_domain
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
##
|
185
|
+
# Get the associated client for long-running operations.
|
186
|
+
#
|
187
|
+
# @return [::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Operations]
|
188
|
+
#
|
189
|
+
attr_reader :operations_client
|
190
|
+
|
191
|
+
##
|
192
|
+
# Get the associated client for mix-in of the Locations.
|
193
|
+
#
|
194
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
195
|
+
#
|
196
|
+
attr_reader :location_client
|
197
|
+
|
198
|
+
##
|
199
|
+
# Get the associated client for mix-in of the IAMPolicy.
|
200
|
+
#
|
201
|
+
# @return [Google::Iam::V1::IAMPolicy::Client]
|
202
|
+
#
|
203
|
+
attr_reader :iam_policy_client
|
204
|
+
|
205
|
+
# Service calls
|
206
|
+
|
207
|
+
##
|
208
|
+
# Create a DeploymentResourcePool.
|
209
|
+
#
|
210
|
+
# @overload create_deployment_resource_pool(request, options = nil)
|
211
|
+
# Pass arguments to `create_deployment_resource_pool` via a request object, either of type
|
212
|
+
# {::Google::Cloud::AIPlatform::V1::CreateDeploymentResourcePoolRequest} or an equivalent Hash.
|
213
|
+
#
|
214
|
+
# @param request [::Google::Cloud::AIPlatform::V1::CreateDeploymentResourcePoolRequest, ::Hash]
|
215
|
+
# A request object representing the call parameters. Required. To specify no
|
216
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
217
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
218
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
219
|
+
#
|
220
|
+
# @overload create_deployment_resource_pool(parent: nil, deployment_resource_pool: nil, deployment_resource_pool_id: nil)
|
221
|
+
# Pass arguments to `create_deployment_resource_pool` via keyword arguments. Note that at
|
222
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
223
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
224
|
+
#
|
225
|
+
# @param parent [::String]
|
226
|
+
# Required. The parent location resource where this DeploymentResourcePool
|
227
|
+
# will be created. Format: `projects/{project}/locations/{location}`
|
228
|
+
# @param deployment_resource_pool [::Google::Cloud::AIPlatform::V1::DeploymentResourcePool, ::Hash]
|
229
|
+
# Required. The DeploymentResourcePool to create.
|
230
|
+
# @param deployment_resource_pool_id [::String]
|
231
|
+
# Required. The ID to use for the DeploymentResourcePool, which
|
232
|
+
# will become the final component of the DeploymentResourcePool's resource
|
233
|
+
# name.
|
234
|
+
#
|
235
|
+
# The maximum length is 63 characters, and valid characters
|
236
|
+
# are `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`.
|
237
|
+
#
|
238
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
239
|
+
# @yieldparam response [::Gapic::Operation]
|
240
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
241
|
+
#
|
242
|
+
# @return [::Gapic::Operation]
|
243
|
+
#
|
244
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
245
|
+
#
|
246
|
+
# @example Basic example
|
247
|
+
# require "google/cloud/ai_platform/v1"
|
248
|
+
#
|
249
|
+
# # Create a client object. The client can be reused for multiple calls.
|
250
|
+
# client = Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client.new
|
251
|
+
#
|
252
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
253
|
+
# request = Google::Cloud::AIPlatform::V1::CreateDeploymentResourcePoolRequest.new
|
254
|
+
#
|
255
|
+
# # Call the create_deployment_resource_pool method.
|
256
|
+
# result = client.create_deployment_resource_pool request
|
257
|
+
#
|
258
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
259
|
+
# # check the status of an operation, cancel it, or wait for results.
|
260
|
+
# # Here is how to wait for a response.
|
261
|
+
# result.wait_until_done! timeout: 60
|
262
|
+
# if result.response?
|
263
|
+
# p result.response
|
264
|
+
# else
|
265
|
+
# puts "No response received."
|
266
|
+
# end
|
267
|
+
#
|
268
|
+
def create_deployment_resource_pool request, options = nil
|
269
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
270
|
+
|
271
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateDeploymentResourcePoolRequest
|
272
|
+
|
273
|
+
# Converts hash and nil to an options object
|
274
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
275
|
+
|
276
|
+
# Customize the options with defaults
|
277
|
+
metadata = @config.rpcs.create_deployment_resource_pool.metadata.to_h
|
278
|
+
|
279
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
280
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
281
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
282
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
283
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
284
|
+
|
285
|
+
header_params = {}
|
286
|
+
if request.parent
|
287
|
+
header_params["parent"] = request.parent
|
288
|
+
end
|
289
|
+
|
290
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
291
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
292
|
+
|
293
|
+
options.apply_defaults timeout: @config.rpcs.create_deployment_resource_pool.timeout,
|
294
|
+
metadata: metadata,
|
295
|
+
retry_policy: @config.rpcs.create_deployment_resource_pool.retry_policy
|
296
|
+
|
297
|
+
options.apply_defaults timeout: @config.timeout,
|
298
|
+
metadata: @config.metadata,
|
299
|
+
retry_policy: @config.retry_policy
|
300
|
+
|
301
|
+
@deployment_resource_pool_service_stub.call_rpc :create_deployment_resource_pool, request, options: options do |response, operation|
|
302
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
303
|
+
yield response, operation if block_given?
|
304
|
+
return response
|
305
|
+
end
|
306
|
+
rescue ::GRPC::BadStatus => e
|
307
|
+
raise ::Google::Cloud::Error.from_error(e)
|
308
|
+
end
|
309
|
+
|
310
|
+
##
|
311
|
+
# Get a DeploymentResourcePool.
|
312
|
+
#
|
313
|
+
# @overload get_deployment_resource_pool(request, options = nil)
|
314
|
+
# Pass arguments to `get_deployment_resource_pool` via a request object, either of type
|
315
|
+
# {::Google::Cloud::AIPlatform::V1::GetDeploymentResourcePoolRequest} or an equivalent Hash.
|
316
|
+
#
|
317
|
+
# @param request [::Google::Cloud::AIPlatform::V1::GetDeploymentResourcePoolRequest, ::Hash]
|
318
|
+
# A request object representing the call parameters. Required. To specify no
|
319
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
320
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
321
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
322
|
+
#
|
323
|
+
# @overload get_deployment_resource_pool(name: nil)
|
324
|
+
# Pass arguments to `get_deployment_resource_pool` via keyword arguments. Note that at
|
325
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
326
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
327
|
+
#
|
328
|
+
# @param name [::String]
|
329
|
+
# Required. The name of the DeploymentResourcePool to retrieve.
|
330
|
+
# Format:
|
331
|
+
# `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
|
332
|
+
#
|
333
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
334
|
+
# @yieldparam response [::Google::Cloud::AIPlatform::V1::DeploymentResourcePool]
|
335
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
336
|
+
#
|
337
|
+
# @return [::Google::Cloud::AIPlatform::V1::DeploymentResourcePool]
|
338
|
+
#
|
339
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
340
|
+
#
|
341
|
+
# @example Basic example
|
342
|
+
# require "google/cloud/ai_platform/v1"
|
343
|
+
#
|
344
|
+
# # Create a client object. The client can be reused for multiple calls.
|
345
|
+
# client = Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client.new
|
346
|
+
#
|
347
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
348
|
+
# request = Google::Cloud::AIPlatform::V1::GetDeploymentResourcePoolRequest.new
|
349
|
+
#
|
350
|
+
# # Call the get_deployment_resource_pool method.
|
351
|
+
# result = client.get_deployment_resource_pool request
|
352
|
+
#
|
353
|
+
# # The returned object is of type Google::Cloud::AIPlatform::V1::DeploymentResourcePool.
|
354
|
+
# p result
|
355
|
+
#
|
356
|
+
def get_deployment_resource_pool request, options = nil
|
357
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
358
|
+
|
359
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetDeploymentResourcePoolRequest
|
360
|
+
|
361
|
+
# Converts hash and nil to an options object
|
362
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
363
|
+
|
364
|
+
# Customize the options with defaults
|
365
|
+
metadata = @config.rpcs.get_deployment_resource_pool.metadata.to_h
|
366
|
+
|
367
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
368
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
369
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
370
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
371
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
372
|
+
|
373
|
+
header_params = {}
|
374
|
+
if request.name
|
375
|
+
header_params["name"] = request.name
|
376
|
+
end
|
377
|
+
|
378
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
379
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
380
|
+
|
381
|
+
options.apply_defaults timeout: @config.rpcs.get_deployment_resource_pool.timeout,
|
382
|
+
metadata: metadata,
|
383
|
+
retry_policy: @config.rpcs.get_deployment_resource_pool.retry_policy
|
384
|
+
|
385
|
+
options.apply_defaults timeout: @config.timeout,
|
386
|
+
metadata: @config.metadata,
|
387
|
+
retry_policy: @config.retry_policy
|
388
|
+
|
389
|
+
@deployment_resource_pool_service_stub.call_rpc :get_deployment_resource_pool, request, options: options do |response, operation|
|
390
|
+
yield response, operation if block_given?
|
391
|
+
return response
|
392
|
+
end
|
393
|
+
rescue ::GRPC::BadStatus => e
|
394
|
+
raise ::Google::Cloud::Error.from_error(e)
|
395
|
+
end
|
396
|
+
|
397
|
+
##
|
398
|
+
# List DeploymentResourcePools in a location.
|
399
|
+
#
|
400
|
+
# @overload list_deployment_resource_pools(request, options = nil)
|
401
|
+
# Pass arguments to `list_deployment_resource_pools` via a request object, either of type
|
402
|
+
# {::Google::Cloud::AIPlatform::V1::ListDeploymentResourcePoolsRequest} or an equivalent Hash.
|
403
|
+
#
|
404
|
+
# @param request [::Google::Cloud::AIPlatform::V1::ListDeploymentResourcePoolsRequest, ::Hash]
|
405
|
+
# A request object representing the call parameters. Required. To specify no
|
406
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
407
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
408
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
409
|
+
#
|
410
|
+
# @overload list_deployment_resource_pools(parent: nil, page_size: nil, page_token: nil)
|
411
|
+
# Pass arguments to `list_deployment_resource_pools` via keyword arguments. Note that at
|
412
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
413
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
414
|
+
#
|
415
|
+
# @param parent [::String]
|
416
|
+
# Required. The parent Location which owns this collection of
|
417
|
+
# DeploymentResourcePools. Format: `projects/{project}/locations/{location}`
|
418
|
+
# @param page_size [::Integer]
|
419
|
+
# The maximum number of DeploymentResourcePools to return. The service may
|
420
|
+
# return fewer than this value.
|
421
|
+
# @param page_token [::String]
|
422
|
+
# A page token, received from a previous `ListDeploymentResourcePools` call.
|
423
|
+
# Provide this to retrieve the subsequent page.
|
424
|
+
#
|
425
|
+
# When paginating, all other parameters provided to
|
426
|
+
# `ListDeploymentResourcePools` must match the call that provided the page
|
427
|
+
# token.
|
428
|
+
#
|
429
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
430
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DeploymentResourcePool>]
|
431
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
432
|
+
#
|
433
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DeploymentResourcePool>]
|
434
|
+
#
|
435
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
436
|
+
#
|
437
|
+
# @example Basic example
|
438
|
+
# require "google/cloud/ai_platform/v1"
|
439
|
+
#
|
440
|
+
# # Create a client object. The client can be reused for multiple calls.
|
441
|
+
# client = Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client.new
|
442
|
+
#
|
443
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
444
|
+
# request = Google::Cloud::AIPlatform::V1::ListDeploymentResourcePoolsRequest.new
|
445
|
+
#
|
446
|
+
# # Call the list_deployment_resource_pools method.
|
447
|
+
# result = client.list_deployment_resource_pools request
|
448
|
+
#
|
449
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
450
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
451
|
+
# result.each do |item|
|
452
|
+
# # Each element is of type ::Google::Cloud::AIPlatform::V1::DeploymentResourcePool.
|
453
|
+
# p item
|
454
|
+
# end
|
455
|
+
#
|
456
|
+
def list_deployment_resource_pools request, options = nil
|
457
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
458
|
+
|
459
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListDeploymentResourcePoolsRequest
|
460
|
+
|
461
|
+
# Converts hash and nil to an options object
|
462
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
463
|
+
|
464
|
+
# Customize the options with defaults
|
465
|
+
metadata = @config.rpcs.list_deployment_resource_pools.metadata.to_h
|
466
|
+
|
467
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
468
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
469
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
470
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
471
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
472
|
+
|
473
|
+
header_params = {}
|
474
|
+
if request.parent
|
475
|
+
header_params["parent"] = request.parent
|
476
|
+
end
|
477
|
+
|
478
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
479
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
480
|
+
|
481
|
+
options.apply_defaults timeout: @config.rpcs.list_deployment_resource_pools.timeout,
|
482
|
+
metadata: metadata,
|
483
|
+
retry_policy: @config.rpcs.list_deployment_resource_pools.retry_policy
|
484
|
+
|
485
|
+
options.apply_defaults timeout: @config.timeout,
|
486
|
+
metadata: @config.metadata,
|
487
|
+
retry_policy: @config.retry_policy
|
488
|
+
|
489
|
+
@deployment_resource_pool_service_stub.call_rpc :list_deployment_resource_pools, request, options: options do |response, operation|
|
490
|
+
response = ::Gapic::PagedEnumerable.new @deployment_resource_pool_service_stub, :list_deployment_resource_pools, request, response, operation, options
|
491
|
+
yield response, operation if block_given?
|
492
|
+
return response
|
493
|
+
end
|
494
|
+
rescue ::GRPC::BadStatus => e
|
495
|
+
raise ::Google::Cloud::Error.from_error(e)
|
496
|
+
end
|
497
|
+
|
498
|
+
##
|
499
|
+
# Delete a DeploymentResourcePool.
|
500
|
+
#
|
501
|
+
# @overload delete_deployment_resource_pool(request, options = nil)
|
502
|
+
# Pass arguments to `delete_deployment_resource_pool` via a request object, either of type
|
503
|
+
# {::Google::Cloud::AIPlatform::V1::DeleteDeploymentResourcePoolRequest} or an equivalent Hash.
|
504
|
+
#
|
505
|
+
# @param request [::Google::Cloud::AIPlatform::V1::DeleteDeploymentResourcePoolRequest, ::Hash]
|
506
|
+
# A request object representing the call parameters. Required. To specify no
|
507
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
508
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
509
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
510
|
+
#
|
511
|
+
# @overload delete_deployment_resource_pool(name: nil)
|
512
|
+
# Pass arguments to `delete_deployment_resource_pool` via keyword arguments. Note that at
|
513
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
514
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
515
|
+
#
|
516
|
+
# @param name [::String]
|
517
|
+
# Required. The name of the DeploymentResourcePool to delete.
|
518
|
+
# Format:
|
519
|
+
# `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
|
520
|
+
#
|
521
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
522
|
+
# @yieldparam response [::Gapic::Operation]
|
523
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
524
|
+
#
|
525
|
+
# @return [::Gapic::Operation]
|
526
|
+
#
|
527
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
528
|
+
#
|
529
|
+
# @example Basic example
|
530
|
+
# require "google/cloud/ai_platform/v1"
|
531
|
+
#
|
532
|
+
# # Create a client object. The client can be reused for multiple calls.
|
533
|
+
# client = Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client.new
|
534
|
+
#
|
535
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
536
|
+
# request = Google::Cloud::AIPlatform::V1::DeleteDeploymentResourcePoolRequest.new
|
537
|
+
#
|
538
|
+
# # Call the delete_deployment_resource_pool method.
|
539
|
+
# result = client.delete_deployment_resource_pool request
|
540
|
+
#
|
541
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
542
|
+
# # check the status of an operation, cancel it, or wait for results.
|
543
|
+
# # Here is how to wait for a response.
|
544
|
+
# result.wait_until_done! timeout: 60
|
545
|
+
# if result.response?
|
546
|
+
# p result.response
|
547
|
+
# else
|
548
|
+
# puts "No response received."
|
549
|
+
# end
|
550
|
+
#
|
551
|
+
def delete_deployment_resource_pool request, options = nil
|
552
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
553
|
+
|
554
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteDeploymentResourcePoolRequest
|
555
|
+
|
556
|
+
# Converts hash and nil to an options object
|
557
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
558
|
+
|
559
|
+
# Customize the options with defaults
|
560
|
+
metadata = @config.rpcs.delete_deployment_resource_pool.metadata.to_h
|
561
|
+
|
562
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
563
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
564
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
565
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
566
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
567
|
+
|
568
|
+
header_params = {}
|
569
|
+
if request.name
|
570
|
+
header_params["name"] = request.name
|
571
|
+
end
|
572
|
+
|
573
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
574
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
575
|
+
|
576
|
+
options.apply_defaults timeout: @config.rpcs.delete_deployment_resource_pool.timeout,
|
577
|
+
metadata: metadata,
|
578
|
+
retry_policy: @config.rpcs.delete_deployment_resource_pool.retry_policy
|
579
|
+
|
580
|
+
options.apply_defaults timeout: @config.timeout,
|
581
|
+
metadata: @config.metadata,
|
582
|
+
retry_policy: @config.retry_policy
|
583
|
+
|
584
|
+
@deployment_resource_pool_service_stub.call_rpc :delete_deployment_resource_pool, request, options: options do |response, operation|
|
585
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
586
|
+
yield response, operation if block_given?
|
587
|
+
return response
|
588
|
+
end
|
589
|
+
rescue ::GRPC::BadStatus => e
|
590
|
+
raise ::Google::Cloud::Error.from_error(e)
|
591
|
+
end
|
592
|
+
|
593
|
+
##
|
594
|
+
# List DeployedModels that have been deployed on this DeploymentResourcePool.
|
595
|
+
#
|
596
|
+
# @overload query_deployed_models(request, options = nil)
|
597
|
+
# Pass arguments to `query_deployed_models` via a request object, either of type
|
598
|
+
# {::Google::Cloud::AIPlatform::V1::QueryDeployedModelsRequest} or an equivalent Hash.
|
599
|
+
#
|
600
|
+
# @param request [::Google::Cloud::AIPlatform::V1::QueryDeployedModelsRequest, ::Hash]
|
601
|
+
# A request object representing the call parameters. Required. To specify no
|
602
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
603
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
604
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
605
|
+
#
|
606
|
+
# @overload query_deployed_models(deployment_resource_pool: nil, page_size: nil, page_token: nil)
|
607
|
+
# Pass arguments to `query_deployed_models` via keyword arguments. Note that at
|
608
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
609
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
610
|
+
#
|
611
|
+
# @param deployment_resource_pool [::String]
|
612
|
+
# Required. The name of the target DeploymentResourcePool to query.
|
613
|
+
# Format:
|
614
|
+
# `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
|
615
|
+
# @param page_size [::Integer]
|
616
|
+
# The maximum number of DeployedModels to return. The service may return
|
617
|
+
# fewer than this value.
|
618
|
+
# @param page_token [::String]
|
619
|
+
# A page token, received from a previous `QueryDeployedModels` call.
|
620
|
+
# Provide this to retrieve the subsequent page.
|
621
|
+
#
|
622
|
+
# When paginating, all other parameters provided to
|
623
|
+
# `QueryDeployedModels` must match the call that provided the page
|
624
|
+
# token.
|
625
|
+
#
|
626
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
627
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DeployedModel>]
|
628
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
629
|
+
#
|
630
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::DeployedModel>]
|
631
|
+
#
|
632
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
633
|
+
#
|
634
|
+
# @example Basic example
|
635
|
+
# require "google/cloud/ai_platform/v1"
|
636
|
+
#
|
637
|
+
# # Create a client object. The client can be reused for multiple calls.
|
638
|
+
# client = Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client.new
|
639
|
+
#
|
640
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
641
|
+
# request = Google::Cloud::AIPlatform::V1::QueryDeployedModelsRequest.new
|
642
|
+
#
|
643
|
+
# # Call the query_deployed_models method.
|
644
|
+
# result = client.query_deployed_models request
|
645
|
+
#
|
646
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
647
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
648
|
+
# result.each do |item|
|
649
|
+
# # Each element is of type ::Google::Cloud::AIPlatform::V1::DeployedModel.
|
650
|
+
# p item
|
651
|
+
# end
|
652
|
+
#
|
653
|
+
def query_deployed_models request, options = nil
|
654
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
655
|
+
|
656
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::QueryDeployedModelsRequest
|
657
|
+
|
658
|
+
# Converts hash and nil to an options object
|
659
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
660
|
+
|
661
|
+
# Customize the options with defaults
|
662
|
+
metadata = @config.rpcs.query_deployed_models.metadata.to_h
|
663
|
+
|
664
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
665
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
666
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
667
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
668
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
669
|
+
|
670
|
+
header_params = {}
|
671
|
+
if request.deployment_resource_pool
|
672
|
+
header_params["deployment_resource_pool"] = request.deployment_resource_pool
|
673
|
+
end
|
674
|
+
|
675
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
676
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
677
|
+
|
678
|
+
options.apply_defaults timeout: @config.rpcs.query_deployed_models.timeout,
|
679
|
+
metadata: metadata,
|
680
|
+
retry_policy: @config.rpcs.query_deployed_models.retry_policy
|
681
|
+
|
682
|
+
options.apply_defaults timeout: @config.timeout,
|
683
|
+
metadata: @config.metadata,
|
684
|
+
retry_policy: @config.retry_policy
|
685
|
+
|
686
|
+
@deployment_resource_pool_service_stub.call_rpc :query_deployed_models, request, options: options do |response, operation|
|
687
|
+
response = ::Gapic::PagedEnumerable.new @deployment_resource_pool_service_stub, :query_deployed_models, request, response, operation, options
|
688
|
+
yield response, operation if block_given?
|
689
|
+
return response
|
690
|
+
end
|
691
|
+
rescue ::GRPC::BadStatus => e
|
692
|
+
raise ::Google::Cloud::Error.from_error(e)
|
693
|
+
end
|
694
|
+
|
695
|
+
##
|
696
|
+
# Configuration class for the DeploymentResourcePoolService API.
|
697
|
+
#
|
698
|
+
# This class represents the configuration for DeploymentResourcePoolService,
|
699
|
+
# providing control over timeouts, retry behavior, logging, transport
|
700
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
701
|
+
# applied individually to specific RPCs. See
|
702
|
+
# {::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client::Configuration::Rpcs}
|
703
|
+
# for a list of RPCs that can be configured independently.
|
704
|
+
#
|
705
|
+
# Configuration can be applied globally to all clients, or to a single client
|
706
|
+
# on construction.
|
707
|
+
#
|
708
|
+
# @example
|
709
|
+
#
|
710
|
+
# # Modify the global config, setting the timeout for
|
711
|
+
# # create_deployment_resource_pool to 20 seconds,
|
712
|
+
# # and all remaining timeouts to 10 seconds.
|
713
|
+
# ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client.configure do |config|
|
714
|
+
# config.timeout = 10.0
|
715
|
+
# config.rpcs.create_deployment_resource_pool.timeout = 20.0
|
716
|
+
# end
|
717
|
+
#
|
718
|
+
# # Apply the above configuration only to a new client.
|
719
|
+
# client = ::Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Client.new do |config|
|
720
|
+
# config.timeout = 10.0
|
721
|
+
# config.rpcs.create_deployment_resource_pool.timeout = 20.0
|
722
|
+
# end
|
723
|
+
#
|
724
|
+
# @!attribute [rw] endpoint
|
725
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
726
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
727
|
+
# @return [::String,nil]
|
728
|
+
# @!attribute [rw] credentials
|
729
|
+
# Credentials to send with calls. You may provide any of the following types:
|
730
|
+
# * (`String`) The path to a service account key file in JSON format
|
731
|
+
# * (`Hash`) A service account key as a Hash
|
732
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
733
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
734
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
735
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
736
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
737
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
738
|
+
# * (`nil`) indicating no credentials
|
739
|
+
# @return [::Object]
|
740
|
+
# @!attribute [rw] scope
|
741
|
+
# The OAuth scopes
|
742
|
+
# @return [::Array<::String>]
|
743
|
+
# @!attribute [rw] lib_name
|
744
|
+
# The library name as recorded in instrumentation and logging
|
745
|
+
# @return [::String]
|
746
|
+
# @!attribute [rw] lib_version
|
747
|
+
# The library version as recorded in instrumentation and logging
|
748
|
+
# @return [::String]
|
749
|
+
# @!attribute [rw] channel_args
|
750
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
751
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
752
|
+
# @return [::Hash]
|
753
|
+
# @!attribute [rw] interceptors
|
754
|
+
# An array of interceptors that are run before calls are executed.
|
755
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
756
|
+
# @!attribute [rw] timeout
|
757
|
+
# The call timeout in seconds.
|
758
|
+
# @return [::Numeric]
|
759
|
+
# @!attribute [rw] metadata
|
760
|
+
# Additional gRPC headers to be sent with the call.
|
761
|
+
# @return [::Hash{::Symbol=>::String}]
|
762
|
+
# @!attribute [rw] retry_policy
|
763
|
+
# The retry policy. The value is a hash with the following keys:
|
764
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
765
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
766
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
767
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
768
|
+
# trigger a retry.
|
769
|
+
# @return [::Hash]
|
770
|
+
# @!attribute [rw] quota_project
|
771
|
+
# A separate project against which to charge quota.
|
772
|
+
# @return [::String]
|
773
|
+
# @!attribute [rw] universe_domain
|
774
|
+
# The universe domain within which to make requests. This determines the
|
775
|
+
# default endpoint URL. The default value of nil uses the environment
|
776
|
+
# universe (usually the default "googleapis.com" universe).
|
777
|
+
# @return [::String,nil]
|
778
|
+
#
|
779
|
+
class Configuration
|
780
|
+
extend ::Gapic::Config
|
781
|
+
|
782
|
+
# @private
|
783
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
784
|
+
DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
|
785
|
+
|
786
|
+
config_attr :endpoint, nil, ::String, nil
|
787
|
+
config_attr :credentials, nil do |value|
|
788
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
789
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
790
|
+
allowed.any? { |klass| klass === value }
|
791
|
+
end
|
792
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
793
|
+
config_attr :lib_name, nil, ::String, nil
|
794
|
+
config_attr :lib_version, nil, ::String, nil
|
795
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
796
|
+
config_attr :interceptors, nil, ::Array, nil
|
797
|
+
config_attr :timeout, nil, ::Numeric, nil
|
798
|
+
config_attr :metadata, nil, ::Hash, nil
|
799
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
800
|
+
config_attr :quota_project, nil, ::String, nil
|
801
|
+
config_attr :universe_domain, nil, ::String, nil
|
802
|
+
|
803
|
+
# @private
|
804
|
+
def initialize parent_config = nil
|
805
|
+
@parent_config = parent_config unless parent_config.nil?
|
806
|
+
|
807
|
+
yield self if block_given?
|
808
|
+
end
|
809
|
+
|
810
|
+
##
|
811
|
+
# Configurations for individual RPCs
|
812
|
+
# @return [Rpcs]
|
813
|
+
#
|
814
|
+
def rpcs
|
815
|
+
@rpcs ||= begin
|
816
|
+
parent_rpcs = nil
|
817
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
818
|
+
Rpcs.new parent_rpcs
|
819
|
+
end
|
820
|
+
end
|
821
|
+
|
822
|
+
##
|
823
|
+
# Configuration for the channel pool
|
824
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
825
|
+
#
|
826
|
+
def channel_pool
|
827
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
828
|
+
end
|
829
|
+
|
830
|
+
##
|
831
|
+
# Configuration RPC class for the DeploymentResourcePoolService API.
|
832
|
+
#
|
833
|
+
# Includes fields providing the configuration for each RPC in this service.
|
834
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
835
|
+
# the following configuration fields:
|
836
|
+
#
|
837
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
838
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
839
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
840
|
+
# include the following keys:
|
841
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
842
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
843
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
844
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
845
|
+
# trigger a retry.
|
846
|
+
#
|
847
|
+
class Rpcs
|
848
|
+
##
|
849
|
+
# RPC-specific configuration for `create_deployment_resource_pool`
|
850
|
+
# @return [::Gapic::Config::Method]
|
851
|
+
#
|
852
|
+
attr_reader :create_deployment_resource_pool
|
853
|
+
##
|
854
|
+
# RPC-specific configuration for `get_deployment_resource_pool`
|
855
|
+
# @return [::Gapic::Config::Method]
|
856
|
+
#
|
857
|
+
attr_reader :get_deployment_resource_pool
|
858
|
+
##
|
859
|
+
# RPC-specific configuration for `list_deployment_resource_pools`
|
860
|
+
# @return [::Gapic::Config::Method]
|
861
|
+
#
|
862
|
+
attr_reader :list_deployment_resource_pools
|
863
|
+
##
|
864
|
+
# RPC-specific configuration for `delete_deployment_resource_pool`
|
865
|
+
# @return [::Gapic::Config::Method]
|
866
|
+
#
|
867
|
+
attr_reader :delete_deployment_resource_pool
|
868
|
+
##
|
869
|
+
# RPC-specific configuration for `query_deployed_models`
|
870
|
+
# @return [::Gapic::Config::Method]
|
871
|
+
#
|
872
|
+
attr_reader :query_deployed_models
|
873
|
+
|
874
|
+
# @private
|
875
|
+
def initialize parent_rpcs = nil
|
876
|
+
create_deployment_resource_pool_config = parent_rpcs.create_deployment_resource_pool if parent_rpcs.respond_to? :create_deployment_resource_pool
|
877
|
+
@create_deployment_resource_pool = ::Gapic::Config::Method.new create_deployment_resource_pool_config
|
878
|
+
get_deployment_resource_pool_config = parent_rpcs.get_deployment_resource_pool if parent_rpcs.respond_to? :get_deployment_resource_pool
|
879
|
+
@get_deployment_resource_pool = ::Gapic::Config::Method.new get_deployment_resource_pool_config
|
880
|
+
list_deployment_resource_pools_config = parent_rpcs.list_deployment_resource_pools if parent_rpcs.respond_to? :list_deployment_resource_pools
|
881
|
+
@list_deployment_resource_pools = ::Gapic::Config::Method.new list_deployment_resource_pools_config
|
882
|
+
delete_deployment_resource_pool_config = parent_rpcs.delete_deployment_resource_pool if parent_rpcs.respond_to? :delete_deployment_resource_pool
|
883
|
+
@delete_deployment_resource_pool = ::Gapic::Config::Method.new delete_deployment_resource_pool_config
|
884
|
+
query_deployed_models_config = parent_rpcs.query_deployed_models if parent_rpcs.respond_to? :query_deployed_models
|
885
|
+
@query_deployed_models = ::Gapic::Config::Method.new query_deployed_models_config
|
886
|
+
|
887
|
+
yield self if block_given?
|
888
|
+
end
|
889
|
+
end
|
890
|
+
end
|
891
|
+
end
|
892
|
+
end
|
893
|
+
end
|
894
|
+
end
|
895
|
+
end
|
896
|
+
end
|