google-cloud-alloy_db-v1beta 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/client.rb +789 -113
- data/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/paths.rb +21 -0
- data/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/client.rb +531 -5
- data/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/service_stub.rb +357 -0
- data/lib/google/cloud/alloy_db/v1beta/version.rb +1 -1
- data/lib/google/cloud/alloydb/v1beta/resources_pb.rb +8 -2
- data/lib/google/cloud/alloydb/v1beta/service_pb.rb +9 -1
- data/lib/google/cloud/alloydb/v1beta/service_services_pb.rb +13 -0
- data/proto_docs/google/cloud/alloydb/v1beta/resources.rb +134 -16
- data/proto_docs/google/cloud/alloydb/v1beta/service.rb +206 -3
- metadata +2 -2
@@ -140,6 +140,27 @@ module Google
|
|
140
140
|
"projects/#{project}/global/networks/#{network}"
|
141
141
|
end
|
142
142
|
|
143
|
+
##
|
144
|
+
# Create a fully-qualified User resource string.
|
145
|
+
#
|
146
|
+
# The resource will be in the following format:
|
147
|
+
#
|
148
|
+
# `projects/{project}/locations/{location}/clusters/{cluster}/users/{user}`
|
149
|
+
#
|
150
|
+
# @param project [String]
|
151
|
+
# @param location [String]
|
152
|
+
# @param cluster [String]
|
153
|
+
# @param user [String]
|
154
|
+
#
|
155
|
+
# @return [::String]
|
156
|
+
def user_path project:, location:, cluster:, user:
|
157
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
158
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
159
|
+
raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/"
|
160
|
+
|
161
|
+
"projects/#{project}/locations/#{location}/clusters/#{cluster}/users/#{user}"
|
162
|
+
end
|
163
|
+
|
143
164
|
extend self
|
144
165
|
end
|
145
166
|
end
|
@@ -115,6 +115,16 @@ module Google
|
|
115
115
|
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
116
116
|
}
|
117
117
|
|
118
|
+
default_config.rpcs.list_users.timeout = 60.0
|
119
|
+
default_config.rpcs.list_users.retry_policy = {
|
120
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
121
|
+
}
|
122
|
+
|
123
|
+
default_config.rpcs.get_user.timeout = 60.0
|
124
|
+
default_config.rpcs.get_user.retry_policy = {
|
125
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
126
|
+
}
|
127
|
+
|
118
128
|
default_config
|
119
129
|
end
|
120
130
|
yield @configure if block_given?
|
@@ -311,7 +321,7 @@ module Google
|
|
311
321
|
# @param options [::Gapic::CallOptions, ::Hash]
|
312
322
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
313
323
|
#
|
314
|
-
# @overload get_cluster(name: nil)
|
324
|
+
# @overload get_cluster(name: nil, view: nil)
|
315
325
|
# Pass arguments to `get_cluster` via keyword arguments. Note that at
|
316
326
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
317
327
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -319,6 +329,9 @@ module Google
|
|
319
329
|
# @param name [::String]
|
320
330
|
# Required. The name of the resource. For the required format, see the
|
321
331
|
# comment on the Cluster.name field.
|
332
|
+
# @param view [::Google::Cloud::AlloyDB::V1beta::ClusterView]
|
333
|
+
# Optional. The view of the cluster to return. Returns all default fields if
|
334
|
+
# not set.
|
322
335
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
323
336
|
# @yieldparam result [::Google::Cloud::AlloyDB::V1beta::Cluster]
|
324
337
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -380,7 +393,7 @@ module Google
|
|
380
393
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
381
394
|
#
|
382
395
|
# @param parent [::String]
|
383
|
-
# Required. The
|
396
|
+
# Required. The location of the new cluster. For the required format, see the
|
384
397
|
# comment on the Cluster.name field.
|
385
398
|
# @param cluster_id [::String]
|
386
399
|
# Required. ID of the requesting object.
|
@@ -825,8 +838,8 @@ module Google
|
|
825
838
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
826
839
|
#
|
827
840
|
# @param parent [::String]
|
828
|
-
# Required. The
|
829
|
-
#
|
841
|
+
# Required. The location of the new cluster. For the required
|
842
|
+
# format, see the comment on the Cluster.name field.
|
830
843
|
# @param cluster_id [::String]
|
831
844
|
# Required. ID of the requesting object (the secondary cluster).
|
832
845
|
# @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::Hash]
|
@@ -1551,6 +1564,91 @@ module Google
|
|
1551
1564
|
raise ::Google::Cloud::Error.from_error(e)
|
1552
1565
|
end
|
1553
1566
|
|
1567
|
+
##
|
1568
|
+
# Injects fault in an instance.
|
1569
|
+
# Imperative only.
|
1570
|
+
#
|
1571
|
+
# @overload inject_fault(request, options = nil)
|
1572
|
+
# Pass arguments to `inject_fault` via a request object, either of type
|
1573
|
+
# {::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest} or an equivalent Hash.
|
1574
|
+
#
|
1575
|
+
# @param request [::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest, ::Hash]
|
1576
|
+
# A request object representing the call parameters. Required. To specify no
|
1577
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1578
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1579
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1580
|
+
#
|
1581
|
+
# @overload inject_fault(fault_type: nil, name: nil, request_id: nil, validate_only: nil)
|
1582
|
+
# Pass arguments to `inject_fault` via keyword arguments. Note that at
|
1583
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1584
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1585
|
+
#
|
1586
|
+
# @param fault_type [::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest::FaultType]
|
1587
|
+
# Required. The type of fault to be injected in an instance.
|
1588
|
+
# @param name [::String]
|
1589
|
+
# Required. The name of the resource. For the required format, see the
|
1590
|
+
# comment on the Instance.name field.
|
1591
|
+
# @param request_id [::String]
|
1592
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
1593
|
+
# request ID so that if you must retry your request, the server will know to
|
1594
|
+
# ignore the request if it has already been completed. The server will
|
1595
|
+
# guarantee that for at least 60 minutes after the first request.
|
1596
|
+
#
|
1597
|
+
# For example, consider a situation where you make an initial request and
|
1598
|
+
# the request times out. If you make the request again with the same request
|
1599
|
+
# ID, the server can check if original operation with the same request ID
|
1600
|
+
# was received, and if so, will ignore the second request. This prevents
|
1601
|
+
# clients from accidentally creating duplicate commitments.
|
1602
|
+
#
|
1603
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
1604
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
1605
|
+
# @param validate_only [::Boolean]
|
1606
|
+
# Optional. If set, performs request validation (e.g. permission checks and
|
1607
|
+
# any other type of validation), but do not actually execute the fault
|
1608
|
+
# injection.
|
1609
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1610
|
+
# @yieldparam result [::Gapic::Operation]
|
1611
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1612
|
+
#
|
1613
|
+
# @return [::Gapic::Operation]
|
1614
|
+
#
|
1615
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1616
|
+
def inject_fault request, options = nil
|
1617
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1618
|
+
|
1619
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest
|
1620
|
+
|
1621
|
+
# Converts hash and nil to an options object
|
1622
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1623
|
+
|
1624
|
+
# Customize the options with defaults
|
1625
|
+
call_metadata = @config.rpcs.inject_fault.metadata.to_h
|
1626
|
+
|
1627
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1628
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1629
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1630
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
|
1631
|
+
transports_version_send: [:rest]
|
1632
|
+
|
1633
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1634
|
+
|
1635
|
+
options.apply_defaults timeout: @config.rpcs.inject_fault.timeout,
|
1636
|
+
metadata: call_metadata,
|
1637
|
+
retry_policy: @config.rpcs.inject_fault.retry_policy
|
1638
|
+
|
1639
|
+
options.apply_defaults timeout: @config.timeout,
|
1640
|
+
metadata: @config.metadata,
|
1641
|
+
retry_policy: @config.retry_policy
|
1642
|
+
|
1643
|
+
@alloy_db_admin_stub.inject_fault request, options do |result, operation|
|
1644
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1645
|
+
yield result, operation if block_given?
|
1646
|
+
return result
|
1647
|
+
end
|
1648
|
+
rescue ::Gapic::Rest::Error => e
|
1649
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1650
|
+
end
|
1651
|
+
|
1554
1652
|
##
|
1555
1653
|
# Restart an Instance in a cluster.
|
1556
1654
|
# Imperative only.
|
@@ -2115,7 +2213,7 @@ module Google
|
|
2115
2213
|
# @param options [::Gapic::CallOptions, ::Hash]
|
2116
2214
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2117
2215
|
#
|
2118
|
-
# @overload generate_client_certificate(parent: nil, request_id: nil, pem_csr: nil, cert_duration: nil)
|
2216
|
+
# @overload generate_client_certificate(parent: nil, request_id: nil, pem_csr: nil, cert_duration: nil, public_key: nil)
|
2119
2217
|
# Pass arguments to `generate_client_certificate` via keyword arguments. Note that at
|
2120
2218
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
2121
2219
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -2145,6 +2243,8 @@ module Google
|
|
2145
2243
|
# 24 hours. The endpoint may or may not honor the hint. If the hint is left
|
2146
2244
|
# unspecified or is not honored, then the endpoint will pick an appropriate
|
2147
2245
|
# default duration.
|
2246
|
+
# @param public_key [::String]
|
2247
|
+
# Optional. The public key from the client.
|
2148
2248
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
2149
2249
|
# @yieldparam result [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse]
|
2150
2250
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -2264,6 +2364,390 @@ module Google
|
|
2264
2364
|
raise ::Google::Cloud::Error.from_error(e)
|
2265
2365
|
end
|
2266
2366
|
|
2367
|
+
##
|
2368
|
+
# Lists Users in a given project and location.
|
2369
|
+
#
|
2370
|
+
# @overload list_users(request, options = nil)
|
2371
|
+
# Pass arguments to `list_users` via a request object, either of type
|
2372
|
+
# {::Google::Cloud::AlloyDB::V1beta::ListUsersRequest} or an equivalent Hash.
|
2373
|
+
#
|
2374
|
+
# @param request [::Google::Cloud::AlloyDB::V1beta::ListUsersRequest, ::Hash]
|
2375
|
+
# A request object representing the call parameters. Required. To specify no
|
2376
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2377
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2378
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2379
|
+
#
|
2380
|
+
# @overload list_users(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
2381
|
+
# Pass arguments to `list_users` via keyword arguments. Note that at
|
2382
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2383
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2384
|
+
#
|
2385
|
+
# @param parent [::String]
|
2386
|
+
# Required. Parent value for ListUsersRequest
|
2387
|
+
# @param page_size [::Integer]
|
2388
|
+
# Optional. Requested page size. Server may return fewer items than
|
2389
|
+
# requested. If unspecified, server will pick an appropriate default.
|
2390
|
+
# @param page_token [::String]
|
2391
|
+
# Optional. A token identifying a page of results the server should return.
|
2392
|
+
# @param filter [::String]
|
2393
|
+
# Optional. Filtering results
|
2394
|
+
# @param order_by [::String]
|
2395
|
+
# Optional. Hint for how to order the results
|
2396
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2397
|
+
# @yieldparam result [::Google::Cloud::AlloyDB::V1beta::ListUsersResponse]
|
2398
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2399
|
+
#
|
2400
|
+
# @return [::Google::Cloud::AlloyDB::V1beta::ListUsersResponse]
|
2401
|
+
#
|
2402
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2403
|
+
def list_users request, options = nil
|
2404
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2405
|
+
|
2406
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ListUsersRequest
|
2407
|
+
|
2408
|
+
# Converts hash and nil to an options object
|
2409
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2410
|
+
|
2411
|
+
# Customize the options with defaults
|
2412
|
+
call_metadata = @config.rpcs.list_users.metadata.to_h
|
2413
|
+
|
2414
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2415
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2416
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2417
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
|
2418
|
+
transports_version_send: [:rest]
|
2419
|
+
|
2420
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2421
|
+
|
2422
|
+
options.apply_defaults timeout: @config.rpcs.list_users.timeout,
|
2423
|
+
metadata: call_metadata,
|
2424
|
+
retry_policy: @config.rpcs.list_users.retry_policy
|
2425
|
+
|
2426
|
+
options.apply_defaults timeout: @config.timeout,
|
2427
|
+
metadata: @config.metadata,
|
2428
|
+
retry_policy: @config.retry_policy
|
2429
|
+
|
2430
|
+
@alloy_db_admin_stub.list_users request, options do |result, operation|
|
2431
|
+
yield result, operation if block_given?
|
2432
|
+
return result
|
2433
|
+
end
|
2434
|
+
rescue ::Gapic::Rest::Error => e
|
2435
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2436
|
+
end
|
2437
|
+
|
2438
|
+
##
|
2439
|
+
# Gets details of a single User.
|
2440
|
+
#
|
2441
|
+
# @overload get_user(request, options = nil)
|
2442
|
+
# Pass arguments to `get_user` via a request object, either of type
|
2443
|
+
# {::Google::Cloud::AlloyDB::V1beta::GetUserRequest} or an equivalent Hash.
|
2444
|
+
#
|
2445
|
+
# @param request [::Google::Cloud::AlloyDB::V1beta::GetUserRequest, ::Hash]
|
2446
|
+
# A request object representing the call parameters. Required. To specify no
|
2447
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2448
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2449
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2450
|
+
#
|
2451
|
+
# @overload get_user(name: nil)
|
2452
|
+
# Pass arguments to `get_user` via keyword arguments. Note that at
|
2453
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2454
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2455
|
+
#
|
2456
|
+
# @param name [::String]
|
2457
|
+
# Required. The name of the resource. For the required format, see the
|
2458
|
+
# comment on the User.name field.
|
2459
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2460
|
+
# @yieldparam result [::Google::Cloud::AlloyDB::V1beta::User]
|
2461
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2462
|
+
#
|
2463
|
+
# @return [::Google::Cloud::AlloyDB::V1beta::User]
|
2464
|
+
#
|
2465
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2466
|
+
def get_user request, options = nil
|
2467
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2468
|
+
|
2469
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GetUserRequest
|
2470
|
+
|
2471
|
+
# Converts hash and nil to an options object
|
2472
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2473
|
+
|
2474
|
+
# Customize the options with defaults
|
2475
|
+
call_metadata = @config.rpcs.get_user.metadata.to_h
|
2476
|
+
|
2477
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2478
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2479
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2480
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
|
2481
|
+
transports_version_send: [:rest]
|
2482
|
+
|
2483
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2484
|
+
|
2485
|
+
options.apply_defaults timeout: @config.rpcs.get_user.timeout,
|
2486
|
+
metadata: call_metadata,
|
2487
|
+
retry_policy: @config.rpcs.get_user.retry_policy
|
2488
|
+
|
2489
|
+
options.apply_defaults timeout: @config.timeout,
|
2490
|
+
metadata: @config.metadata,
|
2491
|
+
retry_policy: @config.retry_policy
|
2492
|
+
|
2493
|
+
@alloy_db_admin_stub.get_user request, options do |result, operation|
|
2494
|
+
yield result, operation if block_given?
|
2495
|
+
return result
|
2496
|
+
end
|
2497
|
+
rescue ::Gapic::Rest::Error => e
|
2498
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2499
|
+
end
|
2500
|
+
|
2501
|
+
##
|
2502
|
+
# Creates a new User in a given project, location, and cluster.
|
2503
|
+
#
|
2504
|
+
# @overload create_user(request, options = nil)
|
2505
|
+
# Pass arguments to `create_user` via a request object, either of type
|
2506
|
+
# {::Google::Cloud::AlloyDB::V1beta::CreateUserRequest} or an equivalent Hash.
|
2507
|
+
#
|
2508
|
+
# @param request [::Google::Cloud::AlloyDB::V1beta::CreateUserRequest, ::Hash]
|
2509
|
+
# A request object representing the call parameters. Required. To specify no
|
2510
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2511
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2512
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2513
|
+
#
|
2514
|
+
# @overload create_user(parent: nil, user_id: nil, user: nil, request_id: nil, validate_only: nil)
|
2515
|
+
# Pass arguments to `create_user` via keyword arguments. Note that at
|
2516
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2517
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2518
|
+
#
|
2519
|
+
# @param parent [::String]
|
2520
|
+
# Required. Value for parent.
|
2521
|
+
# @param user_id [::String]
|
2522
|
+
# Required. ID of the requesting object.
|
2523
|
+
# @param user [::Google::Cloud::AlloyDB::V1beta::User, ::Hash]
|
2524
|
+
# Required. The resource being created
|
2525
|
+
# @param request_id [::String]
|
2526
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
2527
|
+
# request ID so that if you must retry your request, the server will know to
|
2528
|
+
# ignore the request if it has already been completed. The server will
|
2529
|
+
# guarantee that for at least 60 minutes since the first request.
|
2530
|
+
#
|
2531
|
+
# For example, consider a situation where you make an initial request and
|
2532
|
+
# the request times out. If you make the request again with the same request
|
2533
|
+
# ID, the server can check if original operation with the same request ID
|
2534
|
+
# was received, and if so, will ignore the second request. This prevents
|
2535
|
+
# clients from accidentally creating duplicate commitments.
|
2536
|
+
#
|
2537
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
2538
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
2539
|
+
# @param validate_only [::Boolean]
|
2540
|
+
# Optional. If set, the backend validates the request, but doesn't actually
|
2541
|
+
# execute it.
|
2542
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2543
|
+
# @yieldparam result [::Google::Cloud::AlloyDB::V1beta::User]
|
2544
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2545
|
+
#
|
2546
|
+
# @return [::Google::Cloud::AlloyDB::V1beta::User]
|
2547
|
+
#
|
2548
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2549
|
+
def create_user request, options = nil
|
2550
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2551
|
+
|
2552
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateUserRequest
|
2553
|
+
|
2554
|
+
# Converts hash and nil to an options object
|
2555
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2556
|
+
|
2557
|
+
# Customize the options with defaults
|
2558
|
+
call_metadata = @config.rpcs.create_user.metadata.to_h
|
2559
|
+
|
2560
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2561
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2562
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2563
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
|
2564
|
+
transports_version_send: [:rest]
|
2565
|
+
|
2566
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2567
|
+
|
2568
|
+
options.apply_defaults timeout: @config.rpcs.create_user.timeout,
|
2569
|
+
metadata: call_metadata,
|
2570
|
+
retry_policy: @config.rpcs.create_user.retry_policy
|
2571
|
+
|
2572
|
+
options.apply_defaults timeout: @config.timeout,
|
2573
|
+
metadata: @config.metadata,
|
2574
|
+
retry_policy: @config.retry_policy
|
2575
|
+
|
2576
|
+
@alloy_db_admin_stub.create_user request, options do |result, operation|
|
2577
|
+
yield result, operation if block_given?
|
2578
|
+
return result
|
2579
|
+
end
|
2580
|
+
rescue ::Gapic::Rest::Error => e
|
2581
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2582
|
+
end
|
2583
|
+
|
2584
|
+
##
|
2585
|
+
# Updates the parameters of a single User.
|
2586
|
+
#
|
2587
|
+
# @overload update_user(request, options = nil)
|
2588
|
+
# Pass arguments to `update_user` via a request object, either of type
|
2589
|
+
# {::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest} or an equivalent Hash.
|
2590
|
+
#
|
2591
|
+
# @param request [::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest, ::Hash]
|
2592
|
+
# A request object representing the call parameters. Required. To specify no
|
2593
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2594
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2595
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2596
|
+
#
|
2597
|
+
# @overload update_user(update_mask: nil, user: nil, request_id: nil, validate_only: nil, allow_missing: nil)
|
2598
|
+
# Pass arguments to `update_user` via keyword arguments. Note that at
|
2599
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2600
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2601
|
+
#
|
2602
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
2603
|
+
# Optional. Field mask is used to specify the fields to be overwritten in the
|
2604
|
+
# User resource by the update.
|
2605
|
+
# The fields specified in the update_mask are relative to the resource, not
|
2606
|
+
# the full request. A field will be overwritten if it is in the mask. If the
|
2607
|
+
# user does not provide a mask then all fields will be overwritten.
|
2608
|
+
# @param user [::Google::Cloud::AlloyDB::V1beta::User, ::Hash]
|
2609
|
+
# Required. The resource being updated
|
2610
|
+
# @param request_id [::String]
|
2611
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
2612
|
+
# request ID so that if you must retry your request, the server will know to
|
2613
|
+
# ignore the request if it has already been completed. The server will
|
2614
|
+
# guarantee that for at least 60 minutes since the first request.
|
2615
|
+
#
|
2616
|
+
# For example, consider a situation where you make an initial request and
|
2617
|
+
# the request times out. If you make the request again with the same request
|
2618
|
+
# ID, the server can check if original operation with the same request ID
|
2619
|
+
# was received, and if so, will ignore the second request. This prevents
|
2620
|
+
# clients from accidentally creating duplicate commitments.
|
2621
|
+
#
|
2622
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
2623
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
2624
|
+
# @param validate_only [::Boolean]
|
2625
|
+
# Optional. If set, the backend validates the request, but doesn't actually
|
2626
|
+
# execute it.
|
2627
|
+
# @param allow_missing [::Boolean]
|
2628
|
+
# Optional. Allow missing fields in the update mask.
|
2629
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2630
|
+
# @yieldparam result [::Google::Cloud::AlloyDB::V1beta::User]
|
2631
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2632
|
+
#
|
2633
|
+
# @return [::Google::Cloud::AlloyDB::V1beta::User]
|
2634
|
+
#
|
2635
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2636
|
+
def update_user request, options = nil
|
2637
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2638
|
+
|
2639
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest
|
2640
|
+
|
2641
|
+
# Converts hash and nil to an options object
|
2642
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2643
|
+
|
2644
|
+
# Customize the options with defaults
|
2645
|
+
call_metadata = @config.rpcs.update_user.metadata.to_h
|
2646
|
+
|
2647
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2648
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2649
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2650
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
|
2651
|
+
transports_version_send: [:rest]
|
2652
|
+
|
2653
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2654
|
+
|
2655
|
+
options.apply_defaults timeout: @config.rpcs.update_user.timeout,
|
2656
|
+
metadata: call_metadata,
|
2657
|
+
retry_policy: @config.rpcs.update_user.retry_policy
|
2658
|
+
|
2659
|
+
options.apply_defaults timeout: @config.timeout,
|
2660
|
+
metadata: @config.metadata,
|
2661
|
+
retry_policy: @config.retry_policy
|
2662
|
+
|
2663
|
+
@alloy_db_admin_stub.update_user request, options do |result, operation|
|
2664
|
+
yield result, operation if block_given?
|
2665
|
+
return result
|
2666
|
+
end
|
2667
|
+
rescue ::Gapic::Rest::Error => e
|
2668
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2669
|
+
end
|
2670
|
+
|
2671
|
+
##
|
2672
|
+
# Deletes a single User.
|
2673
|
+
#
|
2674
|
+
# @overload delete_user(request, options = nil)
|
2675
|
+
# Pass arguments to `delete_user` via a request object, either of type
|
2676
|
+
# {::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest} or an equivalent Hash.
|
2677
|
+
#
|
2678
|
+
# @param request [::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest, ::Hash]
|
2679
|
+
# A request object representing the call parameters. Required. To specify no
|
2680
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2681
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2682
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2683
|
+
#
|
2684
|
+
# @overload delete_user(name: nil, request_id: nil, validate_only: nil)
|
2685
|
+
# Pass arguments to `delete_user` via keyword arguments. Note that at
|
2686
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2687
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2688
|
+
#
|
2689
|
+
# @param name [::String]
|
2690
|
+
# Required. The name of the resource. For the required format, see the
|
2691
|
+
# comment on the User.name field.
|
2692
|
+
# @param request_id [::String]
|
2693
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
2694
|
+
# request ID so that if you must retry your request, the server will know to
|
2695
|
+
# ignore the request if it has already been completed. The server will
|
2696
|
+
# guarantee that for at least 60 minutes after the first request.
|
2697
|
+
#
|
2698
|
+
# For example, consider a situation where you make an initial request and
|
2699
|
+
# the request times out. If you make the request again with the same request
|
2700
|
+
# ID, the server can check if original operation with the same request ID
|
2701
|
+
# was received, and if so, will ignore the second request. This prevents
|
2702
|
+
# clients from accidentally creating duplicate commitments.
|
2703
|
+
#
|
2704
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
2705
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
2706
|
+
# @param validate_only [::Boolean]
|
2707
|
+
# Optional. If set, the backend validates the request, but doesn't actually
|
2708
|
+
# execute it.
|
2709
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2710
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
2711
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2712
|
+
#
|
2713
|
+
# @return [::Google::Protobuf::Empty]
|
2714
|
+
#
|
2715
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2716
|
+
def delete_user request, options = nil
|
2717
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2718
|
+
|
2719
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest
|
2720
|
+
|
2721
|
+
# Converts hash and nil to an options object
|
2722
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2723
|
+
|
2724
|
+
# Customize the options with defaults
|
2725
|
+
call_metadata = @config.rpcs.delete_user.metadata.to_h
|
2726
|
+
|
2727
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2728
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2729
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2730
|
+
gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION,
|
2731
|
+
transports_version_send: [:rest]
|
2732
|
+
|
2733
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2734
|
+
|
2735
|
+
options.apply_defaults timeout: @config.rpcs.delete_user.timeout,
|
2736
|
+
metadata: call_metadata,
|
2737
|
+
retry_policy: @config.rpcs.delete_user.retry_policy
|
2738
|
+
|
2739
|
+
options.apply_defaults timeout: @config.timeout,
|
2740
|
+
metadata: @config.metadata,
|
2741
|
+
retry_policy: @config.retry_policy
|
2742
|
+
|
2743
|
+
@alloy_db_admin_stub.delete_user request, options do |result, operation|
|
2744
|
+
yield result, operation if block_given?
|
2745
|
+
return result
|
2746
|
+
end
|
2747
|
+
rescue ::Gapic::Rest::Error => e
|
2748
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2749
|
+
end
|
2750
|
+
|
2267
2751
|
##
|
2268
2752
|
# Configuration class for the AlloyDBAdmin REST API.
|
2269
2753
|
#
|
@@ -2477,6 +2961,11 @@ module Google
|
|
2477
2961
|
#
|
2478
2962
|
attr_reader :failover_instance
|
2479
2963
|
##
|
2964
|
+
# RPC-specific configuration for `inject_fault`
|
2965
|
+
# @return [::Gapic::Config::Method]
|
2966
|
+
#
|
2967
|
+
attr_reader :inject_fault
|
2968
|
+
##
|
2480
2969
|
# RPC-specific configuration for `restart_instance`
|
2481
2970
|
# @return [::Gapic::Config::Method]
|
2482
2971
|
#
|
@@ -2521,6 +3010,31 @@ module Google
|
|
2521
3010
|
# @return [::Gapic::Config::Method]
|
2522
3011
|
#
|
2523
3012
|
attr_reader :get_connection_info
|
3013
|
+
##
|
3014
|
+
# RPC-specific configuration for `list_users`
|
3015
|
+
# @return [::Gapic::Config::Method]
|
3016
|
+
#
|
3017
|
+
attr_reader :list_users
|
3018
|
+
##
|
3019
|
+
# RPC-specific configuration for `get_user`
|
3020
|
+
# @return [::Gapic::Config::Method]
|
3021
|
+
#
|
3022
|
+
attr_reader :get_user
|
3023
|
+
##
|
3024
|
+
# RPC-specific configuration for `create_user`
|
3025
|
+
# @return [::Gapic::Config::Method]
|
3026
|
+
#
|
3027
|
+
attr_reader :create_user
|
3028
|
+
##
|
3029
|
+
# RPC-specific configuration for `update_user`
|
3030
|
+
# @return [::Gapic::Config::Method]
|
3031
|
+
#
|
3032
|
+
attr_reader :update_user
|
3033
|
+
##
|
3034
|
+
# RPC-specific configuration for `delete_user`
|
3035
|
+
# @return [::Gapic::Config::Method]
|
3036
|
+
#
|
3037
|
+
attr_reader :delete_user
|
2524
3038
|
|
2525
3039
|
# @private
|
2526
3040
|
def initialize parent_rpcs = nil
|
@@ -2556,6 +3070,8 @@ module Google
|
|
2556
3070
|
@delete_instance = ::Gapic::Config::Method.new delete_instance_config
|
2557
3071
|
failover_instance_config = parent_rpcs.failover_instance if parent_rpcs.respond_to? :failover_instance
|
2558
3072
|
@failover_instance = ::Gapic::Config::Method.new failover_instance_config
|
3073
|
+
inject_fault_config = parent_rpcs.inject_fault if parent_rpcs.respond_to? :inject_fault
|
3074
|
+
@inject_fault = ::Gapic::Config::Method.new inject_fault_config
|
2559
3075
|
restart_instance_config = parent_rpcs.restart_instance if parent_rpcs.respond_to? :restart_instance
|
2560
3076
|
@restart_instance = ::Gapic::Config::Method.new restart_instance_config
|
2561
3077
|
list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
|
@@ -2574,6 +3090,16 @@ module Google
|
|
2574
3090
|
@generate_client_certificate = ::Gapic::Config::Method.new generate_client_certificate_config
|
2575
3091
|
get_connection_info_config = parent_rpcs.get_connection_info if parent_rpcs.respond_to? :get_connection_info
|
2576
3092
|
@get_connection_info = ::Gapic::Config::Method.new get_connection_info_config
|
3093
|
+
list_users_config = parent_rpcs.list_users if parent_rpcs.respond_to? :list_users
|
3094
|
+
@list_users = ::Gapic::Config::Method.new list_users_config
|
3095
|
+
get_user_config = parent_rpcs.get_user if parent_rpcs.respond_to? :get_user
|
3096
|
+
@get_user = ::Gapic::Config::Method.new get_user_config
|
3097
|
+
create_user_config = parent_rpcs.create_user if parent_rpcs.respond_to? :create_user
|
3098
|
+
@create_user = ::Gapic::Config::Method.new create_user_config
|
3099
|
+
update_user_config = parent_rpcs.update_user if parent_rpcs.respond_to? :update_user
|
3100
|
+
@update_user = ::Gapic::Config::Method.new update_user_config
|
3101
|
+
delete_user_config = parent_rpcs.delete_user if parent_rpcs.respond_to? :delete_user
|
3102
|
+
@delete_user = ::Gapic::Config::Method.new delete_user_config
|
2577
3103
|
|
2578
3104
|
yield self if block_given?
|
2579
3105
|
end
|