google-cloud-ai_platform-v1 0.60.0 → 0.61.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -20
- data/lib/google/cloud/ai_platform/v1/dataset_service/client.rb +43 -20
- data/lib/google/cloud/ai_platform/v1/dataset_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/dataset_service/rest/client.rb +43 -20
- data/lib/google/cloud/ai_platform/v1/dataset_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/dataset_service/rest/service_stub.rb +166 -116
- data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/client.rb +34 -7
- data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/client.rb +33 -7
- data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/service_stub.rb +62 -38
- data/lib/google/cloud/ai_platform/v1/endpoint_service/client.rb +36 -10
- data/lib/google/cloud/ai_platform/v1/endpoint_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/client.rb +36 -10
- data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/service_stub.rb +86 -56
- data/lib/google/cloud/ai_platform/v1/evaluation_service/client.rb +29 -2
- data/lib/google/cloud/ai_platform/v1/evaluation_service/rest/client.rb +29 -2
- data/lib/google/cloud/ai_platform/v1/evaluation_service/rest/service_stub.rb +22 -8
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/client.rb +38 -14
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/client.rb +38 -14
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/service_stub.rb +118 -80
- data/lib/google/cloud/ai_platform/v1/feature_online_store_service/client.rb +29 -3
- data/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest/client.rb +29 -3
- data/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest/service_stub.rb +30 -14
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/client.rb +38 -12
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/client.rb +38 -12
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/service_stub.rb +102 -68
- data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/client.rb +29 -4
- data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/client.rb +29 -3
- data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/service_stub.rb +31 -14
- data/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb +45 -22
- data/lib/google/cloud/ai_platform/v1/featurestore_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/featurestore_service/rest/client.rb +45 -22
- data/lib/google/cloud/ai_platform/v1/featurestore_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/featurestore_service/rest/service_stub.rb +182 -128
- data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/client.rb +31 -6
- data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/client.rb +31 -6
- data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/service_stub.rb +54 -32
- data/lib/google/cloud/ai_platform/v1/index_endpoint_service/client.rb +35 -9
- data/lib/google/cloud/ai_platform/v1/index_endpoint_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/client.rb +35 -9
- data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/service_stub.rb +78 -50
- data/lib/google/cloud/ai_platform/v1/index_service/client.rb +33 -8
- data/lib/google/cloud/ai_platform/v1/index_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/index_service/rest/client.rb +33 -8
- data/lib/google/cloud/ai_platform/v1/index_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/index_service/rest/service_stub.rb +70 -44
- data/lib/google/cloud/ai_platform/v1/job_service/client.rb +44 -36
- data/lib/google/cloud/ai_platform/v1/job_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/job_service/rest/client.rb +44 -36
- data/lib/google/cloud/ai_platform/v1/job_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/job_service/rest/service_stub.rb +294 -212
- data/lib/google/cloud/ai_platform/v1/llm_utility_service/client.rb +29 -3
- data/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/client.rb +29 -3
- data/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/service_stub.rb +30 -14
- data/lib/google/cloud/ai_platform/v1/match_service/client.rb +29 -3
- data/lib/google/cloud/ai_platform/v1/match_service/rest/client.rb +29 -3
- data/lib/google/cloud/ai_platform/v1/match_service/rest/service_stub.rb +30 -14
- data/lib/google/cloud/ai_platform/v1/metadata_service/client.rb +42 -33
- data/lib/google/cloud/ai_platform/v1/metadata_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/metadata_service/rest/client.rb +42 -33
- data/lib/google/cloud/ai_platform/v1/metadata_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/metadata_service/rest/service_stub.rb +270 -194
- data/lib/google/cloud/ai_platform/v1/migration_service/client.rb +31 -3
- data/lib/google/cloud/ai_platform/v1/migration_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/migration_service/rest/client.rb +31 -3
- data/lib/google/cloud/ai_platform/v1/migration_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/migration_service/rest/service_stub.rb +30 -14
- data/lib/google/cloud/ai_platform/v1/model_garden_service/client.rb +29 -2
- data/lib/google/cloud/ai_platform/v1/model_garden_service/rest/client.rb +29 -2
- data/lib/google/cloud/ai_platform/v1/model_garden_service/rest/service_stub.rb +22 -8
- data/lib/google/cloud/ai_platform/v1/model_service/client.rb +39 -19
- data/lib/google/cloud/ai_platform/v1/model_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/model_service/rest/client.rb +39 -19
- data/lib/google/cloud/ai_platform/v1/model_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/model_service/rest/service_stub.rb +158 -110
- data/lib/google/cloud/ai_platform/v1/notebook_service/client.rb +41 -17
- data/lib/google/cloud/ai_platform/v1/notebook_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb +41 -17
- data/lib/google/cloud/ai_platform/v1/notebook_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/notebook_service/rest/service_stub.rb +142 -98
- data/lib/google/cloud/ai_platform/v1/persistent_resource_service/client.rb +34 -7
- data/lib/google/cloud/ai_platform/v1/persistent_resource_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/client.rb +34 -7
- data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/service_stub.rb +62 -38
- data/lib/google/cloud/ai_platform/v1/pipeline_service/client.rb +35 -13
- data/lib/google/cloud/ai_platform/v1/pipeline_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/client.rb +35 -13
- data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/service_stub.rb +110 -74
- data/lib/google/cloud/ai_platform/v1/prediction_service/client.rb +29 -14
- data/lib/google/cloud/ai_platform/v1/prediction_service/rest/client.rb +29 -7
- data/lib/google/cloud/ai_platform/v1/prediction_service/rest/service_stub.rb +65 -38
- data/lib/google/cloud/ai_platform/v1/schedule_service/client.rb +31 -8
- data/lib/google/cloud/ai_platform/v1/schedule_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/schedule_service/rest/client.rb +31 -8
- data/lib/google/cloud/ai_platform/v1/schedule_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/schedule_service/rest/service_stub.rb +70 -44
- data/lib/google/cloud/ai_platform/v1/specialist_pool_service/client.rb +33 -6
- data/lib/google/cloud/ai_platform/v1/specialist_pool_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/client.rb +33 -6
- data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/service_stub.rb +54 -32
- data/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb +40 -31
- data/lib/google/cloud/ai_platform/v1/tensorboard_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/client.rb +40 -30
- data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/service_stub.rb +247 -176
- data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/client.rb +36 -11
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/client.rb +36 -11
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/service_stub.rb +94 -62
- data/lib/google/cloud/ai_platform/v1/vertex_rag_service/client.rb +29 -4
- data/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/client.rb +29 -4
- data/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/service_stub.rb +38 -20
- data/lib/google/cloud/ai_platform/v1/vizier_service/client.rb +33 -16
- data/lib/google/cloud/ai_platform/v1/vizier_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/vizier_service/rest/client.rb +33 -16
- data/lib/google/cloud/ai_platform/v1/vizier_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/vizier_service/rest/service_stub.rb +134 -92
- data/lib/google/cloud/aiplatform/v1/accelerator_type_pb.rb +1 -1
- data/proto_docs/google/cloud/aiplatform/v1/accelerator_type.rb +3 -0
- metadata +4 -4
@@ -166,14 +166,26 @@ module Google
|
|
166
166
|
universe_domain: @config.universe_domain,
|
167
167
|
channel_args: @config.channel_args,
|
168
168
|
interceptors: @config.interceptors,
|
169
|
-
channel_pool_config: @config.channel_pool
|
169
|
+
channel_pool_config: @config.channel_pool,
|
170
|
+
logger: @config.logger
|
170
171
|
)
|
171
172
|
|
173
|
+
@endpoint_service_stub.stub_logger&.info do |entry|
|
174
|
+
entry.set_system_name
|
175
|
+
entry.set_service
|
176
|
+
entry.message = "Created client for #{entry.service}"
|
177
|
+
entry.set_credentials_fields credentials
|
178
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
179
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
180
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
181
|
+
end
|
182
|
+
|
172
183
|
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
173
184
|
config.credentials = credentials
|
174
185
|
config.quota_project = @quota_project_id
|
175
186
|
config.endpoint = @endpoint_service_stub.endpoint
|
176
187
|
config.universe_domain = @endpoint_service_stub.universe_domain
|
188
|
+
config.logger = @endpoint_service_stub.logger if config.respond_to? :logger=
|
177
189
|
end
|
178
190
|
|
179
191
|
@iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
|
@@ -181,6 +193,7 @@ module Google
|
|
181
193
|
config.quota_project = @quota_project_id
|
182
194
|
config.endpoint = @endpoint_service_stub.endpoint
|
183
195
|
config.universe_domain = @endpoint_service_stub.universe_domain
|
196
|
+
config.logger = @endpoint_service_stub.logger if config.respond_to? :logger=
|
184
197
|
end
|
185
198
|
end
|
186
199
|
|
@@ -205,6 +218,15 @@ module Google
|
|
205
218
|
#
|
206
219
|
attr_reader :iam_policy_client
|
207
220
|
|
221
|
+
##
|
222
|
+
# The logger used for request/response debug logging.
|
223
|
+
#
|
224
|
+
# @return [Logger]
|
225
|
+
#
|
226
|
+
def logger
|
227
|
+
@endpoint_service_stub.logger
|
228
|
+
end
|
229
|
+
|
208
230
|
# Service calls
|
209
231
|
|
210
232
|
##
|
@@ -313,7 +335,7 @@ module Google
|
|
313
335
|
@endpoint_service_stub.call_rpc :create_endpoint, request, options: options do |response, operation|
|
314
336
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
315
337
|
yield response, operation if block_given?
|
316
|
-
|
338
|
+
throw :response, response
|
317
339
|
end
|
318
340
|
rescue ::GRPC::BadStatus => e
|
319
341
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -401,7 +423,6 @@ module Google
|
|
401
423
|
|
402
424
|
@endpoint_service_stub.call_rpc :get_endpoint, request, options: options do |response, operation|
|
403
425
|
yield response, operation if block_given?
|
404
|
-
return response
|
405
426
|
end
|
406
427
|
rescue ::GRPC::BadStatus => e
|
407
428
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -534,7 +555,7 @@ module Google
|
|
534
555
|
@endpoint_service_stub.call_rpc :list_endpoints, request, options: options do |response, operation|
|
535
556
|
response = ::Gapic::PagedEnumerable.new @endpoint_service_stub, :list_endpoints, request, response, operation, options
|
536
557
|
yield response, operation if block_given?
|
537
|
-
|
558
|
+
throw :response, response
|
538
559
|
end
|
539
560
|
rescue ::GRPC::BadStatus => e
|
540
561
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -623,7 +644,6 @@ module Google
|
|
623
644
|
|
624
645
|
@endpoint_service_stub.call_rpc :update_endpoint, request, options: options do |response, operation|
|
625
646
|
yield response, operation if block_given?
|
626
|
-
return response
|
627
647
|
end
|
628
648
|
rescue ::GRPC::BadStatus => e
|
629
649
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -719,7 +739,7 @@ module Google
|
|
719
739
|
@endpoint_service_stub.call_rpc :update_endpoint_long_running, request, options: options do |response, operation|
|
720
740
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
721
741
|
yield response, operation if block_given?
|
722
|
-
|
742
|
+
throw :response, response
|
723
743
|
end
|
724
744
|
rescue ::GRPC::BadStatus => e
|
725
745
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -815,7 +835,7 @@ module Google
|
|
815
835
|
@endpoint_service_stub.call_rpc :delete_endpoint, request, options: options do |response, operation|
|
816
836
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
817
837
|
yield response, operation if block_given?
|
818
|
-
|
838
|
+
throw :response, response
|
819
839
|
end
|
820
840
|
rescue ::GRPC::BadStatus => e
|
821
841
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -931,7 +951,7 @@ module Google
|
|
931
951
|
@endpoint_service_stub.call_rpc :deploy_model, request, options: options do |response, operation|
|
932
952
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
933
953
|
yield response, operation if block_given?
|
934
|
-
|
954
|
+
throw :response, response
|
935
955
|
end
|
936
956
|
rescue ::GRPC::BadStatus => e
|
937
957
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1038,7 +1058,7 @@ module Google
|
|
1038
1058
|
@endpoint_service_stub.call_rpc :undeploy_model, request, options: options do |response, operation|
|
1039
1059
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1040
1060
|
yield response, operation if block_given?
|
1041
|
-
|
1061
|
+
throw :response, response
|
1042
1062
|
end
|
1043
1063
|
rescue ::GRPC::BadStatus => e
|
1044
1064
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1153,7 +1173,7 @@ module Google
|
|
1153
1173
|
@endpoint_service_stub.call_rpc :mutate_deployed_model, request, options: options do |response, operation|
|
1154
1174
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1155
1175
|
yield response, operation if block_given?
|
1156
|
-
|
1176
|
+
throw :response, response
|
1157
1177
|
end
|
1158
1178
|
rescue ::GRPC::BadStatus => e
|
1159
1179
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1242,6 +1262,11 @@ module Google
|
|
1242
1262
|
# default endpoint URL. The default value of nil uses the environment
|
1243
1263
|
# universe (usually the default "googleapis.com" universe).
|
1244
1264
|
# @return [::String,nil]
|
1265
|
+
# @!attribute [rw] logger
|
1266
|
+
# A custom logger to use for request/response debug logging, or the value
|
1267
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1268
|
+
# explicitly disable logging.
|
1269
|
+
# @return [::Logger,:default,nil]
|
1245
1270
|
#
|
1246
1271
|
class Configuration
|
1247
1272
|
extend ::Gapic::Config
|
@@ -1266,6 +1291,7 @@ module Google
|
|
1266
1291
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1267
1292
|
config_attr :quota_project, nil, ::String, nil
|
1268
1293
|
config_attr :universe_domain, nil, ::String, nil
|
1294
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1269
1295
|
|
1270
1296
|
# @private
|
1271
1297
|
def initialize parent_config = nil
|
@@ -213,7 +213,7 @@ module Google
|
|
213
213
|
wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
|
214
214
|
response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
|
215
215
|
yield response, operation if block_given?
|
216
|
-
|
216
|
+
throw :response, response
|
217
217
|
end
|
218
218
|
rescue ::GRPC::BadStatus => e
|
219
219
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -309,7 +309,7 @@ module Google
|
|
309
309
|
@operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
|
310
310
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
311
311
|
yield response, operation if block_given?
|
312
|
-
|
312
|
+
throw :response, response
|
313
313
|
end
|
314
314
|
rescue ::GRPC::BadStatus => e
|
315
315
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -398,7 +398,6 @@ module Google
|
|
398
398
|
|
399
399
|
@operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
|
400
400
|
yield response, operation if block_given?
|
401
|
-
return response
|
402
401
|
end
|
403
402
|
rescue ::GRPC::BadStatus => e
|
404
403
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -494,7 +493,6 @@ module Google
|
|
494
493
|
|
495
494
|
@operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
|
496
495
|
yield response, operation if block_given?
|
497
|
-
return response
|
498
496
|
end
|
499
497
|
rescue ::GRPC::BadStatus => e
|
500
498
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -600,7 +598,7 @@ module Google
|
|
600
598
|
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
601
599
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
602
600
|
yield response, operation if block_given?
|
603
|
-
|
601
|
+
throw :response, response
|
604
602
|
end
|
605
603
|
rescue ::GRPC::BadStatus => e
|
606
604
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -689,6 +687,11 @@ module Google
|
|
689
687
|
# default endpoint URL. The default value of nil uses the environment
|
690
688
|
# universe (usually the default "googleapis.com" universe).
|
691
689
|
# @return [::String,nil]
|
690
|
+
# @!attribute [rw] logger
|
691
|
+
# A custom logger to use for request/response debug logging, or the value
|
692
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
693
|
+
# explicitly disable logging.
|
694
|
+
# @return [::Logger,:default,nil]
|
692
695
|
#
|
693
696
|
class Configuration
|
694
697
|
extend ::Gapic::Config
|
@@ -713,6 +716,7 @@ module Google
|
|
713
716
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
714
717
|
config_attr :quota_project, nil, ::String, nil
|
715
718
|
config_attr :universe_domain, nil, ::String, nil
|
719
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
716
720
|
|
717
721
|
# @private
|
718
722
|
def initialize parent_config = nil
|
@@ -159,15 +159,27 @@ module Google
|
|
159
159
|
endpoint: @config.endpoint,
|
160
160
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
161
161
|
universe_domain: @config.universe_domain,
|
162
|
-
credentials: credentials
|
162
|
+
credentials: credentials,
|
163
|
+
logger: @config.logger
|
163
164
|
)
|
164
165
|
|
166
|
+
@endpoint_service_stub.logger(stub: true)&.info do |entry|
|
167
|
+
entry.set_system_name
|
168
|
+
entry.set_service
|
169
|
+
entry.message = "Created client for #{entry.service}"
|
170
|
+
entry.set_credentials_fields credentials
|
171
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
172
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
173
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
174
|
+
end
|
175
|
+
|
165
176
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
166
177
|
config.credentials = credentials
|
167
178
|
config.quota_project = @quota_project_id
|
168
179
|
config.endpoint = @endpoint_service_stub.endpoint
|
169
180
|
config.universe_domain = @endpoint_service_stub.universe_domain
|
170
181
|
config.bindings_override = @config.bindings_override
|
182
|
+
config.logger = @endpoint_service_stub.logger if config.respond_to? :logger=
|
171
183
|
end
|
172
184
|
|
173
185
|
@iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
|
@@ -176,6 +188,7 @@ module Google
|
|
176
188
|
config.endpoint = @endpoint_service_stub.endpoint
|
177
189
|
config.universe_domain = @endpoint_service_stub.universe_domain
|
178
190
|
config.bindings_override = @config.bindings_override
|
191
|
+
config.logger = @endpoint_service_stub.logger if config.respond_to? :logger=
|
179
192
|
end
|
180
193
|
end
|
181
194
|
|
@@ -200,6 +213,15 @@ module Google
|
|
200
213
|
#
|
201
214
|
attr_reader :iam_policy_client
|
202
215
|
|
216
|
+
##
|
217
|
+
# The logger used for request/response debug logging.
|
218
|
+
#
|
219
|
+
# @return [Logger]
|
220
|
+
#
|
221
|
+
def logger
|
222
|
+
@endpoint_service_stub.logger
|
223
|
+
end
|
224
|
+
|
203
225
|
# Service calls
|
204
226
|
|
205
227
|
##
|
@@ -301,7 +323,7 @@ module Google
|
|
301
323
|
@endpoint_service_stub.create_endpoint request, options do |result, operation|
|
302
324
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
303
325
|
yield result, operation if block_given?
|
304
|
-
|
326
|
+
throw :response, result
|
305
327
|
end
|
306
328
|
rescue ::Gapic::Rest::Error => e
|
307
329
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -382,7 +404,6 @@ module Google
|
|
382
404
|
|
383
405
|
@endpoint_service_stub.get_endpoint request, options do |result, operation|
|
384
406
|
yield result, operation if block_given?
|
385
|
-
return result
|
386
407
|
end
|
387
408
|
rescue ::Gapic::Rest::Error => e
|
388
409
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -508,7 +529,7 @@ module Google
|
|
508
529
|
@endpoint_service_stub.list_endpoints request, options do |result, operation|
|
509
530
|
result = ::Gapic::Rest::PagedEnumerable.new @endpoint_service_stub, :list_endpoints, "endpoints", request, result, options
|
510
531
|
yield result, operation if block_given?
|
511
|
-
|
532
|
+
throw :response, result
|
512
533
|
end
|
513
534
|
rescue ::Gapic::Rest::Error => e
|
514
535
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -590,7 +611,6 @@ module Google
|
|
590
611
|
|
591
612
|
@endpoint_service_stub.update_endpoint request, options do |result, operation|
|
592
613
|
yield result, operation if block_given?
|
593
|
-
return result
|
594
614
|
end
|
595
615
|
rescue ::Gapic::Rest::Error => e
|
596
616
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -679,7 +699,7 @@ module Google
|
|
679
699
|
@endpoint_service_stub.update_endpoint_long_running request, options do |result, operation|
|
680
700
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
681
701
|
yield result, operation if block_given?
|
682
|
-
|
702
|
+
throw :response, result
|
683
703
|
end
|
684
704
|
rescue ::Gapic::Rest::Error => e
|
685
705
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -768,7 +788,7 @@ module Google
|
|
768
788
|
@endpoint_service_stub.delete_endpoint request, options do |result, operation|
|
769
789
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
770
790
|
yield result, operation if block_given?
|
771
|
-
|
791
|
+
throw :response, result
|
772
792
|
end
|
773
793
|
rescue ::Gapic::Rest::Error => e
|
774
794
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -877,7 +897,7 @@ module Google
|
|
877
897
|
@endpoint_service_stub.deploy_model request, options do |result, operation|
|
878
898
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
879
899
|
yield result, operation if block_given?
|
880
|
-
|
900
|
+
throw :response, result
|
881
901
|
end
|
882
902
|
rescue ::Gapic::Rest::Error => e
|
883
903
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -977,7 +997,7 @@ module Google
|
|
977
997
|
@endpoint_service_stub.undeploy_model request, options do |result, operation|
|
978
998
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
979
999
|
yield result, operation if block_given?
|
980
|
-
|
1000
|
+
throw :response, result
|
981
1001
|
end
|
982
1002
|
rescue ::Gapic::Rest::Error => e
|
983
1003
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1085,7 +1105,7 @@ module Google
|
|
1085
1105
|
@endpoint_service_stub.mutate_deployed_model request, options do |result, operation|
|
1086
1106
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1087
1107
|
yield result, operation if block_given?
|
1088
|
-
|
1108
|
+
throw :response, result
|
1089
1109
|
end
|
1090
1110
|
rescue ::Gapic::Rest::Error => e
|
1091
1111
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1165,6 +1185,11 @@ module Google
|
|
1165
1185
|
# default endpoint URL. The default value of nil uses the environment
|
1166
1186
|
# universe (usually the default "googleapis.com" universe).
|
1167
1187
|
# @return [::String,nil]
|
1188
|
+
# @!attribute [rw] logger
|
1189
|
+
# A custom logger to use for request/response debug logging, or the value
|
1190
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1191
|
+
# explicitly disable logging.
|
1192
|
+
# @return [::Logger,:default,nil]
|
1168
1193
|
#
|
1169
1194
|
class Configuration
|
1170
1195
|
extend ::Gapic::Config
|
@@ -1193,6 +1218,7 @@ module Google
|
|
1193
1218
|
# by the host service.
|
1194
1219
|
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
1195
1220
|
config_attr :bindings_override, {}, ::Hash, nil
|
1221
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1196
1222
|
|
1197
1223
|
# @private
|
1198
1224
|
def initialize parent_config = nil
|
@@ -196,7 +196,7 @@ module Google
|
|
196
196
|
@operations_stub.list_operations request, options do |result, operation|
|
197
197
|
result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
|
198
198
|
yield result, operation if block_given?
|
199
|
-
|
199
|
+
throw :response, result
|
200
200
|
end
|
201
201
|
rescue ::Gapic::Rest::Error => e
|
202
202
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -285,7 +285,7 @@ module Google
|
|
285
285
|
@operations_stub.get_operation request, options do |result, operation|
|
286
286
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
287
287
|
yield result, operation if block_given?
|
288
|
-
|
288
|
+
throw :response, result
|
289
289
|
end
|
290
290
|
rescue ::Gapic::Rest::Error => e
|
291
291
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -367,7 +367,6 @@ module Google
|
|
367
367
|
|
368
368
|
@operations_stub.delete_operation request, options do |result, operation|
|
369
369
|
yield result, operation if block_given?
|
370
|
-
return result
|
371
370
|
end
|
372
371
|
rescue ::Gapic::Rest::Error => e
|
373
372
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -456,7 +455,6 @@ module Google
|
|
456
455
|
|
457
456
|
@operations_stub.cancel_operation request, options do |result, operation|
|
458
457
|
yield result, operation if block_given?
|
459
|
-
return result
|
460
458
|
end
|
461
459
|
rescue ::Gapic::Rest::Error => e
|
462
460
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -555,7 +553,7 @@ module Google
|
|
555
553
|
@operations_stub.wait_operation request, options do |result, operation|
|
556
554
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
557
555
|
yield result, operation if block_given?
|
558
|
-
|
556
|
+
throw :response, result
|
559
557
|
end
|
560
558
|
rescue ::Gapic::Rest::Error => e
|
561
559
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -635,6 +633,11 @@ module Google
|
|
635
633
|
# default endpoint URL. The default value of nil uses the environment
|
636
634
|
# universe (usually the default "googleapis.com" universe).
|
637
635
|
# @return [::String,nil]
|
636
|
+
# @!attribute [rw] logger
|
637
|
+
# A custom logger to use for request/response debug logging, or the value
|
638
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
639
|
+
# explicitly disable logging.
|
640
|
+
# @return [::Logger,:default,nil]
|
638
641
|
#
|
639
642
|
class Configuration
|
640
643
|
extend ::Gapic::Config
|
@@ -656,6 +659,7 @@ module Google
|
|
656
659
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
657
660
|
config_attr :quota_project, nil, ::String, nil
|
658
661
|
config_attr :universe_domain, nil, ::String, nil
|
662
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
659
663
|
|
660
664
|
# @private
|
661
665
|
def initialize parent_config = nil
|
@@ -782,16 +786,18 @@ module Google
|
|
782
786
|
|
783
787
|
response = @client_stub.make_http_request(
|
784
788
|
verb,
|
785
|
-
uri:
|
786
|
-
body:
|
787
|
-
params:
|
789
|
+
uri: uri,
|
790
|
+
body: body || "",
|
791
|
+
params: query_string_params,
|
792
|
+
method_name: "list_operations",
|
788
793
|
options: options
|
789
794
|
)
|
790
795
|
operation = ::Gapic::Rest::TransportOperation.new response
|
791
796
|
result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
|
792
|
-
|
793
|
-
|
794
|
-
|
797
|
+
catch :response do
|
798
|
+
yield result, operation if block_given?
|
799
|
+
result
|
800
|
+
end
|
795
801
|
end
|
796
802
|
|
797
803
|
##
|
@@ -820,16 +826,18 @@ module Google
|
|
820
826
|
|
821
827
|
response = @client_stub.make_http_request(
|
822
828
|
verb,
|
823
|
-
uri:
|
824
|
-
body:
|
825
|
-
params:
|
829
|
+
uri: uri,
|
830
|
+
body: body || "",
|
831
|
+
params: query_string_params,
|
832
|
+
method_name: "get_operation",
|
826
833
|
options: options
|
827
834
|
)
|
828
835
|
operation = ::Gapic::Rest::TransportOperation.new response
|
829
836
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
830
|
-
|
831
|
-
|
832
|
-
|
837
|
+
catch :response do
|
838
|
+
yield result, operation if block_given?
|
839
|
+
result
|
840
|
+
end
|
833
841
|
end
|
834
842
|
|
835
843
|
##
|
@@ -858,16 +866,18 @@ module Google
|
|
858
866
|
|
859
867
|
response = @client_stub.make_http_request(
|
860
868
|
verb,
|
861
|
-
uri:
|
862
|
-
body:
|
863
|
-
params:
|
869
|
+
uri: uri,
|
870
|
+
body: body || "",
|
871
|
+
params: query_string_params,
|
872
|
+
method_name: "delete_operation",
|
864
873
|
options: options
|
865
874
|
)
|
866
875
|
operation = ::Gapic::Rest::TransportOperation.new response
|
867
876
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
868
|
-
|
869
|
-
|
870
|
-
|
877
|
+
catch :response do
|
878
|
+
yield result, operation if block_given?
|
879
|
+
result
|
880
|
+
end
|
871
881
|
end
|
872
882
|
|
873
883
|
##
|
@@ -896,16 +906,18 @@ module Google
|
|
896
906
|
|
897
907
|
response = @client_stub.make_http_request(
|
898
908
|
verb,
|
899
|
-
uri:
|
900
|
-
body:
|
901
|
-
params:
|
909
|
+
uri: uri,
|
910
|
+
body: body || "",
|
911
|
+
params: query_string_params,
|
912
|
+
method_name: "cancel_operation",
|
902
913
|
options: options
|
903
914
|
)
|
904
915
|
operation = ::Gapic::Rest::TransportOperation.new response
|
905
916
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
906
|
-
|
907
|
-
|
908
|
-
|
917
|
+
catch :response do
|
918
|
+
yield result, operation if block_given?
|
919
|
+
result
|
920
|
+
end
|
909
921
|
end
|
910
922
|
|
911
923
|
##
|
@@ -934,16 +946,18 @@ module Google
|
|
934
946
|
|
935
947
|
response = @client_stub.make_http_request(
|
936
948
|
verb,
|
937
|
-
uri:
|
938
|
-
body:
|
939
|
-
params:
|
949
|
+
uri: uri,
|
950
|
+
body: body || "",
|
951
|
+
params: query_string_params,
|
952
|
+
method_name: "wait_operation",
|
940
953
|
options: options
|
941
954
|
)
|
942
955
|
operation = ::Gapic::Rest::TransportOperation.new response
|
943
956
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
944
|
-
|
945
|
-
|
946
|
-
|
957
|
+
catch :response do
|
958
|
+
yield result, operation if block_given?
|
959
|
+
result
|
960
|
+
end
|
947
961
|
end
|
948
962
|
|
949
963
|
##
|