google-cloud-database_center-v1beta 0.a → 0.2.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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +154 -8
  5. data/lib/google/cloud/database_center/v1beta/database_center/client.rb +956 -0
  6. data/lib/google/cloud/database_center/v1beta/database_center/credentials.rb +47 -0
  7. data/lib/google/cloud/database_center/v1beta/database_center/rest/client.rb +917 -0
  8. data/lib/google/cloud/database_center/v1beta/database_center/rest/service_stub.rb +319 -0
  9. data/lib/google/cloud/database_center/v1beta/database_center/rest.rb +51 -0
  10. data/lib/google/cloud/database_center/v1beta/database_center.rb +54 -0
  11. data/lib/google/cloud/database_center/v1beta/rest.rb +37 -0
  12. data/lib/google/cloud/database_center/v1beta/version.rb +8 -3
  13. data/lib/google/cloud/database_center/v1beta.rb +45 -0
  14. data/lib/google/cloud/databasecenter/v1beta/machine_config_pb.rb +44 -0
  15. data/lib/google/cloud/databasecenter/v1beta/maintenance_pb.rb +52 -0
  16. data/lib/google/cloud/databasecenter/v1beta/metric_data_pb.rb +47 -0
  17. data/lib/google/cloud/databasecenter/v1beta/operation_error_type_pb.rb +42 -0
  18. data/lib/google/cloud/databasecenter/v1beta/product_pb.rb +46 -0
  19. data/lib/google/cloud/databasecenter/v1beta/service_pb.rb +80 -0
  20. data/lib/google/cloud/databasecenter/v1beta/service_services_pb.rb +53 -0
  21. data/lib/google/cloud/databasecenter/v1beta/signals_pb.rb +78 -0
  22. data/lib/google/cloud/databasecenter/v1beta/suspension_reason_pb.rb +42 -0
  23. data/lib/google-cloud-database_center-v1beta.rb +21 -0
  24. data/proto_docs/README.md +4 -0
  25. data/proto_docs/google/api/client.rb +473 -0
  26. data/proto_docs/google/api/field_behavior.rb +85 -0
  27. data/proto_docs/google/api/launch_stage.rb +71 -0
  28. data/proto_docs/google/api/resource.rb +227 -0
  29. data/proto_docs/google/cloud/databasecenter/v1beta/machine_config.rb +42 -0
  30. data/proto_docs/google/cloud/databasecenter/v1beta/maintenance.rb +105 -0
  31. data/proto_docs/google/cloud/databasecenter/v1beta/metric_data.rb +92 -0
  32. data/proto_docs/google/cloud/databasecenter/v1beta/operation_error_type.rb +53 -0
  33. data/proto_docs/google/cloud/databasecenter/v1beta/product.rb +132 -0
  34. data/proto_docs/google/cloud/databasecenter/v1beta/service.rb +823 -0
  35. data/proto_docs/google/cloud/databasecenter/v1beta/signals.rb +848 -0
  36. data/proto_docs/google/cloud/databasecenter/v1beta/suspension_reason.rb +50 -0
  37. data/proto_docs/google/protobuf/duration.rb +98 -0
  38. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  39. data/proto_docs/google/protobuf/wrappers.rb +121 -0
  40. data/proto_docs/google/type/date.rb +53 -0
  41. data/proto_docs/google/type/dayofweek.rb +49 -0
  42. data/proto_docs/google/type/timeofday.rb +45 -0
  43. metadata +82 -9
