google-cloud-gke_recommender-v1 0.a → 0.1.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.
@@ -0,0 +1,1008 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 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/gkerecommender/v1/gkerecommender_pb"
21
+ require "google/cloud/gke_recommender/v1/gke_inference_quickstart/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module GkeRecommender
26
+ module V1
27
+ module GkeInferenceQuickstart
28
+ module Rest
29
+ ##
30
+ # REST client for the GkeInferenceQuickstart service.
31
+ #
32
+ # GKE Inference Quickstart (GIQ) service provides profiles with performance
33
+ # metrics for popular models and model servers across multiple accelerators.
34
+ # These profiles help generate optimized best practices for running inference
35
+ # on GKE.
36
+ #
37
+ class Client
38
+ # @private
39
+ API_VERSION = ""
40
+
41
+ # @private
42
+ DEFAULT_ENDPOINT_TEMPLATE = "gkerecommender.$UNIVERSE_DOMAIN$"
43
+
44
+ # @private
45
+ attr_reader :gke_inference_quickstart_stub
46
+
47
+ ##
48
+ # Configure the GkeInferenceQuickstart Client class.
49
+ #
50
+ # See {::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client::Configuration}
51
+ # for a description of the configuration fields.
52
+ #
53
+ # @example
54
+ #
55
+ # # Modify the configuration for all GkeInferenceQuickstart clients
56
+ # ::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client.configure do |config|
57
+ # config.timeout = 10.0
58
+ # end
59
+ #
60
+ # @yield [config] Configure the Client client.
61
+ # @yieldparam config [Client::Configuration]
62
+ #
63
+ # @return [Client::Configuration]
64
+ #
65
+ def self.configure
66
+ @configure ||= begin
67
+ namespace = ["Google", "Cloud", "GkeRecommender", "V1"]
68
+ parent_config = while namespace.any?
69
+ parent_name = namespace.join "::"
70
+ parent_const = const_get parent_name
71
+ break parent_const.configure if parent_const.respond_to? :configure
72
+ namespace.pop
73
+ end
74
+ default_config = Client::Configuration.new parent_config
75
+
76
+ default_config.rpcs.fetch_models.timeout = 60.0
77
+
78
+ default_config.rpcs.fetch_model_servers.timeout = 60.0
79
+
80
+ default_config.rpcs.fetch_model_server_versions.timeout = 60.0
81
+
82
+ default_config.rpcs.fetch_profiles.timeout = 60.0
83
+
84
+ default_config.rpcs.generate_optimized_manifest.timeout = 60.0
85
+
86
+ default_config.rpcs.fetch_benchmarking_data.timeout = 60.0
87
+
88
+ default_config
89
+ end
90
+ yield @configure if block_given?
91
+ @configure
92
+ end
93
+
94
+ ##
95
+ # Configure the GkeInferenceQuickstart Client instance.
96
+ #
97
+ # The configuration is set to the derived mode, meaning that values can be changed,
98
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
99
+ # should be made on {Client.configure}.
100
+ #
101
+ # See {::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client::Configuration}
102
+ # for a description of the configuration fields.
103
+ #
104
+ # @yield [config] Configure the Client client.
105
+ # @yieldparam config [Client::Configuration]
106
+ #
107
+ # @return [Client::Configuration]
108
+ #
109
+ def configure
110
+ yield @config if block_given?
111
+ @config
112
+ end
113
+
114
+ ##
115
+ # The effective universe domain
116
+ #
117
+ # @return [String]
118
+ #
119
+ def universe_domain
120
+ @gke_inference_quickstart_stub.universe_domain
121
+ end
122
+
123
+ ##
124
+ # Create a new GkeInferenceQuickstart REST client object.
125
+ #
126
+ # @example
127
+ #
128
+ # # Create a client using the default configuration
129
+ # client = ::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client.new
130
+ #
131
+ # # Create a client using a custom configuration
132
+ # client = ::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client.new do |config|
133
+ # config.timeout = 10.0
134
+ # end
135
+ #
136
+ # @yield [config] Configure the GkeInferenceQuickstart client.
137
+ # @yieldparam config [Client::Configuration]
138
+ #
139
+ def initialize
140
+ # Create the configuration object
141
+ @config = Configuration.new Client.configure
142
+
143
+ # Yield the configuration if needed
144
+ yield @config if block_given?
145
+
146
+ # Create credentials
147
+ credentials = @config.credentials
148
+ # Use self-signed JWT if the endpoint is unchanged from default,
149
+ # but only if the default endpoint does not have a region prefix.
150
+ enable_self_signed_jwt = @config.endpoint.nil? ||
151
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
152
+ !@config.endpoint.split(".").first.include?("-"))
153
+ credentials ||= Credentials.default scope: @config.scope,
154
+ enable_self_signed_jwt: enable_self_signed_jwt
155
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
156
+ credentials = Credentials.new credentials, scope: @config.scope
157
+ end
158
+
159
+ @quota_project_id = @config.quota_project
160
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
161
+
162
+ @gke_inference_quickstart_stub = ::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::ServiceStub.new(
163
+ endpoint: @config.endpoint,
164
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
165
+ universe_domain: @config.universe_domain,
166
+ credentials: credentials,
167
+ logger: @config.logger
168
+ )
169
+
170
+ @gke_inference_quickstart_stub.logger(stub: true)&.info do |entry|
171
+ entry.set_system_name
172
+ entry.set_service
173
+ entry.message = "Created client for #{entry.service}"
174
+ entry.set_credentials_fields credentials
175
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
176
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
177
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
178
+ end
179
+ end
180
+
181
+ ##
182
+ # The logger used for request/response debug logging.
183
+ #
184
+ # @return [Logger]
185
+ #
186
+ def logger
187
+ @gke_inference_quickstart_stub.logger
188
+ end
189
+
190
+ # Service calls
191
+
192
+ ##
193
+ # Fetches available models. Open-source models follow the Huggingface Hub
194
+ # `owner/model_name` format.
195
+ #
196
+ # @overload fetch_models(request, options = nil)
197
+ # Pass arguments to `fetch_models` via a request object, either of type
198
+ # {::Google::Cloud::GkeRecommender::V1::FetchModelsRequest} or an equivalent Hash.
199
+ #
200
+ # @param request [::Google::Cloud::GkeRecommender::V1::FetchModelsRequest, ::Hash]
201
+ # A request object representing the call parameters. Required. To specify no
202
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
203
+ # @param options [::Gapic::CallOptions, ::Hash]
204
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
205
+ #
206
+ # @overload fetch_models(page_size: nil, page_token: nil)
207
+ # Pass arguments to `fetch_models` via keyword arguments. Note that at
208
+ # least one keyword argument is required. To specify no parameters, or to keep all
209
+ # the default parameter values, pass an empty Hash as a request object (see above).
210
+ #
211
+ # @param page_size [::Integer]
212
+ # Optional. The target number of results to return in a single response.
213
+ # If not specified, a default value will be chosen by the service.
214
+ # Note that the response may include a partial list and a caller should
215
+ # only rely on the response's
216
+ # {::Google::Cloud::GkeRecommender::V1::FetchModelsResponse#next_page_token next_page_token}
217
+ # to determine if there are more instances left to be queried.
218
+ # @param page_token [::String]
219
+ # Optional. The value of
220
+ # {::Google::Cloud::GkeRecommender::V1::FetchModelsResponse#next_page_token next_page_token}
221
+ # received from a previous `FetchModelsRequest` call.
222
+ # Provide this to retrieve the subsequent page in a multi-page list of
223
+ # results. When paginating, all other parameters provided to
224
+ # `FetchModelsRequest` must match the call that provided the page token.
225
+ # @yield [result, operation] Access the result along with the TransportOperation object
226
+ # @yieldparam result [::Google::Cloud::GkeRecommender::V1::FetchModelsResponse]
227
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
228
+ #
229
+ # @return [::Google::Cloud::GkeRecommender::V1::FetchModelsResponse]
230
+ #
231
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
232
+ #
233
+ # @example Basic example
234
+ # require "google/cloud/gke_recommender/v1"
235
+ #
236
+ # # Create a client object. The client can be reused for multiple calls.
237
+ # client = Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client.new
238
+ #
239
+ # # Create a request. To set request fields, pass in keyword arguments.
240
+ # request = Google::Cloud::GkeRecommender::V1::FetchModelsRequest.new
241
+ #
242
+ # # Call the fetch_models method.
243
+ # result = client.fetch_models request
244
+ #
245
+ # # The returned object is of type Google::Cloud::GkeRecommender::V1::FetchModelsResponse.
246
+ # p result
247
+ #
248
+ def fetch_models request, options = nil
249
+ raise ::ArgumentError, "request must be provided" if request.nil?
250
+
251
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeRecommender::V1::FetchModelsRequest
252
+
253
+ # Converts hash and nil to an options object
254
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
255
+
256
+ # Customize the options with defaults
257
+ call_metadata = @config.rpcs.fetch_models.metadata.to_h
258
+
259
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
260
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
261
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
262
+ gapic_version: ::Google::Cloud::GkeRecommender::V1::VERSION,
263
+ transports_version_send: [:rest]
264
+
265
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
266
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
267
+
268
+ options.apply_defaults timeout: @config.rpcs.fetch_models.timeout,
269
+ metadata: call_metadata,
270
+ retry_policy: @config.rpcs.fetch_models.retry_policy
271
+
272
+ options.apply_defaults timeout: @config.timeout,
273
+ metadata: @config.metadata,
274
+ retry_policy: @config.retry_policy
275
+
276
+ @gke_inference_quickstart_stub.fetch_models request, options do |result, operation|
277
+ yield result, operation if block_given?
278
+ end
279
+ rescue ::Gapic::Rest::Error => e
280
+ raise ::Google::Cloud::Error.from_error(e)
281
+ end
282
+
283
+ ##
284
+ # Fetches available model servers. Open-source model servers use simplified,
285
+ # lowercase names (e.g., `vllm`).
286
+ #
287
+ # @overload fetch_model_servers(request, options = nil)
288
+ # Pass arguments to `fetch_model_servers` via a request object, either of type
289
+ # {::Google::Cloud::GkeRecommender::V1::FetchModelServersRequest} or an equivalent Hash.
290
+ #
291
+ # @param request [::Google::Cloud::GkeRecommender::V1::FetchModelServersRequest, ::Hash]
292
+ # A request object representing the call parameters. Required. To specify no
293
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
294
+ # @param options [::Gapic::CallOptions, ::Hash]
295
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
296
+ #
297
+ # @overload fetch_model_servers(model: nil, page_size: nil, page_token: nil)
298
+ # Pass arguments to `fetch_model_servers` via keyword arguments. Note that at
299
+ # least one keyword argument is required. To specify no parameters, or to keep all
300
+ # the default parameter values, pass an empty Hash as a request object (see above).
301
+ #
302
+ # @param model [::String]
303
+ # Required. The model for which to list model servers. Open-source models
304
+ # follow the Huggingface Hub `owner/model_name` format. Use
305
+ # {::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client#fetch_models GkeInferenceQuickstart.FetchModels}
306
+ # to find available models.
307
+ # @param page_size [::Integer]
308
+ # Optional. The target number of results to return in a single response.
309
+ # If not specified, a default value will be chosen by the service.
310
+ # Note that the response may include a partial list and a caller should
311
+ # only rely on the response's
312
+ # {::Google::Cloud::GkeRecommender::V1::FetchModelServersResponse#next_page_token next_page_token}
313
+ # to determine if there are more instances left to be queried.
314
+ # @param page_token [::String]
315
+ # Optional. The value of
316
+ # {::Google::Cloud::GkeRecommender::V1::FetchModelServersResponse#next_page_token next_page_token}
317
+ # received from a previous `FetchModelServersRequest` call.
318
+ # Provide this to retrieve the subsequent page in a multi-page list of
319
+ # results. When paginating, all other parameters provided to
320
+ # `FetchModelServersRequest` must match the call that provided the page
321
+ # token.
322
+ # @yield [result, operation] Access the result along with the TransportOperation object
323
+ # @yieldparam result [::Google::Cloud::GkeRecommender::V1::FetchModelServersResponse]
324
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
325
+ #
326
+ # @return [::Google::Cloud::GkeRecommender::V1::FetchModelServersResponse]
327
+ #
328
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
329
+ #
330
+ # @example Basic example
331
+ # require "google/cloud/gke_recommender/v1"
332
+ #
333
+ # # Create a client object. The client can be reused for multiple calls.
334
+ # client = Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client.new
335
+ #
336
+ # # Create a request. To set request fields, pass in keyword arguments.
337
+ # request = Google::Cloud::GkeRecommender::V1::FetchModelServersRequest.new
338
+ #
339
+ # # Call the fetch_model_servers method.
340
+ # result = client.fetch_model_servers request
341
+ #
342
+ # # The returned object is of type Google::Cloud::GkeRecommender::V1::FetchModelServersResponse.
343
+ # p result
344
+ #
345
+ def fetch_model_servers request, options = nil
346
+ raise ::ArgumentError, "request must be provided" if request.nil?
347
+
348
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeRecommender::V1::FetchModelServersRequest
349
+
350
+ # Converts hash and nil to an options object
351
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
352
+
353
+ # Customize the options with defaults
354
+ call_metadata = @config.rpcs.fetch_model_servers.metadata.to_h
355
+
356
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
357
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
358
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
359
+ gapic_version: ::Google::Cloud::GkeRecommender::V1::VERSION,
360
+ transports_version_send: [:rest]
361
+
362
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
363
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
364
+
365
+ options.apply_defaults timeout: @config.rpcs.fetch_model_servers.timeout,
366
+ metadata: call_metadata,
367
+ retry_policy: @config.rpcs.fetch_model_servers.retry_policy
368
+
369
+ options.apply_defaults timeout: @config.timeout,
370
+ metadata: @config.metadata,
371
+ retry_policy: @config.retry_policy
372
+
373
+ @gke_inference_quickstart_stub.fetch_model_servers request, options do |result, operation|
374
+ yield result, operation if block_given?
375
+ end
376
+ rescue ::Gapic::Rest::Error => e
377
+ raise ::Google::Cloud::Error.from_error(e)
378
+ end
379
+
380
+ ##
381
+ # Fetches available model server versions. Open-source servers use their own
382
+ # versioning schemas (e.g., `vllm` uses semver like `v1.0.0`).
383
+ #
384
+ # Some model servers have different versioning schemas depending on the
385
+ # accelerator. For example, `vllm` uses semver on GPUs, but returns nightly
386
+ # build tags on TPUs. All available versions will be returned when different
387
+ # schemas are present.
388
+ #
389
+ # @overload fetch_model_server_versions(request, options = nil)
390
+ # Pass arguments to `fetch_model_server_versions` via a request object, either of type
391
+ # {::Google::Cloud::GkeRecommender::V1::FetchModelServerVersionsRequest} or an equivalent Hash.
392
+ #
393
+ # @param request [::Google::Cloud::GkeRecommender::V1::FetchModelServerVersionsRequest, ::Hash]
394
+ # A request object representing the call parameters. Required. To specify no
395
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
396
+ # @param options [::Gapic::CallOptions, ::Hash]
397
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
398
+ #
399
+ # @overload fetch_model_server_versions(model: nil, model_server: nil, page_size: nil, page_token: nil)
400
+ # Pass arguments to `fetch_model_server_versions` via keyword arguments. Note that at
401
+ # least one keyword argument is required. To specify no parameters, or to keep all
402
+ # the default parameter values, pass an empty Hash as a request object (see above).
403
+ #
404
+ # @param model [::String]
405
+ # Required. The model for which to list model server versions. Open-source
406
+ # models follow the Huggingface Hub `owner/model_name` format. Use
407
+ # {::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client#fetch_models GkeInferenceQuickstart.FetchModels}
408
+ # to find available models.
409
+ # @param model_server [::String]
410
+ # Required. The model server for which to list versions. Open-source model
411
+ # servers use simplified, lowercase names (e.g., `vllm`). Use
412
+ # {::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client#fetch_model_servers GkeInferenceQuickstart.FetchModelServers}
413
+ # to find available model servers.
414
+ # @param page_size [::Integer]
415
+ # Optional. The target number of results to return in a single response.
416
+ # If not specified, a default value will be chosen by the service.
417
+ # Note that the response may include a partial list and a caller should
418
+ # only rely on the response's
419
+ # {::Google::Cloud::GkeRecommender::V1::FetchModelServerVersionsResponse#next_page_token next_page_token}
420
+ # to determine if there are more instances left to be queried.
421
+ # @param page_token [::String]
422
+ # Optional. The value of
423
+ # {::Google::Cloud::GkeRecommender::V1::FetchModelServerVersionsResponse#next_page_token next_page_token}
424
+ # received from a previous `FetchModelServerVersionsRequest` call.
425
+ # Provide this to retrieve the subsequent page in a multi-page list of
426
+ # results. When paginating, all other parameters provided to
427
+ # `FetchModelServerVersionsRequest` must match the call that provided the
428
+ # page token.
429
+ # @yield [result, operation] Access the result along with the TransportOperation object
430
+ # @yieldparam result [::Google::Cloud::GkeRecommender::V1::FetchModelServerVersionsResponse]
431
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
432
+ #
433
+ # @return [::Google::Cloud::GkeRecommender::V1::FetchModelServerVersionsResponse]
434
+ #
435
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
436
+ #
437
+ # @example Basic example
438
+ # require "google/cloud/gke_recommender/v1"
439
+ #
440
+ # # Create a client object. The client can be reused for multiple calls.
441
+ # client = Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client.new
442
+ #
443
+ # # Create a request. To set request fields, pass in keyword arguments.
444
+ # request = Google::Cloud::GkeRecommender::V1::FetchModelServerVersionsRequest.new
445
+ #
446
+ # # Call the fetch_model_server_versions method.
447
+ # result = client.fetch_model_server_versions request
448
+ #
449
+ # # The returned object is of type Google::Cloud::GkeRecommender::V1::FetchModelServerVersionsResponse.
450
+ # p result
451
+ #
452
+ def fetch_model_server_versions request, options = nil
453
+ raise ::ArgumentError, "request must be provided" if request.nil?
454
+
455
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeRecommender::V1::FetchModelServerVersionsRequest
456
+
457
+ # Converts hash and nil to an options object
458
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
459
+
460
+ # Customize the options with defaults
461
+ call_metadata = @config.rpcs.fetch_model_server_versions.metadata.to_h
462
+
463
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
464
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
465
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
466
+ gapic_version: ::Google::Cloud::GkeRecommender::V1::VERSION,
467
+ transports_version_send: [:rest]
468
+
469
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
470
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
471
+
472
+ options.apply_defaults timeout: @config.rpcs.fetch_model_server_versions.timeout,
473
+ metadata: call_metadata,
474
+ retry_policy: @config.rpcs.fetch_model_server_versions.retry_policy
475
+
476
+ options.apply_defaults timeout: @config.timeout,
477
+ metadata: @config.metadata,
478
+ retry_policy: @config.retry_policy
479
+
480
+ @gke_inference_quickstart_stub.fetch_model_server_versions request, options do |result, operation|
481
+ yield result, operation if block_given?
482
+ end
483
+ rescue ::Gapic::Rest::Error => e
484
+ raise ::Google::Cloud::Error.from_error(e)
485
+ end
486
+
487
+ ##
488
+ # Fetches available profiles. A profile contains performance metrics and
489
+ # cost information for a specific model server setup. Profiles can be
490
+ # filtered by parameters. If no filters are provided, all profiles are
491
+ # returned.
492
+ #
493
+ # Profiles display a single value per performance metric based on the
494
+ # provided performance requirements. If no requirements are given, the
495
+ # metrics represent the inflection point. See [Run best practice inference
496
+ # with GKE Inference Quickstart
497
+ # recipes](https://cloud.google.com/kubernetes-engine/docs/how-to/machine-learning/inference/inference-quickstart#how)
498
+ # for details.
499
+ #
500
+ # @overload fetch_profiles(request, options = nil)
501
+ # Pass arguments to `fetch_profiles` via a request object, either of type
502
+ # {::Google::Cloud::GkeRecommender::V1::FetchProfilesRequest} or an equivalent Hash.
503
+ #
504
+ # @param request [::Google::Cloud::GkeRecommender::V1::FetchProfilesRequest, ::Hash]
505
+ # A request object representing the call parameters. Required. To specify no
506
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
507
+ # @param options [::Gapic::CallOptions, ::Hash]
508
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
509
+ #
510
+ # @overload fetch_profiles(model: nil, model_server: nil, model_server_version: nil, performance_requirements: nil, page_size: nil, page_token: nil)
511
+ # Pass arguments to `fetch_profiles` via keyword arguments. Note that at
512
+ # least one keyword argument is required. To specify no parameters, or to keep all
513
+ # the default parameter values, pass an empty Hash as a request object (see above).
514
+ #
515
+ # @param model [::String]
516
+ # Optional. The model to filter profiles by. Open-source models follow the
517
+ # Huggingface Hub `owner/model_name` format. If not provided, all models are
518
+ # returned. Use
519
+ # {::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client#fetch_models GkeInferenceQuickstart.FetchModels}
520
+ # to find available models.
521
+ # @param model_server [::String]
522
+ # Optional. The model server to filter profiles by. If not provided, all
523
+ # model servers are returned. Use
524
+ # {::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client#fetch_model_servers GkeInferenceQuickstart.FetchModelServers}
525
+ # to find available model servers for a given model.
526
+ # @param model_server_version [::String]
527
+ # Optional. The model server version to filter profiles by. If not provided,
528
+ # all model server versions are returned. Use
529
+ # {::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client#fetch_model_server_versions GkeInferenceQuickstart.FetchModelServerVersions}
530
+ # to find available versions for a given model and server.
531
+ # @param performance_requirements [::Google::Cloud::GkeRecommender::V1::PerformanceRequirements, ::Hash]
532
+ # Optional. The performance requirements to filter profiles. Profiles that do
533
+ # not meet these requirements are filtered out. If not provided, all profiles
534
+ # are returned.
535
+ # @param page_size [::Integer]
536
+ # Optional. The target number of results to return in a single response. If
537
+ # not specified, a default value will be chosen by the service. Note that the
538
+ # response may include a partial list and a caller should only rely on the
539
+ # response's
540
+ # {::Google::Cloud::GkeRecommender::V1::FetchProfilesResponse#next_page_token next_page_token}
541
+ # to determine if there are more instances left to be queried.
542
+ # @param page_token [::String]
543
+ # Optional. The value of
544
+ # {::Google::Cloud::GkeRecommender::V1::FetchProfilesResponse#next_page_token next_page_token}
545
+ # received from a previous `FetchProfilesRequest` call.
546
+ # Provide this to retrieve the subsequent page in a multi-page list of
547
+ # results. When paginating, all other parameters provided to
548
+ # `FetchProfilesRequest` must match the call that provided the page
549
+ # token.
550
+ # @yield [result, operation] Access the result along with the TransportOperation object
551
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeRecommender::V1::Profile>]
552
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
553
+ #
554
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeRecommender::V1::Profile>]
555
+ #
556
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
557
+ #
558
+ # @example Basic example
559
+ # require "google/cloud/gke_recommender/v1"
560
+ #
561
+ # # Create a client object. The client can be reused for multiple calls.
562
+ # client = Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client.new
563
+ #
564
+ # # Create a request. To set request fields, pass in keyword arguments.
565
+ # request = Google::Cloud::GkeRecommender::V1::FetchProfilesRequest.new
566
+ #
567
+ # # Call the fetch_profiles method.
568
+ # result = client.fetch_profiles request
569
+ #
570
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
571
+ # # over elements, and API calls will be issued to fetch pages as needed.
572
+ # result.each do |item|
573
+ # # Each element is of type ::Google::Cloud::GkeRecommender::V1::Profile.
574
+ # p item
575
+ # end
576
+ #
577
+ def fetch_profiles request, options = nil
578
+ raise ::ArgumentError, "request must be provided" if request.nil?
579
+
580
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeRecommender::V1::FetchProfilesRequest
581
+
582
+ # Converts hash and nil to an options object
583
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
584
+
585
+ # Customize the options with defaults
586
+ call_metadata = @config.rpcs.fetch_profiles.metadata.to_h
587
+
588
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
589
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
590
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
591
+ gapic_version: ::Google::Cloud::GkeRecommender::V1::VERSION,
592
+ transports_version_send: [:rest]
593
+
594
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
595
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
596
+
597
+ options.apply_defaults timeout: @config.rpcs.fetch_profiles.timeout,
598
+ metadata: call_metadata,
599
+ retry_policy: @config.rpcs.fetch_profiles.retry_policy
600
+
601
+ options.apply_defaults timeout: @config.timeout,
602
+ metadata: @config.metadata,
603
+ retry_policy: @config.retry_policy
604
+
605
+ @gke_inference_quickstart_stub.fetch_profiles request, options do |result, operation|
606
+ result = ::Gapic::Rest::PagedEnumerable.new @gke_inference_quickstart_stub, :fetch_profiles, "profile", request, result, options
607
+ yield result, operation if block_given?
608
+ throw :response, result
609
+ end
610
+ rescue ::Gapic::Rest::Error => e
611
+ raise ::Google::Cloud::Error.from_error(e)
612
+ end
613
+
614
+ ##
615
+ # Generates an optimized deployment manifest for a given model and model
616
+ # server, based on the specified accelerator, performance targets, and
617
+ # configurations. See [Run best practice inference with GKE Inference
618
+ # Quickstart
619
+ # recipes](https://cloud.google.com/kubernetes-engine/docs/how-to/machine-learning/inference/inference-quickstart)
620
+ # for deployment details.
621
+ #
622
+ # @overload generate_optimized_manifest(request, options = nil)
623
+ # Pass arguments to `generate_optimized_manifest` via a request object, either of type
624
+ # {::Google::Cloud::GkeRecommender::V1::GenerateOptimizedManifestRequest} or an equivalent Hash.
625
+ #
626
+ # @param request [::Google::Cloud::GkeRecommender::V1::GenerateOptimizedManifestRequest, ::Hash]
627
+ # A request object representing the call parameters. Required. To specify no
628
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
629
+ # @param options [::Gapic::CallOptions, ::Hash]
630
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
631
+ #
632
+ # @overload generate_optimized_manifest(model_server_info: nil, accelerator_type: nil, kubernetes_namespace: nil, performance_requirements: nil, storage_config: nil)
633
+ # Pass arguments to `generate_optimized_manifest` via keyword arguments. Note that at
634
+ # least one keyword argument is required. To specify no parameters, or to keep all
635
+ # the default parameter values, pass an empty Hash as a request object (see above).
636
+ #
637
+ # @param model_server_info [::Google::Cloud::GkeRecommender::V1::ModelServerInfo, ::Hash]
638
+ # Required. The model server configuration to generate the manifest for. Use
639
+ # {::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client#fetch_profiles GkeInferenceQuickstart.FetchProfiles}
640
+ # to find valid configurations.
641
+ # @param accelerator_type [::String]
642
+ # Required. The accelerator type. Use
643
+ # {::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client#fetch_profiles GkeInferenceQuickstart.FetchProfiles}
644
+ # to find valid accelerators for a given `model_server_info`.
645
+ # @param kubernetes_namespace [::String]
646
+ # Optional. The kubernetes namespace to deploy the manifests in.
647
+ # @param performance_requirements [::Google::Cloud::GkeRecommender::V1::PerformanceRequirements, ::Hash]
648
+ # Optional. The performance requirements to use for generating Horizontal Pod
649
+ # Autoscaler (HPA) resources. If provided, the manifest includes HPA
650
+ # resources to adjust the model server replica count to maintain the
651
+ # specified targets (e.g., NTPOT, TTFT) at a P50 latency. Cost targets are
652
+ # not currently supported for HPA generation. If the specified targets are
653
+ # not achievable, the HPA manifest will not be generated.
654
+ # @param storage_config [::Google::Cloud::GkeRecommender::V1::StorageConfig, ::Hash]
655
+ # Optional. The storage configuration for the model. If not provided, the
656
+ # model is loaded from Huggingface.
657
+ # @yield [result, operation] Access the result along with the TransportOperation object
658
+ # @yieldparam result [::Google::Cloud::GkeRecommender::V1::GenerateOptimizedManifestResponse]
659
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
660
+ #
661
+ # @return [::Google::Cloud::GkeRecommender::V1::GenerateOptimizedManifestResponse]
662
+ #
663
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
664
+ #
665
+ # @example Basic example
666
+ # require "google/cloud/gke_recommender/v1"
667
+ #
668
+ # # Create a client object. The client can be reused for multiple calls.
669
+ # client = Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client.new
670
+ #
671
+ # # Create a request. To set request fields, pass in keyword arguments.
672
+ # request = Google::Cloud::GkeRecommender::V1::GenerateOptimizedManifestRequest.new
673
+ #
674
+ # # Call the generate_optimized_manifest method.
675
+ # result = client.generate_optimized_manifest request
676
+ #
677
+ # # The returned object is of type Google::Cloud::GkeRecommender::V1::GenerateOptimizedManifestResponse.
678
+ # p result
679
+ #
680
+ def generate_optimized_manifest request, options = nil
681
+ raise ::ArgumentError, "request must be provided" if request.nil?
682
+
683
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeRecommender::V1::GenerateOptimizedManifestRequest
684
+
685
+ # Converts hash and nil to an options object
686
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
687
+
688
+ # Customize the options with defaults
689
+ call_metadata = @config.rpcs.generate_optimized_manifest.metadata.to_h
690
+
691
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
692
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
693
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
694
+ gapic_version: ::Google::Cloud::GkeRecommender::V1::VERSION,
695
+ transports_version_send: [:rest]
696
+
697
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
698
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
699
+
700
+ options.apply_defaults timeout: @config.rpcs.generate_optimized_manifest.timeout,
701
+ metadata: call_metadata,
702
+ retry_policy: @config.rpcs.generate_optimized_manifest.retry_policy
703
+
704
+ options.apply_defaults timeout: @config.timeout,
705
+ metadata: @config.metadata,
706
+ retry_policy: @config.retry_policy
707
+
708
+ @gke_inference_quickstart_stub.generate_optimized_manifest request, options do |result, operation|
709
+ yield result, operation if block_given?
710
+ end
711
+ rescue ::Gapic::Rest::Error => e
712
+ raise ::Google::Cloud::Error.from_error(e)
713
+ end
714
+
715
+ ##
716
+ # Fetches all of the benchmarking data available for a profile. Benchmarking
717
+ # data returns all of the performance metrics available for a given model
718
+ # server setup on a given instance type.
719
+ #
720
+ # @overload fetch_benchmarking_data(request, options = nil)
721
+ # Pass arguments to `fetch_benchmarking_data` via a request object, either of type
722
+ # {::Google::Cloud::GkeRecommender::V1::FetchBenchmarkingDataRequest} or an equivalent Hash.
723
+ #
724
+ # @param request [::Google::Cloud::GkeRecommender::V1::FetchBenchmarkingDataRequest, ::Hash]
725
+ # A request object representing the call parameters. Required. To specify no
726
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
727
+ # @param options [::Gapic::CallOptions, ::Hash]
728
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
729
+ #
730
+ # @overload fetch_benchmarking_data(model_server_info: nil, instance_type: nil, pricing_model: nil)
731
+ # Pass arguments to `fetch_benchmarking_data` via keyword arguments. Note that at
732
+ # least one keyword argument is required. To specify no parameters, or to keep all
733
+ # the default parameter values, pass an empty Hash as a request object (see above).
734
+ #
735
+ # @param model_server_info [::Google::Cloud::GkeRecommender::V1::ModelServerInfo, ::Hash]
736
+ # Required. The model server configuration to get benchmarking data for. Use
737
+ # {::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client#fetch_profiles GkeInferenceQuickstart.FetchProfiles}
738
+ # to find valid configurations.
739
+ # @param instance_type [::String]
740
+ # Optional. The instance type to filter benchmarking data. Instance types are
741
+ # in the format `a2-highgpu-1g`. If not provided, all instance types for the
742
+ # given profile's `model_server_info` will be returned. Use
743
+ # {::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client#fetch_profiles GkeInferenceQuickstart.FetchProfiles}
744
+ # to find available instance types.
745
+ # @param pricing_model [::String]
746
+ # Optional. The pricing model to use for the benchmarking data. Defaults to
747
+ # `spot`.
748
+ # @yield [result, operation] Access the result along with the TransportOperation object
749
+ # @yieldparam result [::Google::Cloud::GkeRecommender::V1::FetchBenchmarkingDataResponse]
750
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
751
+ #
752
+ # @return [::Google::Cloud::GkeRecommender::V1::FetchBenchmarkingDataResponse]
753
+ #
754
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
755
+ #
756
+ # @example Basic example
757
+ # require "google/cloud/gke_recommender/v1"
758
+ #
759
+ # # Create a client object. The client can be reused for multiple calls.
760
+ # client = Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client.new
761
+ #
762
+ # # Create a request. To set request fields, pass in keyword arguments.
763
+ # request = Google::Cloud::GkeRecommender::V1::FetchBenchmarkingDataRequest.new
764
+ #
765
+ # # Call the fetch_benchmarking_data method.
766
+ # result = client.fetch_benchmarking_data request
767
+ #
768
+ # # The returned object is of type Google::Cloud::GkeRecommender::V1::FetchBenchmarkingDataResponse.
769
+ # p result
770
+ #
771
+ def fetch_benchmarking_data request, options = nil
772
+ raise ::ArgumentError, "request must be provided" if request.nil?
773
+
774
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeRecommender::V1::FetchBenchmarkingDataRequest
775
+
776
+ # Converts hash and nil to an options object
777
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
778
+
779
+ # Customize the options with defaults
780
+ call_metadata = @config.rpcs.fetch_benchmarking_data.metadata.to_h
781
+
782
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
783
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
784
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
785
+ gapic_version: ::Google::Cloud::GkeRecommender::V1::VERSION,
786
+ transports_version_send: [:rest]
787
+
788
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
789
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
790
+
791
+ options.apply_defaults timeout: @config.rpcs.fetch_benchmarking_data.timeout,
792
+ metadata: call_metadata,
793
+ retry_policy: @config.rpcs.fetch_benchmarking_data.retry_policy
794
+
795
+ options.apply_defaults timeout: @config.timeout,
796
+ metadata: @config.metadata,
797
+ retry_policy: @config.retry_policy
798
+
799
+ @gke_inference_quickstart_stub.fetch_benchmarking_data request, options do |result, operation|
800
+ yield result, operation if block_given?
801
+ end
802
+ rescue ::Gapic::Rest::Error => e
803
+ raise ::Google::Cloud::Error.from_error(e)
804
+ end
805
+
806
+ ##
807
+ # Configuration class for the GkeInferenceQuickstart REST API.
808
+ #
809
+ # This class represents the configuration for GkeInferenceQuickstart REST,
810
+ # providing control over timeouts, retry behavior, logging, transport
811
+ # parameters, and other low-level controls. Certain parameters can also be
812
+ # applied individually to specific RPCs. See
813
+ # {::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client::Configuration::Rpcs}
814
+ # for a list of RPCs that can be configured independently.
815
+ #
816
+ # Configuration can be applied globally to all clients, or to a single client
817
+ # on construction.
818
+ #
819
+ # @example
820
+ #
821
+ # # Modify the global config, setting the timeout for
822
+ # # fetch_models to 20 seconds,
823
+ # # and all remaining timeouts to 10 seconds.
824
+ # ::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client.configure do |config|
825
+ # config.timeout = 10.0
826
+ # config.rpcs.fetch_models.timeout = 20.0
827
+ # end
828
+ #
829
+ # # Apply the above configuration only to a new client.
830
+ # client = ::Google::Cloud::GkeRecommender::V1::GkeInferenceQuickstart::Rest::Client.new do |config|
831
+ # config.timeout = 10.0
832
+ # config.rpcs.fetch_models.timeout = 20.0
833
+ # end
834
+ #
835
+ # @!attribute [rw] endpoint
836
+ # A custom service endpoint, as a hostname or hostname:port. The default is
837
+ # nil, indicating to use the default endpoint in the current universe domain.
838
+ # @return [::String,nil]
839
+ # @!attribute [rw] credentials
840
+ # Credentials to send with calls. You may provide any of the following types:
841
+ # * (`String`) The path to a service account key file in JSON format
842
+ # * (`Hash`) A service account key as a Hash
843
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
844
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
845
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
846
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
847
+ # * (`nil`) indicating no credentials
848
+ #
849
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
850
+ # external source for authentication to Google Cloud, you must validate it before
851
+ # providing it to a Google API client library. Providing an unvalidated credential
852
+ # configuration to Google APIs can compromise the security of your systems and data.
853
+ # For more information, refer to [Validate credential configurations from external
854
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
855
+ # @return [::Object]
856
+ # @!attribute [rw] scope
857
+ # The OAuth scopes
858
+ # @return [::Array<::String>]
859
+ # @!attribute [rw] lib_name
860
+ # The library name as recorded in instrumentation and logging
861
+ # @return [::String]
862
+ # @!attribute [rw] lib_version
863
+ # The library version as recorded in instrumentation and logging
864
+ # @return [::String]
865
+ # @!attribute [rw] timeout
866
+ # The call timeout in seconds.
867
+ # @return [::Numeric]
868
+ # @!attribute [rw] metadata
869
+ # Additional headers to be sent with the call.
870
+ # @return [::Hash{::Symbol=>::String}]
871
+ # @!attribute [rw] retry_policy
872
+ # The retry policy. The value is a hash with the following keys:
873
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
874
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
875
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
876
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
877
+ # trigger a retry.
878
+ # @return [::Hash]
879
+ # @!attribute [rw] quota_project
880
+ # A separate project against which to charge quota.
881
+ # @return [::String]
882
+ # @!attribute [rw] universe_domain
883
+ # The universe domain within which to make requests. This determines the
884
+ # default endpoint URL. The default value of nil uses the environment
885
+ # universe (usually the default "googleapis.com" universe).
886
+ # @return [::String,nil]
887
+ # @!attribute [rw] logger
888
+ # A custom logger to use for request/response debug logging, or the value
889
+ # `:default` (the default) to construct a default logger, or `nil` to
890
+ # explicitly disable logging.
891
+ # @return [::Logger,:default,nil]
892
+ #
893
+ class Configuration
894
+ extend ::Gapic::Config
895
+
896
+ # @private
897
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
898
+ DEFAULT_ENDPOINT = "gkerecommender.googleapis.com"
899
+
900
+ config_attr :endpoint, nil, ::String, nil
901
+ config_attr :credentials, nil do |value|
902
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
903
+ allowed.any? { |klass| klass === value }
904
+ end
905
+ config_attr :scope, nil, ::String, ::Array, nil
906
+ config_attr :lib_name, nil, ::String, nil
907
+ config_attr :lib_version, nil, ::String, nil
908
+ config_attr :timeout, nil, ::Numeric, nil
909
+ config_attr :metadata, nil, ::Hash, nil
910
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
911
+ config_attr :quota_project, nil, ::String, nil
912
+ config_attr :universe_domain, nil, ::String, nil
913
+ config_attr :logger, :default, ::Logger, nil, :default
914
+
915
+ # @private
916
+ def initialize parent_config = nil
917
+ @parent_config = parent_config unless parent_config.nil?
918
+
919
+ yield self if block_given?
920
+ end
921
+
922
+ ##
923
+ # Configurations for individual RPCs
924
+ # @return [Rpcs]
925
+ #
926
+ def rpcs
927
+ @rpcs ||= begin
928
+ parent_rpcs = nil
929
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
930
+ Rpcs.new parent_rpcs
931
+ end
932
+ end
933
+
934
+ ##
935
+ # Configuration RPC class for the GkeInferenceQuickstart API.
936
+ #
937
+ # Includes fields providing the configuration for each RPC in this service.
938
+ # Each configuration object is of type `Gapic::Config::Method` and includes
939
+ # the following configuration fields:
940
+ #
941
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
942
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
943
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
944
+ # include the following keys:
945
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
946
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
947
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
948
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
949
+ # trigger a retry.
950
+ #
951
+ class Rpcs
952
+ ##
953
+ # RPC-specific configuration for `fetch_models`
954
+ # @return [::Gapic::Config::Method]
955
+ #
956
+ attr_reader :fetch_models
957
+ ##
958
+ # RPC-specific configuration for `fetch_model_servers`
959
+ # @return [::Gapic::Config::Method]
960
+ #
961
+ attr_reader :fetch_model_servers
962
+ ##
963
+ # RPC-specific configuration for `fetch_model_server_versions`
964
+ # @return [::Gapic::Config::Method]
965
+ #
966
+ attr_reader :fetch_model_server_versions
967
+ ##
968
+ # RPC-specific configuration for `fetch_profiles`
969
+ # @return [::Gapic::Config::Method]
970
+ #
971
+ attr_reader :fetch_profiles
972
+ ##
973
+ # RPC-specific configuration for `generate_optimized_manifest`
974
+ # @return [::Gapic::Config::Method]
975
+ #
976
+ attr_reader :generate_optimized_manifest
977
+ ##
978
+ # RPC-specific configuration for `fetch_benchmarking_data`
979
+ # @return [::Gapic::Config::Method]
980
+ #
981
+ attr_reader :fetch_benchmarking_data
982
+
983
+ # @private
984
+ def initialize parent_rpcs = nil
985
+ fetch_models_config = parent_rpcs.fetch_models if parent_rpcs.respond_to? :fetch_models
986
+ @fetch_models = ::Gapic::Config::Method.new fetch_models_config
987
+ fetch_model_servers_config = parent_rpcs.fetch_model_servers if parent_rpcs.respond_to? :fetch_model_servers
988
+ @fetch_model_servers = ::Gapic::Config::Method.new fetch_model_servers_config
989
+ fetch_model_server_versions_config = parent_rpcs.fetch_model_server_versions if parent_rpcs.respond_to? :fetch_model_server_versions
990
+ @fetch_model_server_versions = ::Gapic::Config::Method.new fetch_model_server_versions_config
991
+ fetch_profiles_config = parent_rpcs.fetch_profiles if parent_rpcs.respond_to? :fetch_profiles
992
+ @fetch_profiles = ::Gapic::Config::Method.new fetch_profiles_config
993
+ generate_optimized_manifest_config = parent_rpcs.generate_optimized_manifest if parent_rpcs.respond_to? :generate_optimized_manifest
994
+ @generate_optimized_manifest = ::Gapic::Config::Method.new generate_optimized_manifest_config
995
+ fetch_benchmarking_data_config = parent_rpcs.fetch_benchmarking_data if parent_rpcs.respond_to? :fetch_benchmarking_data
996
+ @fetch_benchmarking_data = ::Gapic::Config::Method.new fetch_benchmarking_data_config
997
+
998
+ yield self if block_given?
999
+ end
1000
+ end
1001
+ end
1002
+ end
1003
+ end
1004
+ end
1005
+ end
1006
+ end
1007
+ end
1008
+ end