google-cloud-sql-v1beta4 0.5.0 → 0.7.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.
- checksums.yaml +4 -4
- data/README.md +4 -6
- data/lib/google/cloud/sql/v1beta4/cloud_sql_pb.rb +12 -1
- data/lib/google/cloud/sql/v1beta4/cloud_sql_resources_pb.rb +16 -1
- data/lib/google/cloud/sql/v1beta4/cloud_sql_services_pb.rb +27 -0
- data/lib/google/cloud/sql/v1beta4/cloud_sql_users_services_pb.rb +1 -0
- data/lib/google/cloud/sql/v1beta4/cloud_sql_workload_captures_pb.rb +2 -1
- data/lib/google/cloud/sql/v1beta4/sql_backup_runs_service/client.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_backup_runs_service/rest/client.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_backup_runs_service/rest.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_backup_runs_service.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_backups_service/client.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_backups_service/paths.rb +17 -0
- data/lib/google/cloud/sql/v1beta4/sql_backups_service/rest/client.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_backups_service/rest.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_backups_service.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_databases_service/client.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_databases_service/rest/client.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_databases_service/rest.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_databases_service.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_flags_service/client.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_flags_service/rest/client.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_flags_service/rest.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_flags_service.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_instances_service/client.rb +411 -0
- data/lib/google/cloud/sql/v1beta4/sql_instances_service/paths.rb +17 -0
- data/lib/google/cloud/sql/v1beta4/sql_instances_service/rest/client.rb +371 -0
- data/lib/google/cloud/sql/v1beta4/sql_instances_service/rest/service_stub.rb +250 -0
- data/lib/google/cloud/sql/v1beta4/sql_instances_service/rest.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_instances_service.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_operations_service/client.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_operations_service/rest/client.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_operations_service/rest.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_operations_service.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_ssl_certs_service/client.rb +317 -0
- data/lib/google/cloud/sql/v1beta4/sql_ssl_certs_service/rest/client.rb +281 -0
- data/lib/google/cloud/sql/v1beta4/sql_ssl_certs_service/rest/service_stub.rb +189 -0
- data/lib/google/cloud/sql/v1beta4/sql_ssl_certs_service/rest.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_ssl_certs_service.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_users_service/client.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_users_service/rest/client.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_users_service/rest.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/sql_users_service.rb +2 -0
- data/lib/google/cloud/sql/v1beta4/version.rb +1 -1
- data/proto_docs/google/cloud/sql/v1beta4/cloud_sql.rb +227 -0
- data/proto_docs/google/cloud/sql/v1beta4/cloud_sql_resources.rb +325 -0
- data/proto_docs/google/cloud/sql/v1beta4/cloud_sql_workload_captures.rb +16 -0
- metadata +1 -1
|
@@ -85,6 +85,23 @@ module Google
|
|
|
85
85
|
"projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}"
|
|
86
86
|
end
|
|
87
87
|
|
|
88
|
+
##
|
|
89
|
+
# Create a fully-qualified Instance resource string.
|
|
90
|
+
#
|
|
91
|
+
# The resource will be in the following format:
|
|
92
|
+
#
|
|
93
|
+
# `projects/{project}/instances/{instance}`
|
|
94
|
+
#
|
|
95
|
+
# @param project [String]
|
|
96
|
+
# @param instance [String]
|
|
97
|
+
#
|
|
98
|
+
# @return [::String]
|
|
99
|
+
def instance_path project:, instance:
|
|
100
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
|
101
|
+
|
|
102
|
+
"projects/#{project}/instances/#{instance}"
|
|
103
|
+
end
|
|
104
|
+
|
|
88
105
|
##
|
|
89
106
|
# Create a fully-qualified NetworkAttachment resource string.
|
|
90
107
|
#
|
|
@@ -28,6 +28,8 @@ module Google
|
|
|
28
28
|
##
|
|
29
29
|
# Client for the SqlInstancesService service.
|
|
30
30
|
#
|
|
31
|
+
# Service to manage Cloud SQL instances.
|
|
32
|
+
#
|
|
31
33
|
class Client
|
|
32
34
|
# @private
|
|
33
35
|
API_VERSION = ""
|
|
@@ -2322,6 +2324,194 @@ module Google
|
|
|
2322
2324
|
raise ::Google::Cloud::Error.from_error(e)
|
|
2323
2325
|
end
|
|
2324
2326
|
|
|
2327
|
+
##
|
|
2328
|
+
# Starts a Cloud SQL instance.
|
|
2329
|
+
#
|
|
2330
|
+
# @overload start(request, options = nil)
|
|
2331
|
+
# Pass arguments to `start` via a request object, either of type
|
|
2332
|
+
# {::Google::Cloud::Sql::V1beta4::SqlInstancesStartRequest} or an equivalent Hash.
|
|
2333
|
+
#
|
|
2334
|
+
# @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesStartRequest, ::Hash]
|
|
2335
|
+
# A request object representing the call parameters. Required. To specify no
|
|
2336
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
2337
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
2338
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
2339
|
+
#
|
|
2340
|
+
# @overload start(instance: nil, project: nil, location: nil)
|
|
2341
|
+
# Pass arguments to `start` via keyword arguments. Note that at
|
|
2342
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
2343
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
2344
|
+
#
|
|
2345
|
+
# @param instance [::String]
|
|
2346
|
+
# Required. Cloud SQL instance ID. This does not include the project ID.
|
|
2347
|
+
# @param project [::String]
|
|
2348
|
+
# Required. Project ID of the project that contains the instance to be
|
|
2349
|
+
# started.
|
|
2350
|
+
# @param location [::String]
|
|
2351
|
+
# Optional. The region of the Cloud SQL instance, for example `us-central1`.
|
|
2352
|
+
# If omitted, the region is determined from the instance.
|
|
2353
|
+
#
|
|
2354
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
2355
|
+
# @yieldparam response [::Google::Cloud::Sql::V1beta4::Operation]
|
|
2356
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
2357
|
+
#
|
|
2358
|
+
# @return [::Google::Cloud::Sql::V1beta4::Operation]
|
|
2359
|
+
#
|
|
2360
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
2361
|
+
#
|
|
2362
|
+
# @example Basic example
|
|
2363
|
+
# require "google/cloud/sql/v1beta4"
|
|
2364
|
+
#
|
|
2365
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
2366
|
+
# client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Client.new
|
|
2367
|
+
#
|
|
2368
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
2369
|
+
# request = Google::Cloud::Sql::V1beta4::SqlInstancesStartRequest.new
|
|
2370
|
+
#
|
|
2371
|
+
# # Call the start method.
|
|
2372
|
+
# result = client.start request
|
|
2373
|
+
#
|
|
2374
|
+
# # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
|
|
2375
|
+
# p result
|
|
2376
|
+
#
|
|
2377
|
+
def start request, options = nil
|
|
2378
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
2379
|
+
|
|
2380
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesStartRequest
|
|
2381
|
+
|
|
2382
|
+
# Converts hash and nil to an options object
|
|
2383
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
2384
|
+
|
|
2385
|
+
# Customize the options with defaults
|
|
2386
|
+
metadata = @config.rpcs.start.metadata.to_h
|
|
2387
|
+
|
|
2388
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
2389
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
2390
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
2391
|
+
gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION
|
|
2392
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
2393
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
2394
|
+
|
|
2395
|
+
header_params = {}
|
|
2396
|
+
if request.project
|
|
2397
|
+
header_params["project"] = request.project
|
|
2398
|
+
end
|
|
2399
|
+
if request.instance
|
|
2400
|
+
header_params["instance"] = request.instance
|
|
2401
|
+
end
|
|
2402
|
+
|
|
2403
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
2404
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
2405
|
+
|
|
2406
|
+
options.apply_defaults timeout: @config.rpcs.start.timeout,
|
|
2407
|
+
metadata: metadata,
|
|
2408
|
+
retry_policy: @config.rpcs.start.retry_policy
|
|
2409
|
+
|
|
2410
|
+
options.apply_defaults timeout: @config.timeout,
|
|
2411
|
+
metadata: @config.metadata,
|
|
2412
|
+
retry_policy: @config.retry_policy
|
|
2413
|
+
|
|
2414
|
+
@sql_instances_service_stub.call_rpc :start, request, options: options do |response, operation|
|
|
2415
|
+
yield response, operation if block_given?
|
|
2416
|
+
end
|
|
2417
|
+
rescue ::GRPC::BadStatus => e
|
|
2418
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
2419
|
+
end
|
|
2420
|
+
|
|
2421
|
+
##
|
|
2422
|
+
# Stops a Cloud SQL instance.
|
|
2423
|
+
#
|
|
2424
|
+
# @overload stop(request, options = nil)
|
|
2425
|
+
# Pass arguments to `stop` via a request object, either of type
|
|
2426
|
+
# {::Google::Cloud::Sql::V1beta4::SqlInstancesStopRequest} or an equivalent Hash.
|
|
2427
|
+
#
|
|
2428
|
+
# @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesStopRequest, ::Hash]
|
|
2429
|
+
# A request object representing the call parameters. Required. To specify no
|
|
2430
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
2431
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
2432
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
2433
|
+
#
|
|
2434
|
+
# @overload stop(instance: nil, project: nil, location: nil)
|
|
2435
|
+
# Pass arguments to `stop` via keyword arguments. Note that at
|
|
2436
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
2437
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
2438
|
+
#
|
|
2439
|
+
# @param instance [::String]
|
|
2440
|
+
# Required. Cloud SQL instance ID. This does not include the project ID.
|
|
2441
|
+
# @param project [::String]
|
|
2442
|
+
# Required. Project ID of the project that contains the instance to be
|
|
2443
|
+
# stopped.
|
|
2444
|
+
# @param location [::String]
|
|
2445
|
+
# Optional. The region of the Cloud SQL instance, for example `us-central1`.
|
|
2446
|
+
# If omitted, the region is determined from the instance.
|
|
2447
|
+
#
|
|
2448
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
2449
|
+
# @yieldparam response [::Google::Cloud::Sql::V1beta4::Operation]
|
|
2450
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
2451
|
+
#
|
|
2452
|
+
# @return [::Google::Cloud::Sql::V1beta4::Operation]
|
|
2453
|
+
#
|
|
2454
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
2455
|
+
#
|
|
2456
|
+
# @example Basic example
|
|
2457
|
+
# require "google/cloud/sql/v1beta4"
|
|
2458
|
+
#
|
|
2459
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
2460
|
+
# client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Client.new
|
|
2461
|
+
#
|
|
2462
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
2463
|
+
# request = Google::Cloud::Sql::V1beta4::SqlInstancesStopRequest.new
|
|
2464
|
+
#
|
|
2465
|
+
# # Call the stop method.
|
|
2466
|
+
# result = client.stop request
|
|
2467
|
+
#
|
|
2468
|
+
# # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
|
|
2469
|
+
# p result
|
|
2470
|
+
#
|
|
2471
|
+
def stop request, options = nil
|
|
2472
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
2473
|
+
|
|
2474
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesStopRequest
|
|
2475
|
+
|
|
2476
|
+
# Converts hash and nil to an options object
|
|
2477
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
2478
|
+
|
|
2479
|
+
# Customize the options with defaults
|
|
2480
|
+
metadata = @config.rpcs.stop.metadata.to_h
|
|
2481
|
+
|
|
2482
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
2483
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
2484
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
2485
|
+
gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION
|
|
2486
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
2487
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
2488
|
+
|
|
2489
|
+
header_params = {}
|
|
2490
|
+
if request.project
|
|
2491
|
+
header_params["project"] = request.project
|
|
2492
|
+
end
|
|
2493
|
+
if request.instance
|
|
2494
|
+
header_params["instance"] = request.instance
|
|
2495
|
+
end
|
|
2496
|
+
|
|
2497
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
2498
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
2499
|
+
|
|
2500
|
+
options.apply_defaults timeout: @config.rpcs.stop.timeout,
|
|
2501
|
+
metadata: metadata,
|
|
2502
|
+
retry_policy: @config.rpcs.stop.retry_policy
|
|
2503
|
+
|
|
2504
|
+
options.apply_defaults timeout: @config.timeout,
|
|
2505
|
+
metadata: @config.metadata,
|
|
2506
|
+
retry_policy: @config.retry_policy
|
|
2507
|
+
|
|
2508
|
+
@sql_instances_service_stub.call_rpc :stop, request, options: options do |response, operation|
|
|
2509
|
+
yield response, operation if block_given?
|
|
2510
|
+
end
|
|
2511
|
+
rescue ::GRPC::BadStatus => e
|
|
2512
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
2513
|
+
end
|
|
2514
|
+
|
|
2325
2515
|
##
|
|
2326
2516
|
# Restores a backup of a Cloud SQL instance. Using this operation might cause
|
|
2327
2517
|
# your instance to restart.
|
|
@@ -3857,6 +4047,100 @@ module Google
|
|
|
3857
4047
|
raise ::Google::Cloud::Error.from_error(e)
|
|
3858
4048
|
end
|
|
3859
4049
|
|
|
4050
|
+
##
|
|
4051
|
+
# Execute SQL statements in read-only mode.
|
|
4052
|
+
#
|
|
4053
|
+
# @overload execute_sql_read_only(request, options = nil)
|
|
4054
|
+
# Pass arguments to `execute_sql_read_only` via a request object, either of type
|
|
4055
|
+
# {::Google::Cloud::Sql::V1beta4::SqlInstancesExecuteSqlReadOnlyRequest} or an equivalent Hash.
|
|
4056
|
+
#
|
|
4057
|
+
# @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesExecuteSqlReadOnlyRequest, ::Hash]
|
|
4058
|
+
# A request object representing the call parameters. Required. To specify no
|
|
4059
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
4060
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
4061
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
4062
|
+
#
|
|
4063
|
+
# @overload execute_sql_read_only(instance: nil, project: nil, body: nil, location: nil)
|
|
4064
|
+
# Pass arguments to `execute_sql_read_only` via keyword arguments. Note that at
|
|
4065
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
4066
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
4067
|
+
#
|
|
4068
|
+
# @param instance [::String]
|
|
4069
|
+
# Required. Database instance ID. This does not include the project ID.
|
|
4070
|
+
# @param project [::String]
|
|
4071
|
+
# Required. Project ID of the project that contains the instance.
|
|
4072
|
+
# @param body [::Google::Cloud::Sql::V1beta4::ExecuteSqlReadOnlyPayload, ::Hash]
|
|
4073
|
+
# Required. The request body.
|
|
4074
|
+
# @param location [::String]
|
|
4075
|
+
# Optional. Region of the Cloud SQL instance.
|
|
4076
|
+
#
|
|
4077
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
4078
|
+
# @yieldparam response [::Google::Cloud::Sql::V1beta4::SqlInstancesExecuteSqlReadOnlyResponse]
|
|
4079
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
4080
|
+
#
|
|
4081
|
+
# @return [::Google::Cloud::Sql::V1beta4::SqlInstancesExecuteSqlReadOnlyResponse]
|
|
4082
|
+
#
|
|
4083
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
4084
|
+
#
|
|
4085
|
+
# @example Basic example
|
|
4086
|
+
# require "google/cloud/sql/v1beta4"
|
|
4087
|
+
#
|
|
4088
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
4089
|
+
# client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Client.new
|
|
4090
|
+
#
|
|
4091
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
4092
|
+
# request = Google::Cloud::Sql::V1beta4::SqlInstancesExecuteSqlReadOnlyRequest.new
|
|
4093
|
+
#
|
|
4094
|
+
# # Call the execute_sql_read_only method.
|
|
4095
|
+
# result = client.execute_sql_read_only request
|
|
4096
|
+
#
|
|
4097
|
+
# # The returned object is of type Google::Cloud::Sql::V1beta4::SqlInstancesExecuteSqlReadOnlyResponse.
|
|
4098
|
+
# p result
|
|
4099
|
+
#
|
|
4100
|
+
def execute_sql_read_only request, options = nil
|
|
4101
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
4102
|
+
|
|
4103
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesExecuteSqlReadOnlyRequest
|
|
4104
|
+
|
|
4105
|
+
# Converts hash and nil to an options object
|
|
4106
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
4107
|
+
|
|
4108
|
+
# Customize the options with defaults
|
|
4109
|
+
metadata = @config.rpcs.execute_sql_read_only.metadata.to_h
|
|
4110
|
+
|
|
4111
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
4112
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
4113
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
4114
|
+
gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION
|
|
4115
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
4116
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
4117
|
+
|
|
4118
|
+
header_params = {}
|
|
4119
|
+
if request.project
|
|
4120
|
+
header_params["project"] = request.project
|
|
4121
|
+
end
|
|
4122
|
+
if request.instance
|
|
4123
|
+
header_params["instance"] = request.instance
|
|
4124
|
+
end
|
|
4125
|
+
|
|
4126
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
4127
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
4128
|
+
|
|
4129
|
+
options.apply_defaults timeout: @config.rpcs.execute_sql_read_only.timeout,
|
|
4130
|
+
metadata: metadata,
|
|
4131
|
+
retry_policy: @config.rpcs.execute_sql_read_only.retry_policy
|
|
4132
|
+
|
|
4133
|
+
options.apply_defaults timeout: @config.timeout,
|
|
4134
|
+
metadata: @config.metadata,
|
|
4135
|
+
retry_policy: @config.retry_policy
|
|
4136
|
+
|
|
4137
|
+
@sql_instances_service_stub.call_rpc :execute_sql_read_only, request, options: options do |response, operation|
|
|
4138
|
+
yield response, operation if block_given?
|
|
4139
|
+
end
|
|
4140
|
+
rescue ::GRPC::BadStatus => e
|
|
4141
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
4142
|
+
end
|
|
4143
|
+
|
|
3860
4144
|
##
|
|
3861
4145
|
# Execute SQL statements.
|
|
3862
4146
|
#
|
|
@@ -4330,6 +4614,105 @@ module Google
|
|
|
4330
4614
|
raise ::Google::Cloud::Error.from_error(e)
|
|
4331
4615
|
end
|
|
4332
4616
|
|
|
4617
|
+
##
|
|
4618
|
+
# Repairs and recreates networking resources for a Cloud SQL instance. For
|
|
4619
|
+
# Private Service Connect (PSC), this operation recreates PSC DNS write
|
|
4620
|
+
# endpoints on specified VPC networks and reconciles Private Service Connect
|
|
4621
|
+
# connectivity infrastructure for the instance.
|
|
4622
|
+
#
|
|
4623
|
+
# @overload reconcile_networking(request, options = nil)
|
|
4624
|
+
# Pass arguments to `reconcile_networking` via a request object, either of type
|
|
4625
|
+
# {::Google::Cloud::Sql::V1beta4::SqlInstancesReconcileNetworkingRequest} or an equivalent Hash.
|
|
4626
|
+
#
|
|
4627
|
+
# @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesReconcileNetworkingRequest, ::Hash]
|
|
4628
|
+
# A request object representing the call parameters. Required. To specify no
|
|
4629
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
4630
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
4631
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
4632
|
+
#
|
|
4633
|
+
# @overload reconcile_networking(instance: nil, project: nil, psc_dns: nil, location: nil)
|
|
4634
|
+
# Pass arguments to `reconcile_networking` via keyword arguments. Note that at
|
|
4635
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
4636
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
4637
|
+
#
|
|
4638
|
+
# @param instance [::String]
|
|
4639
|
+
# Required. Cloud SQL instance ID.
|
|
4640
|
+
# @param project [::String]
|
|
4641
|
+
# Required. Project ID of the project that contains the instance.
|
|
4642
|
+
# @param psc_dns [::Google::Cloud::Sql::V1beta4::PscDnsReconcileNetworkingRequest, ::Hash]
|
|
4643
|
+
# Request to recreate Private Service Connect DNS write endpoints and
|
|
4644
|
+
# reconcile Private Service Connect connectivity infrastructure for the
|
|
4645
|
+
# instance.
|
|
4646
|
+
# @param location [::String]
|
|
4647
|
+
# Optional. Region of the Cloud SQL instance.
|
|
4648
|
+
#
|
|
4649
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
4650
|
+
# @yieldparam response [::Google::Cloud::Sql::V1beta4::Operation]
|
|
4651
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
4652
|
+
#
|
|
4653
|
+
# @return [::Google::Cloud::Sql::V1beta4::Operation]
|
|
4654
|
+
#
|
|
4655
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
4656
|
+
#
|
|
4657
|
+
# @example Basic example
|
|
4658
|
+
# require "google/cloud/sql/v1beta4"
|
|
4659
|
+
#
|
|
4660
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
4661
|
+
# client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Client.new
|
|
4662
|
+
#
|
|
4663
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
4664
|
+
# request = Google::Cloud::Sql::V1beta4::SqlInstancesReconcileNetworkingRequest.new
|
|
4665
|
+
#
|
|
4666
|
+
# # Call the reconcile_networking method.
|
|
4667
|
+
# result = client.reconcile_networking request
|
|
4668
|
+
#
|
|
4669
|
+
# # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
|
|
4670
|
+
# p result
|
|
4671
|
+
#
|
|
4672
|
+
def reconcile_networking request, options = nil
|
|
4673
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
4674
|
+
|
|
4675
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesReconcileNetworkingRequest
|
|
4676
|
+
|
|
4677
|
+
# Converts hash and nil to an options object
|
|
4678
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
4679
|
+
|
|
4680
|
+
# Customize the options with defaults
|
|
4681
|
+
metadata = @config.rpcs.reconcile_networking.metadata.to_h
|
|
4682
|
+
|
|
4683
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
4684
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
4685
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
4686
|
+
gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION
|
|
4687
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
4688
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
4689
|
+
|
|
4690
|
+
header_params = {}
|
|
4691
|
+
if request.project
|
|
4692
|
+
header_params["project"] = request.project
|
|
4693
|
+
end
|
|
4694
|
+
if request.instance
|
|
4695
|
+
header_params["instance"] = request.instance
|
|
4696
|
+
end
|
|
4697
|
+
|
|
4698
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
4699
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
4700
|
+
|
|
4701
|
+
options.apply_defaults timeout: @config.rpcs.reconcile_networking.timeout,
|
|
4702
|
+
metadata: metadata,
|
|
4703
|
+
retry_policy: @config.rpcs.reconcile_networking.retry_policy
|
|
4704
|
+
|
|
4705
|
+
options.apply_defaults timeout: @config.timeout,
|
|
4706
|
+
metadata: @config.metadata,
|
|
4707
|
+
retry_policy: @config.retry_policy
|
|
4708
|
+
|
|
4709
|
+
@sql_instances_service_stub.call_rpc :reconcile_networking, request, options: options do |response, operation|
|
|
4710
|
+
yield response, operation if block_given?
|
|
4711
|
+
end
|
|
4712
|
+
rescue ::GRPC::BadStatus => e
|
|
4713
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
4714
|
+
end
|
|
4715
|
+
|
|
4333
4716
|
##
|
|
4334
4717
|
# Configuration class for the SqlInstancesService API.
|
|
4335
4718
|
#
|
|
@@ -4626,6 +5009,16 @@ module Google
|
|
|
4626
5009
|
#
|
|
4627
5010
|
attr_reader :restart
|
|
4628
5011
|
##
|
|
5012
|
+
# RPC-specific configuration for `start`
|
|
5013
|
+
# @return [::Gapic::Config::Method]
|
|
5014
|
+
#
|
|
5015
|
+
attr_reader :start
|
|
5016
|
+
##
|
|
5017
|
+
# RPC-specific configuration for `stop`
|
|
5018
|
+
# @return [::Gapic::Config::Method]
|
|
5019
|
+
#
|
|
5020
|
+
attr_reader :stop
|
|
5021
|
+
##
|
|
4629
5022
|
# RPC-specific configuration for `restore_backup`
|
|
4630
5023
|
# @return [::Gapic::Config::Method]
|
|
4631
5024
|
#
|
|
@@ -4706,6 +5099,11 @@ module Google
|
|
|
4706
5099
|
#
|
|
4707
5100
|
attr_reader :get_latest_recovery_time
|
|
4708
5101
|
##
|
|
5102
|
+
# RPC-specific configuration for `execute_sql_read_only`
|
|
5103
|
+
# @return [::Gapic::Config::Method]
|
|
5104
|
+
#
|
|
5105
|
+
attr_reader :execute_sql_read_only
|
|
5106
|
+
##
|
|
4709
5107
|
# RPC-specific configuration for `execute_sql`
|
|
4710
5108
|
# @return [::Gapic::Config::Method]
|
|
4711
5109
|
#
|
|
@@ -4730,6 +5128,11 @@ module Google
|
|
|
4730
5128
|
# @return [::Gapic::Config::Method]
|
|
4731
5129
|
#
|
|
4732
5130
|
attr_reader :point_in_time_restore
|
|
5131
|
+
##
|
|
5132
|
+
# RPC-specific configuration for `reconcile_networking`
|
|
5133
|
+
# @return [::Gapic::Config::Method]
|
|
5134
|
+
#
|
|
5135
|
+
attr_reader :reconcile_networking
|
|
4733
5136
|
|
|
4734
5137
|
# @private
|
|
4735
5138
|
def initialize parent_rpcs = nil
|
|
@@ -4777,6 +5180,10 @@ module Google
|
|
|
4777
5180
|
@reset_ssl_config = ::Gapic::Config::Method.new reset_ssl_config_config
|
|
4778
5181
|
restart_config = parent_rpcs.restart if parent_rpcs.respond_to? :restart
|
|
4779
5182
|
@restart = ::Gapic::Config::Method.new restart_config
|
|
5183
|
+
start_config = parent_rpcs.start if parent_rpcs.respond_to? :start
|
|
5184
|
+
@start = ::Gapic::Config::Method.new start_config
|
|
5185
|
+
stop_config = parent_rpcs.stop if parent_rpcs.respond_to? :stop
|
|
5186
|
+
@stop = ::Gapic::Config::Method.new stop_config
|
|
4780
5187
|
restore_backup_config = parent_rpcs.restore_backup if parent_rpcs.respond_to? :restore_backup
|
|
4781
5188
|
@restore_backup = ::Gapic::Config::Method.new restore_backup_config
|
|
4782
5189
|
rotate_server_ca_config = parent_rpcs.rotate_server_ca if parent_rpcs.respond_to? :rotate_server_ca
|
|
@@ -4809,6 +5216,8 @@ module Google
|
|
|
4809
5216
|
@reset_replica_size = ::Gapic::Config::Method.new reset_replica_size_config
|
|
4810
5217
|
get_latest_recovery_time_config = parent_rpcs.get_latest_recovery_time if parent_rpcs.respond_to? :get_latest_recovery_time
|
|
4811
5218
|
@get_latest_recovery_time = ::Gapic::Config::Method.new get_latest_recovery_time_config
|
|
5219
|
+
execute_sql_read_only_config = parent_rpcs.execute_sql_read_only if parent_rpcs.respond_to? :execute_sql_read_only
|
|
5220
|
+
@execute_sql_read_only = ::Gapic::Config::Method.new execute_sql_read_only_config
|
|
4812
5221
|
execute_sql_config = parent_rpcs.execute_sql if parent_rpcs.respond_to? :execute_sql
|
|
4813
5222
|
@execute_sql = ::Gapic::Config::Method.new execute_sql_config
|
|
4814
5223
|
acquire_ssrs_lease_config = parent_rpcs.acquire_ssrs_lease if parent_rpcs.respond_to? :acquire_ssrs_lease
|
|
@@ -4819,6 +5228,8 @@ module Google
|
|
|
4819
5228
|
@pre_check_major_version_upgrade = ::Gapic::Config::Method.new pre_check_major_version_upgrade_config
|
|
4820
5229
|
point_in_time_restore_config = parent_rpcs.point_in_time_restore if parent_rpcs.respond_to? :point_in_time_restore
|
|
4821
5230
|
@point_in_time_restore = ::Gapic::Config::Method.new point_in_time_restore_config
|
|
5231
|
+
reconcile_networking_config = parent_rpcs.reconcile_networking if parent_rpcs.respond_to? :reconcile_networking
|
|
5232
|
+
@reconcile_networking = ::Gapic::Config::Method.new reconcile_networking_config
|
|
4822
5233
|
|
|
4823
5234
|
yield self if block_given?
|
|
4824
5235
|
end
|
|
@@ -113,6 +113,23 @@ module Google
|
|
|
113
113
|
"projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}"
|
|
114
114
|
end
|
|
115
115
|
|
|
116
|
+
##
|
|
117
|
+
# Create a fully-qualified Instance resource string.
|
|
118
|
+
#
|
|
119
|
+
# The resource will be in the following format:
|
|
120
|
+
#
|
|
121
|
+
# `projects/{project}/instances/{instance}`
|
|
122
|
+
#
|
|
123
|
+
# @param project [String]
|
|
124
|
+
# @param instance [String]
|
|
125
|
+
#
|
|
126
|
+
# @return [::String]
|
|
127
|
+
def instance_path project:, instance:
|
|
128
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
|
129
|
+
|
|
130
|
+
"projects/#{project}/instances/#{instance}"
|
|
131
|
+
end
|
|
132
|
+
|
|
116
133
|
##
|
|
117
134
|
# Create a fully-qualified Network resource string.
|
|
118
135
|
#
|