@@ -0,0 +1,917 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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/databasecenter/v1beta/service_pb"
21
+ require "google/cloud/database_center/v1beta/database_center/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module DatabaseCenter
26
+ module V1beta
27
+ module DatabaseCenter
28
+ module Rest
29
+ ##
30
+ # REST client for the DatabaseCenter service.
31
+ #
32
+ # DatabaseCenter contains methods to query fleet view for database resources.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "databasecenter.$UNIVERSE_DOMAIN$"
40
+
41
+ # @private
42
+ attr_reader :database_center_stub
43
+
44
+ ##
45
+ # Configure the DatabaseCenter Client class.
46
+ #
47
+ # See {::Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Rest::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all DatabaseCenter clients
53
+ # ::Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Rest::Client.configure do |config|
54
+ # config.timeout = 10.0
55
+ # end
56
+ #
57
+ # @yield [config] Configure the Client client.
58
+ # @yieldparam config [Client::Configuration]
59
+ #
60
+ # @return [Client::Configuration]
61
+ #
62
+ def self.configure
63
+ @configure ||= begin
64
+ namespace = ["Google", "Cloud", "DatabaseCenter", "V1beta"]
65
+ parent_config = while namespace.any?
66
+ parent_name = namespace.join "::"
67
+ parent_const = const_get parent_name
68
+ break parent_const.configure if parent_const.respond_to? :configure
69
+ namespace.pop
70
+ end
71
+ default_config = Client::Configuration.new parent_config
72
+
73
+ default_config
74
+ end
75
+ yield @configure if block_given?
76
+ @configure
77
+ end
78
+
79
+ ##
80
+ # Configure the DatabaseCenter Client instance.
81
+ #
82
+ # The configuration is set to the derived mode, meaning that values can be changed,
83
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
84
+ # should be made on {Client.configure}.
85
+ #
86
+ # See {::Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Rest::Client::Configuration}
87
+ # for a description of the configuration fields.
88
+ #
89
+ # @yield [config] Configure the Client client.
90
+ # @yieldparam config [Client::Configuration]
91
+ #
92
+ # @return [Client::Configuration]
93
+ #
94
+ def configure
95
+ yield @config if block_given?
96
+ @config
97
+ end
98
+
99
+ ##
100
+ # The effective universe domain
101
+ #
102
+ # @return [String]
103
+ #
104
+ def universe_domain
105
+ @database_center_stub.universe_domain
106
+ end
107
+
108
+ ##
109
+ # Create a new DatabaseCenter REST client object.
110
+ #
111
+ # @example
112
+ #
113
+ # # Create a client using the default configuration
114
+ # client = ::Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Rest::Client.new
115
+ #
116
+ # # Create a client using a custom configuration
117
+ # client = ::Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Rest::Client.new do |config|
118
+ # config.timeout = 10.0
119
+ # end
120
+ #
121
+ # @yield [config] Configure the DatabaseCenter client.
122
+ # @yieldparam config [Client::Configuration]
123
+ #
124
+ def initialize
125
+ # Create the configuration object
126
+ @config = Configuration.new Client.configure
127
+
128
+ # Yield the configuration if needed
129
+ yield @config if block_given?
130
+
131
+ # Create credentials
132
+ credentials = @config.credentials
133
+ # Use self-signed JWT if the endpoint is unchanged from default,
134
+ # but only if the default endpoint does not have a region prefix.
135
+ enable_self_signed_jwt = @config.endpoint.nil? ||
136
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
137
+ !@config.endpoint.split(".").first.include?("-"))
138
+ credentials ||= Credentials.default scope: @config.scope,
139
+ enable_self_signed_jwt: enable_self_signed_jwt
140
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
141
+ credentials = Credentials.new credentials, scope: @config.scope
142
+ end
143
+
144
+ @quota_project_id = @config.quota_project
145
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
146
+
147
+ @database_center_stub = ::Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Rest::ServiceStub.new(
148
+ endpoint: @config.endpoint,
149
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
150
+ universe_domain: @config.universe_domain,
151
+ credentials: credentials,
152
+ logger: @config.logger
153
+ )
154
+
155
+ @database_center_stub.logger(stub: true)&.info do |entry|
156
+ entry.set_system_name
157
+ entry.set_service
158
+ entry.message = "Created client for #{entry.service}"
159
+ entry.set_credentials_fields credentials
160
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
161
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
162
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
163
+ end
164
+ end
165
+
166
+ ##
167
+ # The logger used for request/response debug logging.
168
+ #
169
+ # @return [Logger]
170
+ #
171
+ def logger
172
+ @database_center_stub.logger
173
+ end
174
+
175
+ # Service calls
176
+
177
+ ##
178
+ # QueryProducts provides a list of all possible products which can be used to
179
+ # filter database resources.
180
+ #
181
+ # @overload query_products(request, options = nil)
182
+ # Pass arguments to `query_products` via a request object, either of type
183
+ # {::Google::Cloud::DatabaseCenter::V1beta::QueryProductsRequest} or an equivalent Hash.
184
+ #
185
+ # @param request [::Google::Cloud::DatabaseCenter::V1beta::QueryProductsRequest, ::Hash]
186
+ # A request object representing the call parameters. Required. To specify no
187
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
188
+ # @param options [::Gapic::CallOptions, ::Hash]
189
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
190
+ #
191
+ # @overload query_products(parent: nil, page_size: nil, page_token: nil)
192
+ # Pass arguments to `query_products` via keyword arguments. Note that at
193
+ # least one keyword argument is required. To specify no parameters, or to keep all
194
+ # the default parameter values, pass an empty Hash as a request object (see above).
195
+ #
196
+ # @param parent [::String]
197
+ # Required. Parent can be a project, a folder, or an organization.
198
+ #
199
+ # The allowed values are:
200
+ #
201
+ # * projects/\\{PROJECT_ID}/locations/\\{LOCATION}
202
+ # (e.g.,"projects/foo-bar/locations/us-central1")
203
+ # * projects/\\{PROJECT_NUMBER}/locations/\\{LOCATION}
204
+ # (e.g.,"projects/12345678/locations/us-central1")
205
+ # * folders/\\{FOLDER_NUMBER}/locations/\\{LOCATION}
206
+ # (e.g.,"folders/1234567/locations/us-central1")
207
+ # * organizations/\\{ORGANIZATION_NUMBER}/locations/\\{LOCATION}
208
+ # (e.g.,"organizations/123456/locations/us-central1")
209
+ # * projects/\\{PROJECT_ID} (e.g., "projects/foo-bar")
210
+ # * projects/\\{PROJECT_NUMBER} (e.g., "projects/12345678")
211
+ # * folders/\\{FOLDER_NUMBER} (e.g., "folders/1234567")
212
+ # * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
213
+ # @param page_size [::Integer]
214
+ # Optional. If unspecified, at most 50 products will be returned.
215
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
216
+ # @param page_token [::String]
217
+ # Optional. A page token, received from a previous `ListLocations` call.
218
+ # Provide this to retrieve the subsequent page.
219
+ # All other parameters except page size should match the call that provided
220
+ # the page page token.
221
+ # @yield [result, operation] Access the result along with the TransportOperation object
222
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::Product>]
223
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
224
+ #
225
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::Product>]
226
+ #
227
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
228
+ #
229
+ # @example Basic example
230
+ # require "google/cloud/database_center/v1beta"
231
+ #
232
+ # # Create a client object. The client can be reused for multiple calls.
233
+ # client = Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Rest::Client.new
234
+ #
235
+ # # Create a request. To set request fields, pass in keyword arguments.
236
+ # request = Google::Cloud::DatabaseCenter::V1beta::QueryProductsRequest.new
237
+ #
238
+ # # Call the query_products method.
239
+ # result = client.query_products request
240
+ #
241
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
242
+ # # over elements, and API calls will be issued to fetch pages as needed.
243
+ # result.each do |item|
244
+ # # Each element is of type ::Google::Cloud::DatabaseCenter::V1beta::Product.
245
+ # p item
246
+ # end
247
+ #
248
+ def query_products request, options = nil
249
+ raise ::ArgumentError, "request must be provided" if request.nil?
250
+
251
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DatabaseCenter::V1beta::QueryProductsRequest
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.query_products.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::DatabaseCenter::V1beta::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.query_products.timeout,
269
+ metadata: call_metadata,
270
+ retry_policy: @config.rpcs.query_products.retry_policy
271
+
272
+ options.apply_defaults timeout: @config.timeout,
273
+ metadata: @config.metadata,
274
+ retry_policy: @config.retry_policy
275
+
276
+ @database_center_stub.query_products request, options do |result, operation|
277
+ result = ::Gapic::Rest::PagedEnumerable.new @database_center_stub, :query_products, "products", request, result, options
278
+ yield result, operation if block_given?
279
+ throw :response, result
280
+ end
281
+ rescue ::Gapic::Rest::Error => e
282
+ raise ::Google::Cloud::Error.from_error(e)
283
+ end
284
+
285
+ ##
286
+ # AggregateFleet provides statistics about the fleet grouped by various
287
+ # fields.
288
+ #
289
+ # @overload aggregate_fleet(request, options = nil)
290
+ # Pass arguments to `aggregate_fleet` via a request object, either of type
291
+ # {::Google::Cloud::DatabaseCenter::V1beta::AggregateFleetRequest} or an equivalent Hash.
292
+ #
293
+ # @param request [::Google::Cloud::DatabaseCenter::V1beta::AggregateFleetRequest, ::Hash]
294
+ # A request object representing the call parameters. Required. To specify no
295
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
296
+ # @param options [::Gapic::CallOptions, ::Hash]
297
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
298
+ #
299
+ # @overload aggregate_fleet(parent: nil, filter: nil, group_by: nil, order_by: nil, page_size: nil, page_token: nil, baseline_date: nil)
300
+ # Pass arguments to `aggregate_fleet` via keyword arguments. Note that at
301
+ # least one keyword argument is required. To specify no parameters, or to keep all
302
+ # the default parameter values, pass an empty Hash as a request object (see above).
303
+ #
304
+ # @param parent [::String]
305
+ # Required. Parent can be a project, a folder, or an organization. The search
306
+ # is limited to the resources within the `scope`.
307
+ #
308
+ # The allowed values are:
309
+ #
310
+ # * projects/\\{PROJECT_ID} (e.g., "projects/foo-bar")
311
+ # * projects/\\{PROJECT_NUMBER} (e.g., "projects/12345678")
312
+ # * folders/\\{FOLDER_NUMBER} (e.g., "folders/1234567")
313
+ # * organizations/\\{ORGANIZATION_NUMBER} (e.g.,
314
+ # "organizations/123456")
315
+ # @param filter [::String]
316
+ # Optional. The expression to filter resources.
317
+ #
318
+ # Supported fields are: `full_resource_name`, `resource_type`, `container`,
319
+ # `product.type`, `product.engine`, `product.version`, `location`,
320
+ # `labels`, `issues`, fields of availability_info, data_protection_info,
321
+ # 'resource_name', etc.
322
+ #
323
+ # The expression is a list of zero or more restrictions combined via logical
324
+ # operators `AND` and `OR`. When `AND` and `OR` are both used in the
325
+ # expression, parentheses must be appropriately used to group the
326
+ # combinations.
327
+ #
328
+ # Example: location="us-east1"
329
+ # Example: container="projects/123" OR container="projects/456"
330
+ # Example: (container="projects/123" OR
331
+ # container="projects/456") AND location="us-east1"
332
+ # @param group_by [::String]
333
+ # Optional. A field that statistics are grouped by.
334
+ # Valid values are any combination of the following:
335
+ # * container
336
+ # * product.type
337
+ # * product.engine
338
+ # * product.version
339
+ # * location
340
+ # * sub_resource_type
341
+ # * management_type
342
+ # * tag.key
343
+ # * tag.value
344
+ # * tag.source
345
+ # * tag.inherited
346
+ # * label.key
347
+ # * label.value
348
+ # * label.source
349
+ # * has_maintenance_schedule
350
+ # * has_deny_maintenance_schedules
351
+ # Comma separated list.
352
+ # @param order_by [::String]
353
+ # Optional. Valid values to order by are:
354
+ # * resource_groups_count
355
+ # * resources_count
356
+ # * and all fields supported by `group_by`
357
+ # The default order is ascending. Add "DESC" after the field name to indicate
358
+ # descending order. Add "ASC" after the field name to indicate ascending
359
+ # order. It supports ordering using multiple fields.
360
+ # For example:
361
+ # order_by = "resource_groups_count" sorts response in ascending order
362
+ # order_by = "resource_groups_count DESC" sorts response in descending order
363
+ # order_by = "product.type, product.version DESC, location" orders by type
364
+ # in ascending order, version in descending order and location in ascending
365
+ # order
366
+ # @param page_size [::Integer]
367
+ # Optional. If unspecified, at most 50 items will be returned.
368
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
369
+ # @param page_token [::String]
370
+ # Optional. A page token, received from a previous `AggregateFleet` call.
371
+ # Provide this to retrieve the subsequent page.
372
+ # All other parameters should match the parameters in the call that provided
373
+ # the page token except for page_size which can be different.
374
+ # @param baseline_date [::Google::Type::Date, ::Hash]
375
+ # Optional. The baseline date w.r.t. which the delta counts are calculated.
376
+ # If not set, delta counts are not included in the response and the response
377
+ # indicates the current state of the fleet.
378
+ # @yield [result, operation] Access the result along with the TransportOperation object
379
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::AggregateFleetRow>]
380
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
381
+ #
382
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::AggregateFleetRow>]
383
+ #
384
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
385
+ #
386
+ # @example Basic example
387
+ # require "google/cloud/database_center/v1beta"
388
+ #
389
+ # # Create a client object. The client can be reused for multiple calls.
390
+ # client = Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Rest::Client.new
391
+ #
392
+ # # Create a request. To set request fields, pass in keyword arguments.
393
+ # request = Google::Cloud::DatabaseCenter::V1beta::AggregateFleetRequest.new
394
+ #
395
+ # # Call the aggregate_fleet method.
396
+ # result = client.aggregate_fleet request
397
+ #
398
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
399
+ # # over elements, and API calls will be issued to fetch pages as needed.
400
+ # result.each do |item|
401
+ # # Each element is of type ::Google::Cloud::DatabaseCenter::V1beta::AggregateFleetRow.
402
+ # p item
403
+ # end
404
+ #
405
+ def aggregate_fleet request, options = nil
406
+ raise ::ArgumentError, "request must be provided" if request.nil?
407
+
408
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DatabaseCenter::V1beta::AggregateFleetRequest
409
+
410
+ # Converts hash and nil to an options object
411
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
412
+
413
+ # Customize the options with defaults
414
+ call_metadata = @config.rpcs.aggregate_fleet.metadata.to_h
415
+
416
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
417
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
418
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
419
+ gapic_version: ::Google::Cloud::DatabaseCenter::V1beta::VERSION,
420
+ transports_version_send: [:rest]
421
+
422
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
423
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
424
+
425
+ options.apply_defaults timeout: @config.rpcs.aggregate_fleet.timeout,
426
+ metadata: call_metadata,
427
+ retry_policy: @config.rpcs.aggregate_fleet.retry_policy
428
+
429
+ options.apply_defaults timeout: @config.timeout,
430
+ metadata: @config.metadata,
431
+ retry_policy: @config.retry_policy
432
+
433
+ @database_center_stub.aggregate_fleet request, options do |result, operation|
434
+ result = ::Gapic::Rest::PagedEnumerable.new @database_center_stub, :aggregate_fleet, "rows", request, result, options
435
+ yield result, operation if block_given?
436
+ throw :response, result
437
+ end
438
+ rescue ::Gapic::Rest::Error => e
439
+ raise ::Google::Cloud::Error.from_error(e)
440
+ end
441
+
442
+ ##
443
+ # QueryDatabaseResourceGroups returns paginated results of database groups.
444
+ #
445
+ # @overload query_database_resource_groups(request, options = nil)
446
+ # Pass arguments to `query_database_resource_groups` via a request object, either of type
447
+ # {::Google::Cloud::DatabaseCenter::V1beta::QueryDatabaseResourceGroupsRequest} or an equivalent Hash.
448
+ #
449
+ # @param request [::Google::Cloud::DatabaseCenter::V1beta::QueryDatabaseResourceGroupsRequest, ::Hash]
450
+ # A request object representing the call parameters. Required. To specify no
451
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
452
+ # @param options [::Gapic::CallOptions, ::Hash]
453
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
454
+ #
455
+ # @overload query_database_resource_groups(parent: nil, filter: nil, signal_type_groups: nil, signal_filters: nil, order_by: nil, page_size: nil, page_token: nil)
456
+ # Pass arguments to `query_database_resource_groups` via keyword arguments. Note that at
457
+ # least one keyword argument is required. To specify no parameters, or to keep all
458
+ # the default parameter values, pass an empty Hash as a request object (see above).
459
+ #
460
+ # @param parent [::String]
461
+ # Required. Parent can be a project, a folder, or an organization. The search
462
+ # is limited to the resources within the `scope`.
463
+ #
464
+ # The allowed values are:
465
+ #
466
+ # * projects/\\{PROJECT_ID} (e.g., "projects/foo-bar")
467
+ # * projects/\\{PROJECT_NUMBER} (e.g., "projects/12345678")
468
+ # * folders/\\{FOLDER_NUMBER} (e.g., "folders/1234567")
469
+ # * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
470
+ # @param filter [::String]
471
+ # Optional. The expression to filter resources.
472
+ #
473
+ # The following fields are filterable:
474
+ # * full_resource_name
475
+ # * resource_type
476
+ # * container
477
+ # * product.type
478
+ # * product.engine
479
+ # * product.version
480
+ # * location
481
+ # * labels
482
+ # * resource_category
483
+ # * machine_config.cpu_count
484
+ # * machine_config.memory_size_bytes
485
+ # * machine_config.shard_count
486
+ # * resource_name
487
+ # * tags
488
+ # * backupdr_config.backupdr_managed
489
+ # * edition
490
+ #
491
+ # The expression is a list of zero or more restrictions combined via logical
492
+ # operators `AND` and `OR`. When `AND` and `OR` are both used in the
493
+ # expression, parentheses must be appropriately used to group the
494
+ # combinations.
495
+ #
496
+ # Example: location="us-east1"
497
+ # Example: container="projects/123" OR container="projects/456"
498
+ # Example: (container="projects/123" OR
499
+ # container="projects/456") AND location="us-east1"
500
+ # Example: full_resource_name=~"test"
501
+ # Example: full_resource_name=~"test.*master"
502
+ # @param signal_type_groups [::Array<::Google::Cloud::DatabaseCenter::V1beta::SignalTypeGroup, ::Hash>]
503
+ # Optional. Groups of signal types that are requested.
504
+ # @param signal_filters [::Array<::Google::Cloud::DatabaseCenter::V1beta::SignalFilter, ::Hash>]
505
+ # Optional. Filters based on signals. The list will be ORed together and then
506
+ # ANDed with the `filters` field above.
507
+ # @param order_by [::String]
508
+ # Optional. A field that specifies the sort order of the results.
509
+ #
510
+ # The following fields are sortable:
511
+ # * full_resource_name
512
+ # * product.type
513
+ # * product.engine
514
+ # * product.version
515
+ # * container
516
+ # * issue_count
517
+ # * machine_config.vcpu_count
518
+ # * machine_config.memory_size_bytes
519
+ # * machine_config.shard_count
520
+ # * resource_name
521
+ # * issue_severity
522
+ # * signal_type
523
+ # * location
524
+ # * resource_type
525
+ # * instance_type
526
+ # * edition
527
+ # * metrics.p99_cpu_utilization
528
+ # * metrics.p95_cpu_utilization
529
+ # * metrics.current_storage_used_bytes
530
+ # * metrics.node_count
531
+ # * metrics.processing_unit_count
532
+ # * metrics.current_memory_used_bytes
533
+ # * metrics.peak_storage_utilization
534
+ # * metrics.peak_number_connections
535
+ # * metrics.peak_memory_utilization
536
+ #
537
+ # The default order is ascending. Add "DESC" after the field name to indicate
538
+ # descending order. Add "ASC" after the field name to indicate ascending
539
+ # order. It only supports a single field at a time.
540
+ #
541
+ # For example:
542
+ # order_by = "full_resource_name" sorts response in ascending order
543
+ # order_by = "full_resource_name DESC" sorts response in descending order
544
+ # order_by = "issue_count DESC" sorts response in descending order of
545
+ # count of all issues associated with a resource.
546
+ #
547
+ # More explicitly, order_by = "full_resource_name, product" is not supported.
548
+ # @param page_size [::Integer]
549
+ # Optional. If unspecified, at most 50 resource groups will be returned.
550
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
551
+ # @param page_token [::String]
552
+ # Optional. A page token, received from a previous
553
+ # `QueryDatabaseResourceGroupsRequest` call. Provide this to retrieve the
554
+ # subsequent page. All parameters except page_token should match the
555
+ # parameters in the call that provided the page page token.
556
+ # @yield [result, operation] Access the result along with the TransportOperation object
557
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::DatabaseResourceGroup>]
558
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
559
+ #
560
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DatabaseCenter::V1beta::DatabaseResourceGroup>]
561
+ #
562
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
563
+ #
564
+ # @example Basic example
565
+ # require "google/cloud/database_center/v1beta"
566
+ #
567
+ # # Create a client object. The client can be reused for multiple calls.
568
+ # client = Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Rest::Client.new
569
+ #
570
+ # # Create a request. To set request fields, pass in keyword arguments.
571
+ # request = Google::Cloud::DatabaseCenter::V1beta::QueryDatabaseResourceGroupsRequest.new
572
+ #
573
+ # # Call the query_database_resource_groups method.
574
+ # result = client.query_database_resource_groups request
575
+ #
576
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
577
+ # # over elements, and API calls will be issued to fetch pages as needed.
578
+ # result.each do |item|
579
+ # # Each element is of type ::Google::Cloud::DatabaseCenter::V1beta::DatabaseResourceGroup.
580
+ # p item
581
+ # end
582
+ #
583
+ def query_database_resource_groups request, options = nil
584
+ raise ::ArgumentError, "request must be provided" if request.nil?
585
+
586
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DatabaseCenter::V1beta::QueryDatabaseResourceGroupsRequest
587
+
588
+ # Converts hash and nil to an options object
589
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
590
+
591
+ # Customize the options with defaults
592
+ call_metadata = @config.rpcs.query_database_resource_groups.metadata.to_h
593
+
594
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
595
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
596
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
597
+ gapic_version: ::Google::Cloud::DatabaseCenter::V1beta::VERSION,
598
+ transports_version_send: [:rest]
599
+
600
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
601
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
602
+
603
+ options.apply_defaults timeout: @config.rpcs.query_database_resource_groups.timeout,
604
+ metadata: call_metadata,
605
+ retry_policy: @config.rpcs.query_database_resource_groups.retry_policy
606
+
607
+ options.apply_defaults timeout: @config.timeout,
608
+ metadata: @config.metadata,
609
+ retry_policy: @config.retry_policy
610
+
611
+ @database_center_stub.query_database_resource_groups request, options do |result, operation|
612
+ result = ::Gapic::Rest::PagedEnumerable.new @database_center_stub, :query_database_resource_groups, "resource_groups", request, result, options
613
+ yield result, operation if block_given?
614
+ throw :response, result
615
+ end
616
+ rescue ::Gapic::Rest::Error => e
617
+ raise ::Google::Cloud::Error.from_error(e)
618
+ end
619
+
620
+ ##
621
+ # AggregateIssueStats provides database resource issues statistics.
622
+ #
623
+ # @overload aggregate_issue_stats(request, options = nil)
624
+ # Pass arguments to `aggregate_issue_stats` via a request object, either of type
625
+ # {::Google::Cloud::DatabaseCenter::V1beta::AggregateIssueStatsRequest} or an equivalent Hash.
626
+ #
627
+ # @param request [::Google::Cloud::DatabaseCenter::V1beta::AggregateIssueStatsRequest, ::Hash]
628
+ # A request object representing the call parameters. Required. To specify no
629
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
630
+ # @param options [::Gapic::CallOptions, ::Hash]
631
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
632
+ #
633
+ # @overload aggregate_issue_stats(parent: nil, filter: nil, signal_type_groups: nil, baseline_date: nil)
634
+ # Pass arguments to `aggregate_issue_stats` via keyword arguments. Note that at
635
+ # least one keyword argument is required. To specify no parameters, or to keep all
636
+ # the default parameter values, pass an empty Hash as a request object (see above).
637
+ #
638
+ # @param parent [::String]
639
+ # Required. Parent can be a project, a folder, or an organization. The search
640
+ # is limited to the resources within the `scope`.
641
+ #
642
+ # The allowed values are:
643
+ #
644
+ # * projects/\\{PROJECT_ID} (e.g., "projects/foo-bar")
645
+ # * projects/\\{PROJECT_NUMBER} (e.g., "projects/12345678")
646
+ # * folders/\\{FOLDER_NUMBER} (e.g., "folders/1234567")
647
+ # * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
648
+ # @param filter [::String]
649
+ # Optional. The expression to filter resources.
650
+ #
651
+ # Supported fields are: `full_resource_name`, `resource_type`, `container`,
652
+ # `product.type`, `product.engine`, `product.version`, `location`,
653
+ # `labels`, `issues`, fields of availability_info,
654
+ # data_protection_info,'resource_name', etc.
655
+ #
656
+ # The expression is a list of zero or more restrictions combined via logical
657
+ # operators `AND` and `OR`. When `AND` and `OR` are both used in the
658
+ # expression, parentheses must be appropriately used to group the
659
+ # combinations.
660
+ #
661
+ # Example: location="us-east1"
662
+ # Example: container="projects/123" OR container="projects/456"
663
+ # Example: (container="projects/123" OR
664
+ # container="projects/456") AND location="us-east1"
665
+ # @param signal_type_groups [::Array<::Google::Cloud::DatabaseCenter::V1beta::SignalTypeGroup, ::Hash>]
666
+ # Optional. Lists of signal types that are issues.
667
+ # @param baseline_date [::Google::Type::Date, ::Hash]
668
+ # Optional. The baseline date w.r.t. which the delta counts are calculated.
669
+ # If not set, delta counts are not included in the response and the response
670
+ # indicates the current state of the fleet.
671
+ # @yield [result, operation] Access the result along with the TransportOperation object
672
+ # @yieldparam result [::Google::Cloud::DatabaseCenter::V1beta::AggregateIssueStatsResponse]
673
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
674
+ #
675
+ # @return [::Google::Cloud::DatabaseCenter::V1beta::AggregateIssueStatsResponse]
676
+ #
677
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
678
+ #
679
+ # @example Basic example
680
+ # require "google/cloud/database_center/v1beta"
681
+ #
682
+ # # Create a client object. The client can be reused for multiple calls.
683
+ # client = Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Rest::Client.new
684
+ #
685
+ # # Create a request. To set request fields, pass in keyword arguments.
686
+ # request = Google::Cloud::DatabaseCenter::V1beta::AggregateIssueStatsRequest.new
687
+ #
688
+ # # Call the aggregate_issue_stats method.
689
+ # result = client.aggregate_issue_stats request
690
+ #
691
+ # # The returned object is of type Google::Cloud::DatabaseCenter::V1beta::AggregateIssueStatsResponse.
692
+ # p result
693
+ #
694
+ def aggregate_issue_stats request, options = nil
695
+ raise ::ArgumentError, "request must be provided" if request.nil?
696
+
697
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DatabaseCenter::V1beta::AggregateIssueStatsRequest
698
+
699
+ # Converts hash and nil to an options object
700
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
701
+
702
+ # Customize the options with defaults
703
+ call_metadata = @config.rpcs.aggregate_issue_stats.metadata.to_h
704
+
705
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
706
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
707
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
708
+ gapic_version: ::Google::Cloud::DatabaseCenter::V1beta::VERSION,
709
+ transports_version_send: [:rest]
710
+
711
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
712
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
713
+
714
+ options.apply_defaults timeout: @config.rpcs.aggregate_issue_stats.timeout,
715
+ metadata: call_metadata,
716
+ retry_policy: @config.rpcs.aggregate_issue_stats.retry_policy
717
+
718
+ options.apply_defaults timeout: @config.timeout,
719
+ metadata: @config.metadata,
720
+ retry_policy: @config.retry_policy
721
+
722
+ @database_center_stub.aggregate_issue_stats request, options do |result, operation|
723
+ yield result, operation if block_given?
724
+ end
725
+ rescue ::Gapic::Rest::Error => e
726
+ raise ::Google::Cloud::Error.from_error(e)
727
+ end
728
+
729
+ ##
730
+ # Configuration class for the DatabaseCenter REST API.
731
+ #
732
+ # This class represents the configuration for DatabaseCenter REST,
733
+ # providing control over timeouts, retry behavior, logging, transport
734
+ # parameters, and other low-level controls. Certain parameters can also be
735
+ # applied individually to specific RPCs. See
736
+ # {::Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Rest::Client::Configuration::Rpcs}
737
+ # for a list of RPCs that can be configured independently.
738
+ #
739
+ # Configuration can be applied globally to all clients, or to a single client
740
+ # on construction.
741
+ #
742
+ # @example
743
+ #
744
+ # # Modify the global config, setting the timeout for
745
+ # # query_products to 20 seconds,
746
+ # # and all remaining timeouts to 10 seconds.
747
+ # ::Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Rest::Client.configure do |config|
748
+ # config.timeout = 10.0
749
+ # config.rpcs.query_products.timeout = 20.0
750
+ # end
751
+ #
752
+ # # Apply the above configuration only to a new client.
753
+ # client = ::Google::Cloud::DatabaseCenter::V1beta::DatabaseCenter::Rest::Client.new do |config|
754
+ # config.timeout = 10.0
755
+ # config.rpcs.query_products.timeout = 20.0
756
+ # end
757
+ #
758
+ # @!attribute [rw] endpoint
759
+ # A custom service endpoint, as a hostname or hostname:port. The default is
760
+ # nil, indicating to use the default endpoint in the current universe domain.
761
+ # @return [::String,nil]
762
+ # @!attribute [rw] credentials
763
+ # Credentials to send with calls. You may provide any of the following types:
764
+ # * (`String`) The path to a service account key file in JSON format
765
+ # * (`Hash`) A service account key as a Hash
766
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
767
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
768
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
769
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
770
+ # * (`nil`) indicating no credentials
771
+ #
772
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
773
+ # external source for authentication to Google Cloud, you must validate it before
774
+ # providing it to a Google API client library. Providing an unvalidated credential
775
+ # configuration to Google APIs can compromise the security of your systems and data.
776
+ # For more information, refer to [Validate credential configurations from external
777
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
778
+ # @return [::Object]
779
+ # @!attribute [rw] scope
780
+ # The OAuth scopes
781
+ # @return [::Array<::String>]
782
+ # @!attribute [rw] lib_name
783
+ # The library name as recorded in instrumentation and logging
784
+ # @return [::String]
785
+ # @!attribute [rw] lib_version
786
+ # The library version as recorded in instrumentation and logging
787
+ # @return [::String]
788
+ # @!attribute [rw] timeout
789
+ # The call timeout in seconds.
790
+ # @return [::Numeric]
791
+ # @!attribute [rw] metadata
792
+ # Additional headers to be sent with the call.
793
+ # @return [::Hash{::Symbol=>::String}]
794
+ # @!attribute [rw] retry_policy
795
+ # The retry policy. The value is a hash with the following keys:
796
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
797
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
798
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
799
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
800
+ # trigger a retry.
801
+ # @return [::Hash]
802
+ # @!attribute [rw] quota_project
803
+ # A separate project against which to charge quota.
804
+ # @return [::String]
805
+ # @!attribute [rw] universe_domain
806
+ # The universe domain within which to make requests. This determines the
807
+ # default endpoint URL. The default value of nil uses the environment
808
+ # universe (usually the default "googleapis.com" universe).
809
+ # @return [::String,nil]
810
+ # @!attribute [rw] logger
811
+ # A custom logger to use for request/response debug logging, or the value
812
+ # `:default` (the default) to construct a default logger, or `nil` to
813
+ # explicitly disable logging.
814
+ # @return [::Logger,:default,nil]
815
+ #
816
+ class Configuration
817
+ extend ::Gapic::Config
818
+
819
+ # @private
820
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
821
+ DEFAULT_ENDPOINT = "databasecenter.googleapis.com"
822
+
823
+ config_attr :endpoint, nil, ::String, nil
824
+ config_attr :credentials, nil do |value|
825
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
826
+ allowed.any? { |klass| klass === value }
827
+ end
828
+ config_attr :scope, nil, ::String, ::Array, nil
829
+ config_attr :lib_name, nil, ::String, nil
830
+ config_attr :lib_version, nil, ::String, nil
831
+ config_attr :timeout, nil, ::Numeric, nil
832
+ config_attr :metadata, nil, ::Hash, nil
833
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
834
+ config_attr :quota_project, nil, ::String, nil
835
+ config_attr :universe_domain, nil, ::String, nil
836
+ config_attr :logger, :default, ::Logger, nil, :default
837
+
838
+ # @private
839
+ def initialize parent_config = nil
840
+ @parent_config = parent_config unless parent_config.nil?
841
+
842
+ yield self if block_given?
843
+ end
844
+
845
+ ##
846
+ # Configurations for individual RPCs
847
+ # @return [Rpcs]
848
+ #
849
+ def rpcs
850
+ @rpcs ||= begin
851
+ parent_rpcs = nil
852
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
853
+ Rpcs.new parent_rpcs
854
+ end
855
+ end
856
+
857
+ ##
858
+ # Configuration RPC class for the DatabaseCenter API.
859
+ #
860
+ # Includes fields providing the configuration for each RPC in this service.
861
+ # Each configuration object is of type `Gapic::Config::Method` and includes
862
+ # the following configuration fields:
863
+ #
864
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
865
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
866
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
867
+ # include the following keys:
868
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
869
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
870
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
871
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
872
+ # trigger a retry.
873
+ #
874
+ class Rpcs
875
+ ##
876
+ # RPC-specific configuration for `query_products`
877
+ # @return [::Gapic::Config::Method]
878
+ #
879
+ attr_reader :query_products
880
+ ##
881
+ # RPC-specific configuration for `aggregate_fleet`
882
+ # @return [::Gapic::Config::Method]
883
+ #
884
+ attr_reader :aggregate_fleet
885
+ ##
886
+ # RPC-specific configuration for `query_database_resource_groups`
887
+ # @return [::Gapic::Config::Method]
888
+ #
889
+ attr_reader :query_database_resource_groups
890
+ ##
891
+ # RPC-specific configuration for `aggregate_issue_stats`
892
+ # @return [::Gapic::Config::Method]
893
+ #
894
+ attr_reader :aggregate_issue_stats
895
+
896
+ # @private
897
+ def initialize parent_rpcs = nil
898
+ query_products_config = parent_rpcs.query_products if parent_rpcs.respond_to? :query_products
899
+ @query_products = ::Gapic::Config::Method.new query_products_config
900
+ aggregate_fleet_config = parent_rpcs.aggregate_fleet if parent_rpcs.respond_to? :aggregate_fleet
901
+ @aggregate_fleet = ::Gapic::Config::Method.new aggregate_fleet_config
902
+ query_database_resource_groups_config = parent_rpcs.query_database_resource_groups if parent_rpcs.respond_to? :query_database_resource_groups
903
+ @query_database_resource_groups = ::Gapic::Config::Method.new query_database_resource_groups_config
904
+ aggregate_issue_stats_config = parent_rpcs.aggregate_issue_stats if parent_rpcs.respond_to? :aggregate_issue_stats
905
+ @aggregate_issue_stats = ::Gapic::Config::Method.new aggregate_issue_stats_config
906
+
907
+ yield self if block_given?
908
+ end
909
+ end
910
+ end
911
+ end
912
+ end
913
+ end
914
+ end
915
+ end
916
+ end
917
+ end