google-cloud-firestore-admin-v1 1.5.0 → 1.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/lib/google/cloud/firestore/admin/v1/firestore_admin/client.rb +162 -1
- data/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/client.rb +146 -1
- data/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/service_stub.rb +62 -0
- data/lib/google/cloud/firestore/admin/v1/version.rb +1 -1
- data/lib/google/firestore/admin/v1/database_pb.rb +1 -1
- data/lib/google/firestore/admin/v1/firestore_admin_pb.rb +5 -1
- data/lib/google/firestore/admin/v1/firestore_admin_services_pb.rb +18 -0
- data/lib/google/firestore/admin/v1/operation_pb.rb +4 -1
- data/lib/google/firestore/admin/v1/snapshot_pb.rb +49 -0
- data/proto_docs/google/api/routing.rb +459 -0
- data/proto_docs/google/firestore/admin/v1/database.rb +15 -0
- data/proto_docs/google/firestore/admin/v1/firestore_admin.rb +66 -0
- data/proto_docs/google/firestore/admin/v1/operation.rb +25 -0
- data/proto_docs/google/firestore/admin/v1/snapshot.rb +48 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c801c56c700954feeeb3b4d13895cb83586647314648d152e22977446ffd68be
|
4
|
+
data.tar.gz: 3f2b31b3ee99c3a0c607dc7cf6ce7ac1b0bd3a42c0d488ad1f2bcd4801a96b03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f33929e454f7ebbbb6a43f06930866502abb8581f576eea8dc9dbac4c5de184b51ad213eefdcb8116d904561b9b8af7857e165c10b2ce6992e92cc33b572bc79
|
7
|
+
data.tar.gz: 894b336175c2b3da8391cd1c40849a31f3f56ea8510eaa98c3ea81e052113acf9a15549f288e8e519561b98f90805d1bd43753123776b8894ad126b5bc7179df
|
@@ -138,6 +138,8 @@ module Google
|
|
138
138
|
|
139
139
|
default_config.rpcs.restore_database.timeout = 120.0
|
140
140
|
|
141
|
+
default_config.rpcs.clone_database.timeout = 120.0
|
142
|
+
|
141
143
|
default_config
|
142
144
|
end
|
143
145
|
yield @configure if block_given?
|
@@ -2724,7 +2726,7 @@ module Google
|
|
2724
2726
|
# @param options [::Gapic::CallOptions, ::Hash]
|
2725
2727
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2726
2728
|
#
|
2727
|
-
# @overload restore_database(parent: nil, database_id: nil, backup: nil, encryption_config: nil)
|
2729
|
+
# @overload restore_database(parent: nil, database_id: nil, backup: nil, encryption_config: nil, tags: nil)
|
2728
2730
|
# Pass arguments to `restore_database` via keyword arguments. Note that at
|
2729
2731
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
2730
2732
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -2756,6 +2758,11 @@ module Google
|
|
2756
2758
|
# If this field is not specified, the restored database will use
|
2757
2759
|
# the same encryption configuration as the backup, namely
|
2758
2760
|
# {::Google::Cloud::Firestore::Admin::V1::Database::EncryptionConfig#use_source_encryption use_source_encryption}.
|
2761
|
+
# @param tags [::Hash{::String => ::String}]
|
2762
|
+
# Optional. Immutable. Tags to be bound to the restored database.
|
2763
|
+
#
|
2764
|
+
# The tags should be provided in the format of
|
2765
|
+
# `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
|
2759
2766
|
#
|
2760
2767
|
# @yield [response, operation] Access the result along with the RPC operation
|
2761
2768
|
# @yieldparam response [::Gapic::Operation]
|
@@ -3271,6 +3278,153 @@ module Google
|
|
3271
3278
|
raise ::Google::Cloud::Error.from_error(e)
|
3272
3279
|
end
|
3273
3280
|
|
3281
|
+
##
|
3282
|
+
# Creates a new database by cloning an existing one.
|
3283
|
+
#
|
3284
|
+
# The new database must be in the same cloud region or multi-region location
|
3285
|
+
# as the existing database. This behaves similar to
|
3286
|
+
# {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_database FirestoreAdmin.CreateDatabase}
|
3287
|
+
# except instead of creating a new empty database, a new database is created
|
3288
|
+
# with the database type, index configuration, and documents from an existing
|
3289
|
+
# database.
|
3290
|
+
#
|
3291
|
+
# The {::Google::Longrunning::Operation long-running operation} can be used to
|
3292
|
+
# track the progress of the clone, with the Operation's
|
3293
|
+
# {::Google::Longrunning::Operation#metadata metadata} field type being the
|
3294
|
+
# {::Google::Cloud::Firestore::Admin::V1::CloneDatabaseMetadata CloneDatabaseMetadata}.
|
3295
|
+
# The {::Google::Longrunning::Operation#response response} type is the
|
3296
|
+
# {::Google::Cloud::Firestore::Admin::V1::Database Database} if the clone was
|
3297
|
+
# successful. The new database is not readable or writeable until the LRO has
|
3298
|
+
# completed.
|
3299
|
+
#
|
3300
|
+
# @overload clone_database(request, options = nil)
|
3301
|
+
# Pass arguments to `clone_database` via a request object, either of type
|
3302
|
+
# {::Google::Cloud::Firestore::Admin::V1::CloneDatabaseRequest} or an equivalent Hash.
|
3303
|
+
#
|
3304
|
+
# @param request [::Google::Cloud::Firestore::Admin::V1::CloneDatabaseRequest, ::Hash]
|
3305
|
+
# A request object representing the call parameters. Required. To specify no
|
3306
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3307
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3308
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
3309
|
+
#
|
3310
|
+
# @overload clone_database(parent: nil, database_id: nil, pitr_snapshot: nil, encryption_config: nil, tags: nil)
|
3311
|
+
# Pass arguments to `clone_database` via keyword arguments. Note that at
|
3312
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3313
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3314
|
+
#
|
3315
|
+
# @param parent [::String]
|
3316
|
+
# Required. The project to clone the database in. Format is
|
3317
|
+
# `projects/{project_id}`.
|
3318
|
+
# @param database_id [::String]
|
3319
|
+
# Required. The ID to use for the database, which will become the final
|
3320
|
+
# component of the database's resource name. This database ID must not be
|
3321
|
+
# associated with an existing database.
|
3322
|
+
#
|
3323
|
+
# This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
|
3324
|
+
# with first character a letter and the last a letter or a number. Must not
|
3325
|
+
# be UUID-like /[0-9a-f]\\{8}(-[0-9a-f]\\{4})\\{3}-[0-9a-f]\\{12}/.
|
3326
|
+
#
|
3327
|
+
# "(default)" database ID is also valid.
|
3328
|
+
# @param pitr_snapshot [::Google::Cloud::Firestore::Admin::V1::PitrSnapshot, ::Hash]
|
3329
|
+
# Required. Specification of the PITR data to clone from. The source database
|
3330
|
+
# must exist.
|
3331
|
+
#
|
3332
|
+
# The cloned database will be created in the same location as the source
|
3333
|
+
# database.
|
3334
|
+
# @param encryption_config [::Google::Cloud::Firestore::Admin::V1::Database::EncryptionConfig, ::Hash]
|
3335
|
+
# Optional. Encryption configuration for the cloned database.
|
3336
|
+
#
|
3337
|
+
# If this field is not specified, the cloned database will use
|
3338
|
+
# the same encryption configuration as the source database, namely
|
3339
|
+
# {::Google::Cloud::Firestore::Admin::V1::Database::EncryptionConfig#use_source_encryption use_source_encryption}.
|
3340
|
+
# @param tags [::Hash{::String => ::String}]
|
3341
|
+
# Optional. Immutable. Tags to be bound to the cloned database.
|
3342
|
+
#
|
3343
|
+
# The tags should be provided in the format of
|
3344
|
+
# `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
|
3345
|
+
#
|
3346
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
3347
|
+
# @yieldparam response [::Gapic::Operation]
|
3348
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
3349
|
+
#
|
3350
|
+
# @return [::Gapic::Operation]
|
3351
|
+
#
|
3352
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
3353
|
+
#
|
3354
|
+
# @example Basic example
|
3355
|
+
# require "google/cloud/firestore/admin/v1"
|
3356
|
+
#
|
3357
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3358
|
+
# client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new
|
3359
|
+
#
|
3360
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3361
|
+
# request = Google::Cloud::Firestore::Admin::V1::CloneDatabaseRequest.new
|
3362
|
+
#
|
3363
|
+
# # Call the clone_database method.
|
3364
|
+
# result = client.clone_database request
|
3365
|
+
#
|
3366
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
3367
|
+
# # check the status of an operation, cancel it, or wait for results.
|
3368
|
+
# # Here is how to wait for a response.
|
3369
|
+
# result.wait_until_done! timeout: 60
|
3370
|
+
# if result.response?
|
3371
|
+
# p result.response
|
3372
|
+
# else
|
3373
|
+
# puts "No response received."
|
3374
|
+
# end
|
3375
|
+
#
|
3376
|
+
def clone_database request, options = nil
|
3377
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3378
|
+
|
3379
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CloneDatabaseRequest
|
3380
|
+
|
3381
|
+
# Converts hash and nil to an options object
|
3382
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3383
|
+
|
3384
|
+
# Customize the options with defaults
|
3385
|
+
metadata = @config.rpcs.clone_database.metadata.to_h
|
3386
|
+
|
3387
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3388
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3389
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3390
|
+
gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION
|
3391
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3392
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3393
|
+
|
3394
|
+
header_params = {}
|
3395
|
+
if request.pitr_snapshot&.database
|
3396
|
+
regex_match = %r{^projects/(?<project_id>[^/]+)(?:/.*)?$}.match request.pitr_snapshot.database
|
3397
|
+
if regex_match
|
3398
|
+
header_params["project_id"] = regex_match["project_id".to_s]
|
3399
|
+
end
|
3400
|
+
end
|
3401
|
+
if request.pitr_snapshot&.database
|
3402
|
+
regex_match = %r{^projects/[^/]+/databases/(?<database_id>[^/]+)(?:/.*)?$}.match request.pitr_snapshot.database
|
3403
|
+
if regex_match
|
3404
|
+
header_params["database_id"] = regex_match["database_id".to_s]
|
3405
|
+
end
|
3406
|
+
end
|
3407
|
+
|
3408
|
+
request_params_header = URI.encode_www_form header_params
|
3409
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
3410
|
+
|
3411
|
+
options.apply_defaults timeout: @config.rpcs.clone_database.timeout,
|
3412
|
+
metadata: metadata,
|
3413
|
+
retry_policy: @config.rpcs.clone_database.retry_policy
|
3414
|
+
|
3415
|
+
options.apply_defaults timeout: @config.timeout,
|
3416
|
+
metadata: @config.metadata,
|
3417
|
+
retry_policy: @config.retry_policy
|
3418
|
+
|
3419
|
+
@firestore_admin_stub.call_rpc :clone_database, request, options: options do |response, operation|
|
3420
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
3421
|
+
yield response, operation if block_given?
|
3422
|
+
throw :response, response
|
3423
|
+
end
|
3424
|
+
rescue ::GRPC::BadStatus => e
|
3425
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3426
|
+
end
|
3427
|
+
|
3274
3428
|
##
|
3275
3429
|
# Configuration class for the FirestoreAdmin API.
|
3276
3430
|
#
|
@@ -3592,6 +3746,11 @@ module Google
|
|
3592
3746
|
# @return [::Gapic::Config::Method]
|
3593
3747
|
#
|
3594
3748
|
attr_reader :delete_backup_schedule
|
3749
|
+
##
|
3750
|
+
# RPC-specific configuration for `clone_database`
|
3751
|
+
# @return [::Gapic::Config::Method]
|
3752
|
+
#
|
3753
|
+
attr_reader :clone_database
|
3595
3754
|
|
3596
3755
|
# @private
|
3597
3756
|
def initialize parent_rpcs = nil
|
@@ -3657,6 +3816,8 @@ module Google
|
|
3657
3816
|
@update_backup_schedule = ::Gapic::Config::Method.new update_backup_schedule_config
|
3658
3817
|
delete_backup_schedule_config = parent_rpcs.delete_backup_schedule if parent_rpcs.respond_to? :delete_backup_schedule
|
3659
3818
|
@delete_backup_schedule = ::Gapic::Config::Method.new delete_backup_schedule_config
|
3819
|
+
clone_database_config = parent_rpcs.clone_database if parent_rpcs.respond_to? :clone_database
|
3820
|
+
@clone_database = ::Gapic::Config::Method.new clone_database_config
|
3660
3821
|
|
3661
3822
|
yield self if block_given?
|
3662
3823
|
end
|
@@ -140,6 +140,8 @@ module Google
|
|
140
140
|
|
141
141
|
default_config.rpcs.restore_database.timeout = 120.0
|
142
142
|
|
143
|
+
default_config.rpcs.clone_database.timeout = 120.0
|
144
|
+
|
143
145
|
default_config
|
144
146
|
end
|
145
147
|
yield @configure if block_given?
|
@@ -2542,7 +2544,7 @@ module Google
|
|
2542
2544
|
# @param options [::Gapic::CallOptions, ::Hash]
|
2543
2545
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2544
2546
|
#
|
2545
|
-
# @overload restore_database(parent: nil, database_id: nil, backup: nil, encryption_config: nil)
|
2547
|
+
# @overload restore_database(parent: nil, database_id: nil, backup: nil, encryption_config: nil, tags: nil)
|
2546
2548
|
# Pass arguments to `restore_database` via keyword arguments. Note that at
|
2547
2549
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
2548
2550
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -2574,6 +2576,11 @@ module Google
|
|
2574
2576
|
# If this field is not specified, the restored database will use
|
2575
2577
|
# the same encryption configuration as the backup, namely
|
2576
2578
|
# {::Google::Cloud::Firestore::Admin::V1::Database::EncryptionConfig#use_source_encryption use_source_encryption}.
|
2579
|
+
# @param tags [::Hash{::String => ::String}]
|
2580
|
+
# Optional. Immutable. Tags to be bound to the restored database.
|
2581
|
+
#
|
2582
|
+
# The tags should be provided in the format of
|
2583
|
+
# `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
|
2577
2584
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
2578
2585
|
# @yieldparam result [::Gapic::Operation]
|
2579
2586
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -3047,6 +3054,137 @@ module Google
|
|
3047
3054
|
raise ::Google::Cloud::Error.from_error(e)
|
3048
3055
|
end
|
3049
3056
|
|
3057
|
+
##
|
3058
|
+
# Creates a new database by cloning an existing one.
|
3059
|
+
#
|
3060
|
+
# The new database must be in the same cloud region or multi-region location
|
3061
|
+
# as the existing database. This behaves similar to
|
3062
|
+
# {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#create_database FirestoreAdmin.CreateDatabase}
|
3063
|
+
# except instead of creating a new empty database, a new database is created
|
3064
|
+
# with the database type, index configuration, and documents from an existing
|
3065
|
+
# database.
|
3066
|
+
#
|
3067
|
+
# The {::Google::Longrunning::Operation long-running operation} can be used to
|
3068
|
+
# track the progress of the clone, with the Operation's
|
3069
|
+
# {::Google::Longrunning::Operation#metadata metadata} field type being the
|
3070
|
+
# {::Google::Cloud::Firestore::Admin::V1::CloneDatabaseMetadata CloneDatabaseMetadata}.
|
3071
|
+
# The {::Google::Longrunning::Operation#response response} type is the
|
3072
|
+
# {::Google::Cloud::Firestore::Admin::V1::Database Database} if the clone was
|
3073
|
+
# successful. The new database is not readable or writeable until the LRO has
|
3074
|
+
# completed.
|
3075
|
+
#
|
3076
|
+
# @overload clone_database(request, options = nil)
|
3077
|
+
# Pass arguments to `clone_database` via a request object, either of type
|
3078
|
+
# {::Google::Cloud::Firestore::Admin::V1::CloneDatabaseRequest} or an equivalent Hash.
|
3079
|
+
#
|
3080
|
+
# @param request [::Google::Cloud::Firestore::Admin::V1::CloneDatabaseRequest, ::Hash]
|
3081
|
+
# A request object representing the call parameters. Required. To specify no
|
3082
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3083
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3084
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
3085
|
+
#
|
3086
|
+
# @overload clone_database(parent: nil, database_id: nil, pitr_snapshot: nil, encryption_config: nil, tags: nil)
|
3087
|
+
# Pass arguments to `clone_database` via keyword arguments. Note that at
|
3088
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3089
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3090
|
+
#
|
3091
|
+
# @param parent [::String]
|
3092
|
+
# Required. The project to clone the database in. Format is
|
3093
|
+
# `projects/{project_id}`.
|
3094
|
+
# @param database_id [::String]
|
3095
|
+
# Required. The ID to use for the database, which will become the final
|
3096
|
+
# component of the database's resource name. This database ID must not be
|
3097
|
+
# associated with an existing database.
|
3098
|
+
#
|
3099
|
+
# This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
|
3100
|
+
# with first character a letter and the last a letter or a number. Must not
|
3101
|
+
# be UUID-like /[0-9a-f]\\{8}(-[0-9a-f]\\{4})\\{3}-[0-9a-f]\\{12}/.
|
3102
|
+
#
|
3103
|
+
# "(default)" database ID is also valid.
|
3104
|
+
# @param pitr_snapshot [::Google::Cloud::Firestore::Admin::V1::PitrSnapshot, ::Hash]
|
3105
|
+
# Required. Specification of the PITR data to clone from. The source database
|
3106
|
+
# must exist.
|
3107
|
+
#
|
3108
|
+
# The cloned database will be created in the same location as the source
|
3109
|
+
# database.
|
3110
|
+
# @param encryption_config [::Google::Cloud::Firestore::Admin::V1::Database::EncryptionConfig, ::Hash]
|
3111
|
+
# Optional. Encryption configuration for the cloned database.
|
3112
|
+
#
|
3113
|
+
# If this field is not specified, the cloned database will use
|
3114
|
+
# the same encryption configuration as the source database, namely
|
3115
|
+
# {::Google::Cloud::Firestore::Admin::V1::Database::EncryptionConfig#use_source_encryption use_source_encryption}.
|
3116
|
+
# @param tags [::Hash{::String => ::String}]
|
3117
|
+
# Optional. Immutable. Tags to be bound to the cloned database.
|
3118
|
+
#
|
3119
|
+
# The tags should be provided in the format of
|
3120
|
+
# `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
|
3121
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
3122
|
+
# @yieldparam result [::Gapic::Operation]
|
3123
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
3124
|
+
#
|
3125
|
+
# @return [::Gapic::Operation]
|
3126
|
+
#
|
3127
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
3128
|
+
#
|
3129
|
+
# @example Basic example
|
3130
|
+
# require "google/cloud/firestore/admin/v1"
|
3131
|
+
#
|
3132
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3133
|
+
# client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
|
3134
|
+
#
|
3135
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3136
|
+
# request = Google::Cloud::Firestore::Admin::V1::CloneDatabaseRequest.new
|
3137
|
+
#
|
3138
|
+
# # Call the clone_database method.
|
3139
|
+
# result = client.clone_database request
|
3140
|
+
#
|
3141
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
3142
|
+
# # check the status of an operation, cancel it, or wait for results.
|
3143
|
+
# # Here is how to wait for a response.
|
3144
|
+
# result.wait_until_done! timeout: 60
|
3145
|
+
# if result.response?
|
3146
|
+
# p result.response
|
3147
|
+
# else
|
3148
|
+
# puts "No response received."
|
3149
|
+
# end
|
3150
|
+
#
|
3151
|
+
def clone_database request, options = nil
|
3152
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3153
|
+
|
3154
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CloneDatabaseRequest
|
3155
|
+
|
3156
|
+
# Converts hash and nil to an options object
|
3157
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3158
|
+
|
3159
|
+
# Customize the options with defaults
|
3160
|
+
call_metadata = @config.rpcs.clone_database.metadata.to_h
|
3161
|
+
|
3162
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3163
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3164
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3165
|
+
gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION,
|
3166
|
+
transports_version_send: [:rest]
|
3167
|
+
|
3168
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3169
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3170
|
+
|
3171
|
+
options.apply_defaults timeout: @config.rpcs.clone_database.timeout,
|
3172
|
+
metadata: call_metadata,
|
3173
|
+
retry_policy: @config.rpcs.clone_database.retry_policy
|
3174
|
+
|
3175
|
+
options.apply_defaults timeout: @config.timeout,
|
3176
|
+
metadata: @config.metadata,
|
3177
|
+
retry_policy: @config.retry_policy
|
3178
|
+
|
3179
|
+
@firestore_admin_stub.clone_database request, options do |result, operation|
|
3180
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
3181
|
+
yield result, operation if block_given?
|
3182
|
+
throw :response, result
|
3183
|
+
end
|
3184
|
+
rescue ::Gapic::Rest::Error => e
|
3185
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3186
|
+
end
|
3187
|
+
|
3050
3188
|
##
|
3051
3189
|
# Configuration class for the FirestoreAdmin REST API.
|
3052
3190
|
#
|
@@ -3348,6 +3486,11 @@ module Google
|
|
3348
3486
|
# @return [::Gapic::Config::Method]
|
3349
3487
|
#
|
3350
3488
|
attr_reader :delete_backup_schedule
|
3489
|
+
##
|
3490
|
+
# RPC-specific configuration for `clone_database`
|
3491
|
+
# @return [::Gapic::Config::Method]
|
3492
|
+
#
|
3493
|
+
attr_reader :clone_database
|
3351
3494
|
|
3352
3495
|
# @private
|
3353
3496
|
def initialize parent_rpcs = nil
|
@@ -3413,6 +3556,8 @@ module Google
|
|
3413
3556
|
@update_backup_schedule = ::Gapic::Config::Method.new update_backup_schedule_config
|
3414
3557
|
delete_backup_schedule_config = parent_rpcs.delete_backup_schedule if parent_rpcs.respond_to? :delete_backup_schedule
|
3415
3558
|
@delete_backup_schedule = ::Gapic::Config::Method.new delete_backup_schedule_config
|
3559
|
+
clone_database_config = parent_rpcs.clone_database if parent_rpcs.respond_to? :clone_database
|
3560
|
+
@clone_database = ::Gapic::Config::Method.new clone_database_config
|
3416
3561
|
|
3417
3562
|
yield self if block_given?
|
3418
3563
|
end
|
@@ -1314,6 +1314,46 @@ module Google
|
|
1314
1314
|
end
|
1315
1315
|
end
|
1316
1316
|
|
1317
|
+
##
|
1318
|
+
# Baseline implementation for the clone_database REST call
|
1319
|
+
#
|
1320
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::CloneDatabaseRequest]
|
1321
|
+
# A request object representing the call parameters. Required.
|
1322
|
+
# @param options [::Gapic::CallOptions]
|
1323
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1324
|
+
#
|
1325
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1326
|
+
# @yieldparam result [::Google::Longrunning::Operation]
|
1327
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1328
|
+
#
|
1329
|
+
# @return [::Google::Longrunning::Operation]
|
1330
|
+
# A result object deserialized from the server's reply
|
1331
|
+
def clone_database request_pb, options = nil
|
1332
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
1333
|
+
|
1334
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_clone_database_request request_pb
|
1335
|
+
query_string_params = if query_string_params.any?
|
1336
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
1337
|
+
else
|
1338
|
+
{}
|
1339
|
+
end
|
1340
|
+
|
1341
|
+
response = @client_stub.make_http_request(
|
1342
|
+
verb,
|
1343
|
+
uri: uri,
|
1344
|
+
body: body || "",
|
1345
|
+
params: query_string_params,
|
1346
|
+
method_name: "clone_database",
|
1347
|
+
options: options
|
1348
|
+
)
|
1349
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
1350
|
+
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
1351
|
+
catch :response do
|
1352
|
+
yield result, operation if block_given?
|
1353
|
+
result
|
1354
|
+
end
|
1355
|
+
end
|
1356
|
+
|
1317
1357
|
##
|
1318
1358
|
# @private
|
1319
1359
|
#
|
@@ -1978,6 +2018,28 @@ module Google
|
|
1978
2018
|
)
|
1979
2019
|
transcoder.transcode request_pb
|
1980
2020
|
end
|
2021
|
+
|
2022
|
+
##
|
2023
|
+
# @private
|
2024
|
+
#
|
2025
|
+
# GRPC transcoding helper method for the clone_database REST call
|
2026
|
+
#
|
2027
|
+
# @param request_pb [::Google::Cloud::Firestore::Admin::V1::CloneDatabaseRequest]
|
2028
|
+
# A request object representing the call parameters. Required.
|
2029
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
2030
|
+
# Uri, Body, Query string parameters
|
2031
|
+
def self.transcode_clone_database_request request_pb
|
2032
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
2033
|
+
.with_bindings(
|
2034
|
+
uri_method: :post,
|
2035
|
+
uri_template: "/v1/{parent}/databases:clone",
|
2036
|
+
body: "*",
|
2037
|
+
matches: [
|
2038
|
+
["parent", %r{^projects/[^/]+/?$}, false]
|
2039
|
+
]
|
2040
|
+
)
|
2041
|
+
transcoder.transcode request_pb
|
2042
|
+
end
|
1981
2043
|
end
|
1982
2044
|
end
|
1983
2045
|
end
|
@@ -10,7 +10,7 @@ require 'google/protobuf/duration_pb'
|
|
10
10
|
require 'google/protobuf/timestamp_pb'
|
11
11
|
|
12
12
|
|
13
|
-
descriptor_data = "\n(google/firestore/admin/v1/database.proto\x12\x19google.firestore.admin.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\
|
13
|
+
descriptor_data = "\n(google/firestore/admin/v1/database.proto\x12\x19google.firestore.admin.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa3\x16\n\x08\x44\x61tabase\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x0blocation_id\x18\t \x01(\t\x12>\n\x04type\x18\n \x01(\x0e\x32\x30.google.firestore.admin.v1.Database.DatabaseType\x12M\n\x10\x63oncurrency_mode\x18\x0f \x01(\x0e\x32\x33.google.firestore.admin.v1.Database.ConcurrencyMode\x12@\n\x18version_retention_period\x18\x11 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x03\x12>\n\x15\x65\x61rliest_version_time\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12l\n!point_in_time_recovery_enablement\x18\x15 \x01(\x0e\x32\x41.google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement\x12\x61\n\x1b\x61pp_engine_integration_mode\x18\x13 \x01(\x0e\x32<.google.firestore.admin.v1.Database.AppEngineIntegrationMode\x12\x17\n\nkey_prefix\x18\x14 \x01(\tB\x03\xe0\x41\x03\x12Z\n\x17\x64\x65lete_protection_state\x18\x16 \x01(\x0e\x32\x39.google.firestore.admin.v1.Database.DeleteProtectionState\x12H\n\x0b\x63mek_config\x18\x17 \x01(\x0b\x32..google.firestore.admin.v1.Database.CmekConfigB\x03\xe0\x41\x01\x12\x18\n\x0bprevious_id\x18\x19 \x01(\tB\x03\xe0\x41\x03\x12H\n\x0bsource_info\x18\x1a \x01(\x0b\x32..google.firestore.admin.v1.Database.SourceInfoB\x03\xe0\x41\x03\x12\x46\n\x04tags\x18\x1d \x03(\x0b\x32-.google.firestore.admin.v1.Database.TagsEntryB\t\xe0\x41\x04\xe0\x41\x05\xe0\x41\x01\x12\x1b\n\tfree_tier\x18\x1e \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x0c\n\x04\x65tag\x18\x63 \x01(\t\x12R\n\x10\x64\x61tabase_edition\x18\x1c \x01(\x0e\x32\x33.google.firestore.admin.v1.Database.DatabaseEditionB\x03\xe0\x41\x05\x1aH\n\nCmekConfig\x12\x19\n\x0ckms_key_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1f\n\x12\x61\x63tive_key_version\x18\x02 \x03(\tB\x03\xe0\x41\x03\x1a\xe7\x01\n\nSourceInfo\x12M\n\x06\x62\x61\x63kup\x18\x01 \x01(\x0b\x32;.google.firestore.admin.v1.Database.SourceInfo.BackupSourceH\x00\x12:\n\toperation\x18\x03 \x01(\tB\'\xfa\x41$\n\"firestore.googleapis.com/Operation\x1a\x44\n\x0c\x42\x61\x63kupSource\x12\x34\n\x06\x62\x61\x63kup\x18\x01 \x01(\tB$\xfa\x41!\n\x1f\x66irestore.googleapis.com/BackupB\x08\n\x06source\x1a\x88\x04\n\x10\x45ncryptionConfig\x12x\n\x19google_default_encryption\x18\x01 \x01(\x0b\x32S.google.firestore.admin.v1.Database.EncryptionConfig.GoogleDefaultEncryptionOptionsH\x00\x12m\n\x15use_source_encryption\x18\x02 \x01(\x0b\x32L.google.firestore.admin.v1.Database.EncryptionConfig.SourceEncryptionOptionsH\x00\x12|\n\x1b\x63ustomer_managed_encryption\x18\x03 \x01(\x0b\x32U.google.firestore.admin.v1.Database.EncryptionConfig.CustomerManagedEncryptionOptionsH\x00\x1a \n\x1eGoogleDefaultEncryptionOptions\x1a\x19\n\x17SourceEncryptionOptions\x1a=\n CustomerManagedEncryptionOptions\x12\x19\n\x0ckms_key_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42\x11\n\x0f\x65ncryption_type\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"W\n\x0c\x44\x61tabaseType\x12\x1d\n\x19\x44\x41TABASE_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x46IRESTORE_NATIVE\x10\x01\x12\x12\n\x0e\x44\x41TASTORE_MODE\x10\x02\"w\n\x0f\x43oncurrencyMode\x12 \n\x1c\x43ONCURRENCY_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nOPTIMISTIC\x10\x01\x12\x0f\n\x0bPESSIMISTIC\x10\x02\x12!\n\x1dOPTIMISTIC_WITH_ENTITY_GROUPS\x10\x03\"\x9b\x01\n\x1dPointInTimeRecoveryEnablement\x12\x31\n-POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED\x10\x00\x12\"\n\x1ePOINT_IN_TIME_RECOVERY_ENABLED\x10\x01\x12#\n\x1fPOINT_IN_TIME_RECOVERY_DISABLED\x10\x02\"b\n\x18\x41ppEngineIntegrationMode\x12+\n\'APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\"\x7f\n\x15\x44\x65leteProtectionState\x12\'\n#DELETE_PROTECTION_STATE_UNSPECIFIED\x10\x00\x12\x1e\n\x1a\x44\x45LETE_PROTECTION_DISABLED\x10\x01\x12\x1d\n\x19\x44\x45LETE_PROTECTION_ENABLED\x10\x02\"Q\n\x0f\x44\x61tabaseEdition\x12 \n\x1c\x44\x41TABASE_EDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x0e\n\nENTERPRISE\x10\x02:R\xea\x41O\n!firestore.googleapis.com/Database\x12\'projects/{project}/databases/{database}R\x01\x01\x42\x0c\n\n_free_tierB\xc3\x02\n\x1d\x63om.google.firestore.admin.v1B\rDatabaseProtoP\x01Z9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1\xea\x41\x64\n\"firestore.googleapis.com/Operation\x12>projects/{project}/databases/{database}/operations/{operation}b\x06proto3"
|
14
14
|
|
15
15
|
pool = Google::Protobuf::DescriptorPool.generated_pool
|
16
16
|
|