google-cloud-spanner-admin-database-v1 0.18.0 → 0.20.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/spanner/admin/database/v1/database_admin/client.rb +658 -90
- data/lib/google/cloud/spanner/admin/database/v1/database_admin/operations.rb +13 -5
- data/lib/google/cloud/spanner/admin/database/v1/database_admin/paths.rb +21 -0
- data/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/client.rb +623 -90
- data/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/operations.rb +11 -4
- data/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/service_stub.rb +321 -0
- data/lib/google/cloud/spanner/admin/database/v1/database_admin/rest.rb +1 -1
- data/lib/google/cloud/spanner/admin/database/v1/database_admin.rb +1 -1
- data/lib/google/cloud/spanner/admin/database/v1/version.rb +1 -1
- data/lib/google/spanner/admin/database/v1/backup_pb.rb +2 -1
- data/lib/google/spanner/admin/database/v1/backup_schedule_pb.rb +65 -0
- data/lib/google/spanner/admin/database/v1/common_pb.rb +1 -1
- data/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb +2 -1
- data/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb +31 -16
- data/proto_docs/google/api/client.rb +4 -0
- data/proto_docs/google/spanner/admin/database/v1/backup.rb +158 -69
- data/proto_docs/google/spanner/admin/database/v1/backup_schedule.rb +213 -0
- data/proto_docs/google/spanner/admin/database/v1/common.rb +23 -6
- data/proto_docs/google/spanner/admin/database/v1/spanner_database_admin.rb +91 -54
- metadata +4 -2
@@ -36,10 +36,13 @@ module Google
|
|
36
36
|
# The Cloud Spanner Database Admin API can be used to:
|
37
37
|
# * create, drop, and list databases
|
38
38
|
# * update the schema of pre-existing databases
|
39
|
-
# * create, delete and list backups for a database
|
39
|
+
# * create, delete, copy and list backups for a database
|
40
40
|
# * restore a database from an existing backup
|
41
41
|
#
|
42
42
|
class Client
|
43
|
+
# @private
|
44
|
+
API_VERSION = ""
|
45
|
+
|
43
46
|
# @private
|
44
47
|
DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$"
|
45
48
|
|
@@ -159,6 +162,31 @@ module Google
|
|
159
162
|
initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
|
160
163
|
}
|
161
164
|
|
165
|
+
default_config.rpcs.create_backup_schedule.timeout = 3600.0
|
166
|
+
default_config.rpcs.create_backup_schedule.retry_policy = {
|
167
|
+
initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
|
168
|
+
}
|
169
|
+
|
170
|
+
default_config.rpcs.get_backup_schedule.timeout = 3600.0
|
171
|
+
default_config.rpcs.get_backup_schedule.retry_policy = {
|
172
|
+
initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
|
173
|
+
}
|
174
|
+
|
175
|
+
default_config.rpcs.update_backup_schedule.timeout = 3600.0
|
176
|
+
default_config.rpcs.update_backup_schedule.retry_policy = {
|
177
|
+
initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
|
178
|
+
}
|
179
|
+
|
180
|
+
default_config.rpcs.delete_backup_schedule.timeout = 3600.0
|
181
|
+
default_config.rpcs.delete_backup_schedule.retry_policy = {
|
182
|
+
initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
|
183
|
+
}
|
184
|
+
|
185
|
+
default_config.rpcs.list_backup_schedules.timeout = 3600.0
|
186
|
+
default_config.rpcs.list_backup_schedules.retry_policy = {
|
187
|
+
initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
|
188
|
+
}
|
189
|
+
|
162
190
|
default_config
|
163
191
|
end
|
164
192
|
yield @configure if block_given?
|
@@ -283,8 +311,9 @@ module Google
|
|
283
311
|
# defaults to the server's maximum allowed page size.
|
284
312
|
# @param page_token [::String]
|
285
313
|
# If non-empty, `page_token` should contain a
|
286
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse#next_page_token next_page_token}
|
287
|
-
#
|
314
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse#next_page_token next_page_token}
|
315
|
+
# from a previous
|
316
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse ListDatabasesResponse}.
|
288
317
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
289
318
|
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Database>]
|
290
319
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -323,12 +352,13 @@ module Google
|
|
323
352
|
# Customize the options with defaults
|
324
353
|
call_metadata = @config.rpcs.list_databases.metadata.to_h
|
325
354
|
|
326
|
-
# Set x-goog-api-client
|
355
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
327
356
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
328
357
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
329
358
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
330
359
|
transports_version_send: [:rest]
|
331
360
|
|
361
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
332
362
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
333
363
|
|
334
364
|
options.apply_defaults timeout: @config.rpcs.list_databases.timeout,
|
@@ -354,8 +384,8 @@ module Google
|
|
354
384
|
# have a name of the format `<database_name>/operations/<operation_id>` and
|
355
385
|
# can be used to track preparation of the database. The
|
356
386
|
# {::Google::Longrunning::Operation#metadata metadata} field type is
|
357
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata CreateDatabaseMetadata}.
|
358
|
-
# {::Google::Longrunning::Operation#response response} field type is
|
387
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata CreateDatabaseMetadata}.
|
388
|
+
# The {::Google::Longrunning::Operation#response response} field type is
|
359
389
|
# {::Google::Cloud::Spanner::Admin::Database::V1::Database Database}, if successful.
|
360
390
|
#
|
361
391
|
# @overload create_database(request, options = nil)
|
@@ -388,8 +418,8 @@ module Google
|
|
388
418
|
# statements execute atomically with the creation of the database:
|
389
419
|
# if there is an error in any statement, the database is not created.
|
390
420
|
# @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionConfig, ::Hash]
|
391
|
-
# Optional. The encryption configuration for the database. If this field is
|
392
|
-
# specified, Cloud Spanner will encrypt/decrypt all data at rest using
|
421
|
+
# Optional. The encryption configuration for the database. If this field is
|
422
|
+
# not specified, Cloud Spanner will encrypt/decrypt all data at rest using
|
393
423
|
# Google default encryption.
|
394
424
|
# @param database_dialect [::Google::Cloud::Spanner::Admin::Database::V1::DatabaseDialect]
|
395
425
|
# Optional. The dialect of the Cloud Spanner Database.
|
@@ -450,12 +480,13 @@ module Google
|
|
450
480
|
# Customize the options with defaults
|
451
481
|
call_metadata = @config.rpcs.create_database.metadata.to_h
|
452
482
|
|
453
|
-
# Set x-goog-api-client
|
483
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
454
484
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
455
485
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
456
486
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
457
487
|
transports_version_send: [:rest]
|
458
488
|
|
489
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
459
490
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
460
491
|
|
461
492
|
options.apply_defaults timeout: @config.rpcs.create_database.timeout,
|
@@ -530,12 +561,13 @@ module Google
|
|
530
561
|
# Customize the options with defaults
|
531
562
|
call_metadata = @config.rpcs.get_database.metadata.to_h
|
532
563
|
|
533
|
-
# Set x-goog-api-client
|
564
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
534
565
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
535
566
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
536
567
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
537
568
|
transports_version_send: [:rest]
|
538
569
|
|
570
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
539
571
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
540
572
|
|
541
573
|
options.apply_defaults timeout: @config.rpcs.get_database.timeout,
|
@@ -655,12 +687,13 @@ module Google
|
|
655
687
|
# Customize the options with defaults
|
656
688
|
call_metadata = @config.rpcs.update_database.metadata.to_h
|
657
689
|
|
658
|
-
# Set x-goog-api-client
|
690
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
659
691
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
660
692
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
661
693
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
662
694
|
transports_version_send: [:rest]
|
663
695
|
|
696
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
664
697
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
665
698
|
|
666
699
|
options.apply_defaults timeout: @config.rpcs.update_database.timeout,
|
@@ -687,7 +720,8 @@ module Google
|
|
687
720
|
# the format `<database_name>/operations/<operation_id>` and can be used to
|
688
721
|
# track execution of the schema change(s). The
|
689
722
|
# {::Google::Longrunning::Operation#metadata metadata} field type is
|
690
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlMetadata UpdateDatabaseDdlMetadata}.
|
723
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlMetadata UpdateDatabaseDdlMetadata}.
|
724
|
+
# The operation has no response.
|
691
725
|
#
|
692
726
|
# @overload update_database_ddl(request, options = nil)
|
693
727
|
# Pass arguments to `update_database_ddl` via a request object, either of type
|
@@ -716,18 +750,20 @@ module Google
|
|
716
750
|
#
|
717
751
|
# Specifying an explicit operation ID simplifies determining
|
718
752
|
# whether the statements were executed in the event that the
|
719
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client#update_database_ddl UpdateDatabaseDdl}
|
720
|
-
# or the return value is otherwise lost: the
|
721
|
-
#
|
753
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client#update_database_ddl UpdateDatabaseDdl}
|
754
|
+
# call is replayed, or the return value is otherwise lost: the
|
755
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest#database database}
|
756
|
+
# and `operation_id` fields can be combined to form the
|
722
757
|
# {::Google::Longrunning::Operation#name name} of the resulting
|
723
|
-
# {::Google::Longrunning::Operation longrunning.Operation}:
|
758
|
+
# {::Google::Longrunning::Operation longrunning.Operation}:
|
759
|
+
# `<database>/operations/<operation_id>`.
|
724
760
|
#
|
725
761
|
# `operation_id` should be unique within the database, and must be
|
726
762
|
# a valid identifier: `[a-z][a-z0-9_]*`. Note that
|
727
763
|
# automatically-generated operation IDs always begin with an
|
728
764
|
# underscore. If the named operation already exists,
|
729
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client#update_database_ddl UpdateDatabaseDdl}
|
730
|
-
# `ALREADY_EXISTS`.
|
765
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client#update_database_ddl UpdateDatabaseDdl}
|
766
|
+
# returns `ALREADY_EXISTS`.
|
731
767
|
# @param proto_descriptors [::String]
|
732
768
|
# Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements.
|
733
769
|
# Contains a protobuf-serialized
|
@@ -784,12 +820,13 @@ module Google
|
|
784
820
|
# Customize the options with defaults
|
785
821
|
call_metadata = @config.rpcs.update_database_ddl.metadata.to_h
|
786
822
|
|
787
|
-
# Set x-goog-api-client
|
823
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
788
824
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
789
825
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
790
826
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
791
827
|
transports_version_send: [:rest]
|
792
828
|
|
829
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
793
830
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
794
831
|
|
795
832
|
options.apply_defaults timeout: @config.rpcs.update_database_ddl.timeout,
|
@@ -867,12 +904,13 @@ module Google
|
|
867
904
|
# Customize the options with defaults
|
868
905
|
call_metadata = @config.rpcs.drop_database.metadata.to_h
|
869
906
|
|
870
|
-
# Set x-goog-api-client
|
907
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
871
908
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
872
909
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
873
910
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
874
911
|
transports_version_send: [:rest]
|
875
912
|
|
913
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
876
914
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
877
915
|
|
878
916
|
options.apply_defaults timeout: @config.rpcs.drop_database.timeout,
|
@@ -949,12 +987,13 @@ module Google
|
|
949
987
|
# Customize the options with defaults
|
950
988
|
call_metadata = @config.rpcs.get_database_ddl.metadata.to_h
|
951
989
|
|
952
|
-
# Set x-goog-api-client
|
990
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
953
991
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
954
992
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
955
993
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
956
994
|
transports_version_send: [:rest]
|
957
995
|
|
996
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
958
997
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
959
998
|
|
960
999
|
options.apply_defaults timeout: @config.rpcs.get_database_ddl.timeout,
|
@@ -1045,12 +1084,13 @@ module Google
|
|
1045
1084
|
# Customize the options with defaults
|
1046
1085
|
call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
|
1047
1086
|
|
1048
|
-
# Set x-goog-api-client
|
1087
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1049
1088
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1050
1089
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1051
1090
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
1052
1091
|
transports_version_send: [:rest]
|
1053
1092
|
|
1093
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1054
1094
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1055
1095
|
|
1056
1096
|
options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
|
@@ -1134,12 +1174,13 @@ module Google
|
|
1134
1174
|
# Customize the options with defaults
|
1135
1175
|
call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
|
1136
1176
|
|
1137
|
-
# Set x-goog-api-client
|
1177
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1138
1178
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1139
1179
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1140
1180
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
1141
1181
|
transports_version_send: [:rest]
|
1142
1182
|
|
1183
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1143
1184
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1144
1185
|
|
1145
1186
|
options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
|
@@ -1227,12 +1268,13 @@ module Google
|
|
1227
1268
|
# Customize the options with defaults
|
1228
1269
|
call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
|
1229
1270
|
|
1230
|
-
# Set x-goog-api-client
|
1271
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1231
1272
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1232
1273
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1233
1274
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
1234
1275
|
transports_version_send: [:rest]
|
1235
1276
|
|
1277
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1236
1278
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1237
1279
|
|
1238
1280
|
options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
|
@@ -1258,12 +1300,12 @@ module Google
|
|
1258
1300
|
# `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
|
1259
1301
|
# and can be used to track creation of the backup. The
|
1260
1302
|
# {::Google::Longrunning::Operation#metadata metadata} field type is
|
1261
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}.
|
1262
|
-
# {::Google::Longrunning::Operation#response response} field type is
|
1263
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}, if successful.
|
1264
|
-
# creation and delete the
|
1265
|
-
# There can be only one pending backup creation per database. Backup
|
1266
|
-
# of different databases can run concurrently.
|
1303
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}.
|
1304
|
+
# The {::Google::Longrunning::Operation#response response} field type is
|
1305
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}, if successful.
|
1306
|
+
# Cancelling the returned operation will stop the creation and delete the
|
1307
|
+
# backup. There can be only one pending backup creation per database. Backup
|
1308
|
+
# creation of different databases can run concurrently.
|
1267
1309
|
#
|
1268
1310
|
# @overload create_backup(request, options = nil)
|
1269
1311
|
# Pass arguments to `create_backup` via a request object, either of type
|
@@ -1294,11 +1336,11 @@ module Google
|
|
1294
1336
|
# @param backup [::Google::Cloud::Spanner::Admin::Database::V1::Backup, ::Hash]
|
1295
1337
|
# Required. The backup to create.
|
1296
1338
|
# @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig, ::Hash]
|
1297
|
-
# Optional. The encryption configuration used to encrypt the backup. If this
|
1298
|
-
# not specified, the backup will use the same
|
1299
|
-
#
|
1300
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig#encryption_type encryption_type}
|
1301
|
-
# `USE_DATABASE_ENCRYPTION`.
|
1339
|
+
# Optional. The encryption configuration used to encrypt the backup. If this
|
1340
|
+
# field is not specified, the backup will use the same encryption
|
1341
|
+
# configuration as the database by default, namely
|
1342
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig#encryption_type encryption_type}
|
1343
|
+
# = `USE_DATABASE_ENCRYPTION`.
|
1302
1344
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1303
1345
|
# @yieldparam result [::Gapic::Operation]
|
1304
1346
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -1340,12 +1382,13 @@ module Google
|
|
1340
1382
|
# Customize the options with defaults
|
1341
1383
|
call_metadata = @config.rpcs.create_backup.metadata.to_h
|
1342
1384
|
|
1343
|
-
# Set x-goog-api-client
|
1385
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1344
1386
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1345
1387
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1346
1388
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
1347
1389
|
transports_version_send: [:rest]
|
1348
1390
|
|
1391
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1349
1392
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1350
1393
|
|
1351
1394
|
options.apply_defaults timeout: @config.rpcs.create_backup.timeout,
|
@@ -1375,9 +1418,10 @@ module Google
|
|
1375
1418
|
# The {::Google::Longrunning::Operation#metadata metadata} field type is
|
1376
1419
|
# {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata}.
|
1377
1420
|
# The {::Google::Longrunning::Operation#response response} field type is
|
1378
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}, if successful.
|
1379
|
-
# copying and delete the
|
1380
|
-
# Concurrent CopyBackup requests can run on the same
|
1421
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}, if successful.
|
1422
|
+
# Cancelling the returned operation will stop the copying and delete the
|
1423
|
+
# destination backup. Concurrent CopyBackup requests can run on the same
|
1424
|
+
# source backup.
|
1381
1425
|
#
|
1382
1426
|
# @overload copy_backup(request, options = nil)
|
1383
1427
|
# Pass arguments to `copy_backup` via a request object, either of type
|
@@ -1395,8 +1439,8 @@ module Google
|
|
1395
1439
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1396
1440
|
#
|
1397
1441
|
# @param parent [::String]
|
1398
|
-
# Required. The name of the destination instance that will contain the backup
|
1399
|
-
# Values are of the form: `projects/<project>/instances/<instance>`.
|
1442
|
+
# Required. The name of the destination instance that will contain the backup
|
1443
|
+
# copy. Values are of the form: `projects/<project>/instances/<instance>`.
|
1400
1444
|
# @param backup_id [::String]
|
1401
1445
|
# Required. The id of the backup copy.
|
1402
1446
|
# The `backup_id` appended to `parent` forms the full backup_uri of the form
|
@@ -1415,11 +1459,11 @@ module Google
|
|
1415
1459
|
# passed, the backup is eligible to be automatically deleted by Cloud Spanner
|
1416
1460
|
# to free the resources used by the backup.
|
1417
1461
|
# @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig, ::Hash]
|
1418
|
-
# Optional. The encryption configuration used to encrypt the backup. If this
|
1419
|
-
# not specified, the backup will use the same
|
1420
|
-
#
|
1421
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig#encryption_type encryption_type}
|
1422
|
-
# `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
|
1462
|
+
# Optional. The encryption configuration used to encrypt the backup. If this
|
1463
|
+
# field is not specified, the backup will use the same encryption
|
1464
|
+
# configuration as the source backup by default, namely
|
1465
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig#encryption_type encryption_type}
|
1466
|
+
# = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
|
1423
1467
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1424
1468
|
# @yieldparam result [::Gapic::Operation]
|
1425
1469
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -1461,12 +1505,13 @@ module Google
|
|
1461
1505
|
# Customize the options with defaults
|
1462
1506
|
call_metadata = @config.rpcs.copy_backup.metadata.to_h
|
1463
1507
|
|
1464
|
-
# Set x-goog-api-client
|
1508
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1465
1509
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1466
1510
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1467
1511
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
1468
1512
|
transports_version_send: [:rest]
|
1469
1513
|
|
1514
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1470
1515
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1471
1516
|
|
1472
1517
|
options.apply_defaults timeout: @config.rpcs.copy_backup.timeout,
|
@@ -1487,7 +1532,8 @@ module Google
|
|
1487
1532
|
end
|
1488
1533
|
|
1489
1534
|
##
|
1490
|
-
# Gets metadata on a pending or completed
|
1535
|
+
# Gets metadata on a pending or completed
|
1536
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}.
|
1491
1537
|
#
|
1492
1538
|
# @overload get_backup(request, options = nil)
|
1493
1539
|
# Pass arguments to `get_backup` via a request object, either of type
|
@@ -1542,12 +1588,13 @@ module Google
|
|
1542
1588
|
# Customize the options with defaults
|
1543
1589
|
call_metadata = @config.rpcs.get_backup.metadata.to_h
|
1544
1590
|
|
1545
|
-
# Set x-goog-api-client
|
1591
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1546
1592
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1547
1593
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1548
1594
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
1549
1595
|
transports_version_send: [:rest]
|
1550
1596
|
|
1597
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1551
1598
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1552
1599
|
|
1553
1600
|
options.apply_defaults timeout: @config.rpcs.get_backup.timeout,
|
@@ -1567,7 +1614,8 @@ module Google
|
|
1567
1614
|
end
|
1568
1615
|
|
1569
1616
|
##
|
1570
|
-
# Updates a pending or completed
|
1617
|
+
# Updates a pending or completed
|
1618
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}.
|
1571
1619
|
#
|
1572
1620
|
# @overload update_backup(request, options = nil)
|
1573
1621
|
# Pass arguments to `update_backup` via a request object, either of type
|
@@ -1629,12 +1677,13 @@ module Google
|
|
1629
1677
|
# Customize the options with defaults
|
1630
1678
|
call_metadata = @config.rpcs.update_backup.metadata.to_h
|
1631
1679
|
|
1632
|
-
# Set x-goog-api-client
|
1680
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1633
1681
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1634
1682
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1635
1683
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
1636
1684
|
transports_version_send: [:rest]
|
1637
1685
|
|
1686
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1638
1687
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1639
1688
|
|
1640
1689
|
options.apply_defaults timeout: @config.rpcs.update_backup.timeout,
|
@@ -1654,7 +1703,8 @@ module Google
|
|
1654
1703
|
end
|
1655
1704
|
|
1656
1705
|
##
|
1657
|
-
# Deletes a pending or completed
|
1706
|
+
# Deletes a pending or completed
|
1707
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}.
|
1658
1708
|
#
|
1659
1709
|
# @overload delete_backup(request, options = nil)
|
1660
1710
|
# Pass arguments to `delete_backup` via a request object, either of type
|
@@ -1709,12 +1759,13 @@ module Google
|
|
1709
1759
|
# Customize the options with defaults
|
1710
1760
|
call_metadata = @config.rpcs.delete_backup.metadata.to_h
|
1711
1761
|
|
1712
|
-
# Set x-goog-api-client
|
1762
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1713
1763
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1714
1764
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1715
1765
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
1716
1766
|
transports_version_send: [:rest]
|
1717
1767
|
|
1768
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1718
1769
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1719
1770
|
|
1720
1771
|
options.apply_defaults timeout: @config.rpcs.delete_backup.timeout,
|
@@ -1765,7 +1816,9 @@ module Google
|
|
1765
1816
|
# must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
|
1766
1817
|
# Colon `:` is the contains operator. Filter rules are not case sensitive.
|
1767
1818
|
#
|
1768
|
-
# The following fields in the
|
1819
|
+
# The following fields in the
|
1820
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup} are eligible for
|
1821
|
+
# filtering:
|
1769
1822
|
#
|
1770
1823
|
# * `name`
|
1771
1824
|
# * `database`
|
@@ -1797,9 +1850,10 @@ module Google
|
|
1797
1850
|
# less, defaults to the server's maximum allowed page size.
|
1798
1851
|
# @param page_token [::String]
|
1799
1852
|
# If non-empty, `page_token` should contain a
|
1800
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse#next_page_token next_page_token}
|
1801
|
-
#
|
1802
|
-
#
|
1853
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse#next_page_token next_page_token}
|
1854
|
+
# from a previous
|
1855
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse ListBackupsResponse}
|
1856
|
+
# to the same `parent` and with the same `filter`.
|
1803
1857
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1804
1858
|
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Backup>]
|
1805
1859
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -1838,12 +1892,13 @@ module Google
|
|
1838
1892
|
# Customize the options with defaults
|
1839
1893
|
call_metadata = @config.rpcs.list_backups.metadata.to_h
|
1840
1894
|
|
1841
|
-
# Set x-goog-api-client
|
1895
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1842
1896
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1843
1897
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1844
1898
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
1845
1899
|
transports_version_send: [:rest]
|
1846
1900
|
|
1901
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1847
1902
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1848
1903
|
|
1849
1904
|
options.apply_defaults timeout: @config.rpcs.list_backups.timeout,
|
@@ -1912,12 +1967,12 @@ module Google
|
|
1912
1967
|
# Name of the backup from which to restore. Values are of the form
|
1913
1968
|
# `projects/<project>/instances/<instance>/backups/<backup>`.
|
1914
1969
|
# @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig, ::Hash]
|
1915
|
-
# Optional. An encryption configuration describing the encryption type and
|
1916
|
-
# resources in Cloud KMS used to encrypt/decrypt the database to restore
|
1917
|
-
# If this field is not specified, the restored database will use
|
1918
|
-
#
|
1919
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig#encryption_type encryption_type}
|
1920
|
-
# `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
|
1970
|
+
# Optional. An encryption configuration describing the encryption type and
|
1971
|
+
# key resources in Cloud KMS used to encrypt/decrypt the database to restore
|
1972
|
+
# to. If this field is not specified, the restored database will use the same
|
1973
|
+
# encryption configuration as the backup by default, namely
|
1974
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig#encryption_type encryption_type}
|
1975
|
+
# = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
|
1921
1976
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1922
1977
|
# @yieldparam result [::Gapic::Operation]
|
1923
1978
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -1959,12 +2014,13 @@ module Google
|
|
1959
2014
|
# Customize the options with defaults
|
1960
2015
|
call_metadata = @config.rpcs.restore_database.metadata.to_h
|
1961
2016
|
|
1962
|
-
# Set x-goog-api-client
|
2017
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1963
2018
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1964
2019
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1965
2020
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
1966
2021
|
transports_version_send: [:rest]
|
1967
2022
|
|
2023
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1968
2024
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1969
2025
|
|
1970
2026
|
options.apply_defaults timeout: @config.rpcs.restore_database.timeout,
|
@@ -2027,7 +2083,9 @@ module Google
|
|
2027
2083
|
# * `name` - The name of the long-running operation
|
2028
2084
|
# * `done` - False if the operation is in progress, else true.
|
2029
2085
|
# * `metadata.@type` - the type of metadata. For example, the type string
|
2030
|
-
# for
|
2086
|
+
# for
|
2087
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}
|
2088
|
+
# is
|
2031
2089
|
# `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
|
2032
2090
|
# * `metadata.<field_name>` - any field in metadata.value.
|
2033
2091
|
# `metadata.@type` must be specified first, if filtering on metadata
|
@@ -2049,7 +2107,8 @@ module Google
|
|
2049
2107
|
# `(metadata.name:restored_howl) AND` \
|
2050
2108
|
# `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
|
2051
2109
|
# `(error:*)` - Return operations where:
|
2052
|
-
# * The operation's metadata type is
|
2110
|
+
# * The operation's metadata type is
|
2111
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}.
|
2053
2112
|
# * The database is restored from a backup.
|
2054
2113
|
# * The backup name contains "backup_howl".
|
2055
2114
|
# * The restored database's name contains "restored_howl".
|
@@ -2061,8 +2120,9 @@ module Google
|
|
2061
2120
|
# @param page_token [::String]
|
2062
2121
|
# If non-empty, `page_token` should contain a
|
2063
2122
|
# {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse#next_page_token next_page_token}
|
2064
|
-
# from a previous
|
2065
|
-
#
|
2123
|
+
# from a previous
|
2124
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse ListDatabaseOperationsResponse}
|
2125
|
+
# to the same `parent` and with the same `filter`.
|
2066
2126
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
2067
2127
|
# @yieldparam result [::Gapic::Operation]
|
2068
2128
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -2101,12 +2161,13 @@ module Google
|
|
2101
2161
|
# Customize the options with defaults
|
2102
2162
|
call_metadata = @config.rpcs.list_database_operations.metadata.to_h
|
2103
2163
|
|
2104
|
-
# Set x-goog-api-client
|
2164
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2105
2165
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2106
2166
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2107
2167
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
2108
2168
|
transports_version_send: [:rest]
|
2109
2169
|
|
2170
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2110
2171
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2111
2172
|
|
2112
2173
|
options.apply_defaults timeout: @config.rpcs.list_database_operations.timeout,
|
@@ -2171,7 +2232,9 @@ module Google
|
|
2171
2232
|
# * `name` - The name of the long-running operation
|
2172
2233
|
# * `done` - False if the operation is in progress, else true.
|
2173
2234
|
# * `metadata.@type` - the type of metadata. For example, the type string
|
2174
|
-
# for
|
2235
|
+
# for
|
2236
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}
|
2237
|
+
# is
|
2175
2238
|
# `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
|
2176
2239
|
# * `metadata.<field_name>` - any field in metadata.value.
|
2177
2240
|
# `metadata.@type` must be specified first if filtering on metadata
|
@@ -2189,14 +2252,15 @@ module Google
|
|
2189
2252
|
# * `done:true` - The operation is complete.
|
2190
2253
|
# * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
|
2191
2254
|
# `metadata.database:prod` - Returns operations where:
|
2192
|
-
# * The operation's metadata type is
|
2193
|
-
#
|
2194
|
-
# string "prod".
|
2255
|
+
# * The operation's metadata type is
|
2256
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}.
|
2257
|
+
# * The source database name of backup contains the string "prod".
|
2195
2258
|
# * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
|
2196
2259
|
# `(metadata.name:howl) AND` \
|
2197
2260
|
# `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
|
2198
2261
|
# `(error:*)` - Returns operations where:
|
2199
|
-
# * The operation's metadata type is
|
2262
|
+
# * The operation's metadata type is
|
2263
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}.
|
2200
2264
|
# * The backup name contains the string "howl".
|
2201
2265
|
# * The operation started before 2018-03-28T14:50:00Z.
|
2202
2266
|
# * The operation resulted in an error.
|
@@ -2204,9 +2268,9 @@ module Google
|
|
2204
2268
|
# `(metadata.source_backup:test) AND` \
|
2205
2269
|
# `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \
|
2206
2270
|
# `(error:*)` - Returns operations where:
|
2207
|
-
# * The operation's metadata type is
|
2208
|
-
#
|
2209
|
-
# "test".
|
2271
|
+
# * The operation's metadata type is
|
2272
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata}.
|
2273
|
+
# * The source backup name contains the string "test".
|
2210
2274
|
# * The operation started before 2022-01-18T14:50:00Z.
|
2211
2275
|
# * The operation resulted in an error.
|
2212
2276
|
# * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
|
@@ -2216,12 +2280,13 @@ module Google
|
|
2216
2280
|
# `(metadata.source_backup:test_bkp)) AND` \
|
2217
2281
|
# `(error:*)` - Returns operations where:
|
2218
2282
|
# * The operation's metadata matches either of criteria:
|
2219
|
-
# * The operation's metadata type is
|
2220
|
-
#
|
2283
|
+
# * The operation's metadata type is
|
2284
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}
|
2285
|
+
# AND the source database name of the backup contains the string
|
2221
2286
|
# "test_db"
|
2222
|
-
# * The operation's metadata type is
|
2223
|
-
#
|
2224
|
-
# "test_bkp"
|
2287
|
+
# * The operation's metadata type is
|
2288
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata}
|
2289
|
+
# AND the source backup name contains the string "test_bkp"
|
2225
2290
|
# * The operation resulted in an error.
|
2226
2291
|
# @param page_size [::Integer]
|
2227
2292
|
# Number of operations to be returned in the response. If 0 or
|
@@ -2229,8 +2294,9 @@ module Google
|
|
2229
2294
|
# @param page_token [::String]
|
2230
2295
|
# If non-empty, `page_token` should contain a
|
2231
2296
|
# {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse#next_page_token next_page_token}
|
2232
|
-
# from a previous
|
2233
|
-
#
|
2297
|
+
# from a previous
|
2298
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse ListBackupOperationsResponse}
|
2299
|
+
# to the same `parent` and with the same `filter`.
|
2234
2300
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
2235
2301
|
# @yieldparam result [::Gapic::Operation]
|
2236
2302
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -2269,12 +2335,13 @@ module Google
|
|
2269
2335
|
# Customize the options with defaults
|
2270
2336
|
call_metadata = @config.rpcs.list_backup_operations.metadata.to_h
|
2271
2337
|
|
2272
|
-
# Set x-goog-api-client
|
2338
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2273
2339
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2274
2340
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2275
2341
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
2276
2342
|
transports_version_send: [:rest]
|
2277
2343
|
|
2344
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2278
2345
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2279
2346
|
|
2280
2347
|
options.apply_defaults timeout: @config.rpcs.list_backup_operations.timeout,
|
@@ -2315,14 +2382,15 @@ module Google
|
|
2315
2382
|
# @param parent [::String]
|
2316
2383
|
# Required. The database whose roles should be listed.
|
2317
2384
|
# Values are of the form
|
2318
|
-
# `projects/<project>/instances/<instance>/databases/<database
|
2385
|
+
# `projects/<project>/instances/<instance>/databases/<database>`.
|
2319
2386
|
# @param page_size [::Integer]
|
2320
2387
|
# Number of database roles to be returned in the response. If 0 or less,
|
2321
2388
|
# defaults to the server's maximum allowed page size.
|
2322
2389
|
# @param page_token [::String]
|
2323
2390
|
# If non-empty, `page_token` should contain a
|
2324
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse#next_page_token next_page_token}
|
2325
|
-
#
|
2391
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse#next_page_token next_page_token}
|
2392
|
+
# from a previous
|
2393
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse ListDatabaseRolesResponse}.
|
2326
2394
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
2327
2395
|
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole>]
|
2328
2396
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -2361,12 +2429,13 @@ module Google
|
|
2361
2429
|
# Customize the options with defaults
|
2362
2430
|
call_metadata = @config.rpcs.list_database_roles.metadata.to_h
|
2363
2431
|
|
2364
|
-
# Set x-goog-api-client
|
2432
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2365
2433
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2366
2434
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2367
2435
|
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
2368
2436
|
transports_version_send: [:rest]
|
2369
2437
|
|
2438
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2370
2439
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2371
2440
|
|
2372
2441
|
options.apply_defaults timeout: @config.rpcs.list_database_roles.timeout,
|
@@ -2386,6 +2455,435 @@ module Google
|
|
2386
2455
|
raise ::Google::Cloud::Error.from_error(e)
|
2387
2456
|
end
|
2388
2457
|
|
2458
|
+
##
|
2459
|
+
# Creates a new backup schedule.
|
2460
|
+
#
|
2461
|
+
# @overload create_backup_schedule(request, options = nil)
|
2462
|
+
# Pass arguments to `create_backup_schedule` via a request object, either of type
|
2463
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest} or an equivalent Hash.
|
2464
|
+
#
|
2465
|
+
# @param request [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest, ::Hash]
|
2466
|
+
# A request object representing the call parameters. Required. To specify no
|
2467
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2468
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2469
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2470
|
+
#
|
2471
|
+
# @overload create_backup_schedule(parent: nil, backup_schedule_id: nil, backup_schedule: nil)
|
2472
|
+
# Pass arguments to `create_backup_schedule` via keyword arguments. Note that at
|
2473
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2474
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2475
|
+
#
|
2476
|
+
# @param parent [::String]
|
2477
|
+
# Required. The name of the database that this backup schedule applies to.
|
2478
|
+
# @param backup_schedule_id [::String]
|
2479
|
+
# Required. The Id to use for the backup schedule. The `backup_schedule_id`
|
2480
|
+
# appended to `parent` forms the full backup schedule name of the form
|
2481
|
+
# `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
|
2482
|
+
# @param backup_schedule [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule, ::Hash]
|
2483
|
+
# Required. The backup schedule to create.
|
2484
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2485
|
+
# @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule]
|
2486
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2487
|
+
#
|
2488
|
+
# @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule]
|
2489
|
+
#
|
2490
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2491
|
+
#
|
2492
|
+
# @example Basic example
|
2493
|
+
# require "google/cloud/spanner/admin/database/v1"
|
2494
|
+
#
|
2495
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2496
|
+
# client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
|
2497
|
+
#
|
2498
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2499
|
+
# request = Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest.new
|
2500
|
+
#
|
2501
|
+
# # Call the create_backup_schedule method.
|
2502
|
+
# result = client.create_backup_schedule request
|
2503
|
+
#
|
2504
|
+
# # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.
|
2505
|
+
# p result
|
2506
|
+
#
|
2507
|
+
def create_backup_schedule request, options = nil
|
2508
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2509
|
+
|
2510
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest
|
2511
|
+
|
2512
|
+
# Converts hash and nil to an options object
|
2513
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2514
|
+
|
2515
|
+
# Customize the options with defaults
|
2516
|
+
call_metadata = @config.rpcs.create_backup_schedule.metadata.to_h
|
2517
|
+
|
2518
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2519
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2520
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2521
|
+
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
2522
|
+
transports_version_send: [:rest]
|
2523
|
+
|
2524
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2525
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2526
|
+
|
2527
|
+
options.apply_defaults timeout: @config.rpcs.create_backup_schedule.timeout,
|
2528
|
+
metadata: call_metadata,
|
2529
|
+
retry_policy: @config.rpcs.create_backup_schedule.retry_policy
|
2530
|
+
|
2531
|
+
options.apply_defaults timeout: @config.timeout,
|
2532
|
+
metadata: @config.metadata,
|
2533
|
+
retry_policy: @config.retry_policy
|
2534
|
+
|
2535
|
+
@database_admin_stub.create_backup_schedule request, options do |result, operation|
|
2536
|
+
yield result, operation if block_given?
|
2537
|
+
return result
|
2538
|
+
end
|
2539
|
+
rescue ::Gapic::Rest::Error => e
|
2540
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2541
|
+
end
|
2542
|
+
|
2543
|
+
##
|
2544
|
+
# Gets backup schedule for the input schedule name.
|
2545
|
+
#
|
2546
|
+
# @overload get_backup_schedule(request, options = nil)
|
2547
|
+
# Pass arguments to `get_backup_schedule` via a request object, either of type
|
2548
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest} or an equivalent Hash.
|
2549
|
+
#
|
2550
|
+
# @param request [::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest, ::Hash]
|
2551
|
+
# A request object representing the call parameters. Required. To specify no
|
2552
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2553
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2554
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2555
|
+
#
|
2556
|
+
# @overload get_backup_schedule(name: nil)
|
2557
|
+
# Pass arguments to `get_backup_schedule` via keyword arguments. Note that at
|
2558
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2559
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2560
|
+
#
|
2561
|
+
# @param name [::String]
|
2562
|
+
# Required. The name of the schedule to retrieve.
|
2563
|
+
# Values are of the form
|
2564
|
+
# `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
|
2565
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2566
|
+
# @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule]
|
2567
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2568
|
+
#
|
2569
|
+
# @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule]
|
2570
|
+
#
|
2571
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2572
|
+
#
|
2573
|
+
# @example Basic example
|
2574
|
+
# require "google/cloud/spanner/admin/database/v1"
|
2575
|
+
#
|
2576
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2577
|
+
# client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
|
2578
|
+
#
|
2579
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2580
|
+
# request = Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest.new
|
2581
|
+
#
|
2582
|
+
# # Call the get_backup_schedule method.
|
2583
|
+
# result = client.get_backup_schedule request
|
2584
|
+
#
|
2585
|
+
# # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.
|
2586
|
+
# p result
|
2587
|
+
#
|
2588
|
+
def get_backup_schedule request, options = nil
|
2589
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2590
|
+
|
2591
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest
|
2592
|
+
|
2593
|
+
# Converts hash and nil to an options object
|
2594
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2595
|
+
|
2596
|
+
# Customize the options with defaults
|
2597
|
+
call_metadata = @config.rpcs.get_backup_schedule.metadata.to_h
|
2598
|
+
|
2599
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2600
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2601
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2602
|
+
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
2603
|
+
transports_version_send: [:rest]
|
2604
|
+
|
2605
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2606
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2607
|
+
|
2608
|
+
options.apply_defaults timeout: @config.rpcs.get_backup_schedule.timeout,
|
2609
|
+
metadata: call_metadata,
|
2610
|
+
retry_policy: @config.rpcs.get_backup_schedule.retry_policy
|
2611
|
+
|
2612
|
+
options.apply_defaults timeout: @config.timeout,
|
2613
|
+
metadata: @config.metadata,
|
2614
|
+
retry_policy: @config.retry_policy
|
2615
|
+
|
2616
|
+
@database_admin_stub.get_backup_schedule request, options do |result, operation|
|
2617
|
+
yield result, operation if block_given?
|
2618
|
+
return result
|
2619
|
+
end
|
2620
|
+
rescue ::Gapic::Rest::Error => e
|
2621
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2622
|
+
end
|
2623
|
+
|
2624
|
+
##
|
2625
|
+
# Updates a backup schedule.
|
2626
|
+
#
|
2627
|
+
# @overload update_backup_schedule(request, options = nil)
|
2628
|
+
# Pass arguments to `update_backup_schedule` via a request object, either of type
|
2629
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest} or an equivalent Hash.
|
2630
|
+
#
|
2631
|
+
# @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest, ::Hash]
|
2632
|
+
# A request object representing the call parameters. Required. To specify no
|
2633
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2634
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2635
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2636
|
+
#
|
2637
|
+
# @overload update_backup_schedule(backup_schedule: nil, update_mask: nil)
|
2638
|
+
# Pass arguments to `update_backup_schedule` via keyword arguments. Note that at
|
2639
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2640
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2641
|
+
#
|
2642
|
+
# @param backup_schedule [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule, ::Hash]
|
2643
|
+
# Required. The backup schedule to update. `backup_schedule.name`, and the
|
2644
|
+
# fields to be updated as specified by `update_mask` are required. Other
|
2645
|
+
# fields are ignored.
|
2646
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
2647
|
+
# Required. A mask specifying which fields in the BackupSchedule resource
|
2648
|
+
# should be updated. This mask is relative to the BackupSchedule resource,
|
2649
|
+
# not to the request message. The field mask must always be
|
2650
|
+
# specified; this prevents any future fields from being erased
|
2651
|
+
# accidentally.
|
2652
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2653
|
+
# @yieldparam result [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule]
|
2654
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2655
|
+
#
|
2656
|
+
# @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule]
|
2657
|
+
#
|
2658
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2659
|
+
#
|
2660
|
+
# @example Basic example
|
2661
|
+
# require "google/cloud/spanner/admin/database/v1"
|
2662
|
+
#
|
2663
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2664
|
+
# client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
|
2665
|
+
#
|
2666
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2667
|
+
# request = Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest.new
|
2668
|
+
#
|
2669
|
+
# # Call the update_backup_schedule method.
|
2670
|
+
# result = client.update_backup_schedule request
|
2671
|
+
#
|
2672
|
+
# # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.
|
2673
|
+
# p result
|
2674
|
+
#
|
2675
|
+
def update_backup_schedule request, options = nil
|
2676
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2677
|
+
|
2678
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest
|
2679
|
+
|
2680
|
+
# Converts hash and nil to an options object
|
2681
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2682
|
+
|
2683
|
+
# Customize the options with defaults
|
2684
|
+
call_metadata = @config.rpcs.update_backup_schedule.metadata.to_h
|
2685
|
+
|
2686
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2687
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2688
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2689
|
+
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
2690
|
+
transports_version_send: [:rest]
|
2691
|
+
|
2692
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2693
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2694
|
+
|
2695
|
+
options.apply_defaults timeout: @config.rpcs.update_backup_schedule.timeout,
|
2696
|
+
metadata: call_metadata,
|
2697
|
+
retry_policy: @config.rpcs.update_backup_schedule.retry_policy
|
2698
|
+
|
2699
|
+
options.apply_defaults timeout: @config.timeout,
|
2700
|
+
metadata: @config.metadata,
|
2701
|
+
retry_policy: @config.retry_policy
|
2702
|
+
|
2703
|
+
@database_admin_stub.update_backup_schedule request, options do |result, operation|
|
2704
|
+
yield result, operation if block_given?
|
2705
|
+
return result
|
2706
|
+
end
|
2707
|
+
rescue ::Gapic::Rest::Error => e
|
2708
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2709
|
+
end
|
2710
|
+
|
2711
|
+
##
|
2712
|
+
# Deletes a backup schedule.
|
2713
|
+
#
|
2714
|
+
# @overload delete_backup_schedule(request, options = nil)
|
2715
|
+
# Pass arguments to `delete_backup_schedule` via a request object, either of type
|
2716
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest} or an equivalent Hash.
|
2717
|
+
#
|
2718
|
+
# @param request [::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest, ::Hash]
|
2719
|
+
# A request object representing the call parameters. Required. To specify no
|
2720
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2721
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2722
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2723
|
+
#
|
2724
|
+
# @overload delete_backup_schedule(name: nil)
|
2725
|
+
# Pass arguments to `delete_backup_schedule` via keyword arguments. Note that at
|
2726
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2727
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2728
|
+
#
|
2729
|
+
# @param name [::String]
|
2730
|
+
# Required. The name of the schedule to delete.
|
2731
|
+
# Values are of the form
|
2732
|
+
# `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
|
2733
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2734
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
2735
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2736
|
+
#
|
2737
|
+
# @return [::Google::Protobuf::Empty]
|
2738
|
+
#
|
2739
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2740
|
+
#
|
2741
|
+
# @example Basic example
|
2742
|
+
# require "google/cloud/spanner/admin/database/v1"
|
2743
|
+
#
|
2744
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2745
|
+
# client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
|
2746
|
+
#
|
2747
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2748
|
+
# request = Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest.new
|
2749
|
+
#
|
2750
|
+
# # Call the delete_backup_schedule method.
|
2751
|
+
# result = client.delete_backup_schedule request
|
2752
|
+
#
|
2753
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
2754
|
+
# p result
|
2755
|
+
#
|
2756
|
+
def delete_backup_schedule request, options = nil
|
2757
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2758
|
+
|
2759
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest
|
2760
|
+
|
2761
|
+
# Converts hash and nil to an options object
|
2762
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2763
|
+
|
2764
|
+
# Customize the options with defaults
|
2765
|
+
call_metadata = @config.rpcs.delete_backup_schedule.metadata.to_h
|
2766
|
+
|
2767
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2768
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2769
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2770
|
+
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
2771
|
+
transports_version_send: [:rest]
|
2772
|
+
|
2773
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2774
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2775
|
+
|
2776
|
+
options.apply_defaults timeout: @config.rpcs.delete_backup_schedule.timeout,
|
2777
|
+
metadata: call_metadata,
|
2778
|
+
retry_policy: @config.rpcs.delete_backup_schedule.retry_policy
|
2779
|
+
|
2780
|
+
options.apply_defaults timeout: @config.timeout,
|
2781
|
+
metadata: @config.metadata,
|
2782
|
+
retry_policy: @config.retry_policy
|
2783
|
+
|
2784
|
+
@database_admin_stub.delete_backup_schedule request, options do |result, operation|
|
2785
|
+
yield result, operation if block_given?
|
2786
|
+
return result
|
2787
|
+
end
|
2788
|
+
rescue ::Gapic::Rest::Error => e
|
2789
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2790
|
+
end
|
2791
|
+
|
2792
|
+
##
|
2793
|
+
# Lists all the backup schedules for the database.
|
2794
|
+
#
|
2795
|
+
# @overload list_backup_schedules(request, options = nil)
|
2796
|
+
# Pass arguments to `list_backup_schedules` via a request object, either of type
|
2797
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest} or an equivalent Hash.
|
2798
|
+
#
|
2799
|
+
# @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest, ::Hash]
|
2800
|
+
# A request object representing the call parameters. Required. To specify no
|
2801
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2802
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2803
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2804
|
+
#
|
2805
|
+
# @overload list_backup_schedules(parent: nil, page_size: nil, page_token: nil)
|
2806
|
+
# Pass arguments to `list_backup_schedules` via keyword arguments. Note that at
|
2807
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2808
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2809
|
+
#
|
2810
|
+
# @param parent [::String]
|
2811
|
+
# Required. Database is the parent resource whose backup schedules should be
|
2812
|
+
# listed. Values are of the form
|
2813
|
+
# projects/<project>/instances/<instance>/databases/<database>
|
2814
|
+
# @param page_size [::Integer]
|
2815
|
+
# Optional. Number of backup schedules to be returned in the response. If 0
|
2816
|
+
# or less, defaults to the server's maximum allowed page size.
|
2817
|
+
# @param page_token [::String]
|
2818
|
+
# Optional. If non-empty, `page_token` should contain a
|
2819
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse#next_page_token next_page_token}
|
2820
|
+
# from a previous
|
2821
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse ListBackupSchedulesResponse}
|
2822
|
+
# to the same `parent`.
|
2823
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2824
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule>]
|
2825
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2826
|
+
#
|
2827
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule>]
|
2828
|
+
#
|
2829
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2830
|
+
#
|
2831
|
+
# @example Basic example
|
2832
|
+
# require "google/cloud/spanner/admin/database/v1"
|
2833
|
+
#
|
2834
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2835
|
+
# client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Rest::Client.new
|
2836
|
+
#
|
2837
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2838
|
+
# request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest.new
|
2839
|
+
#
|
2840
|
+
# # Call the list_backup_schedules method.
|
2841
|
+
# result = client.list_backup_schedules request
|
2842
|
+
#
|
2843
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
2844
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
2845
|
+
# result.each do |item|
|
2846
|
+
# # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.
|
2847
|
+
# p item
|
2848
|
+
# end
|
2849
|
+
#
|
2850
|
+
def list_backup_schedules request, options = nil
|
2851
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2852
|
+
|
2853
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest
|
2854
|
+
|
2855
|
+
# Converts hash and nil to an options object
|
2856
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2857
|
+
|
2858
|
+
# Customize the options with defaults
|
2859
|
+
call_metadata = @config.rpcs.list_backup_schedules.metadata.to_h
|
2860
|
+
|
2861
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2862
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2863
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2864
|
+
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION,
|
2865
|
+
transports_version_send: [:rest]
|
2866
|
+
|
2867
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2868
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2869
|
+
|
2870
|
+
options.apply_defaults timeout: @config.rpcs.list_backup_schedules.timeout,
|
2871
|
+
metadata: call_metadata,
|
2872
|
+
retry_policy: @config.rpcs.list_backup_schedules.retry_policy
|
2873
|
+
|
2874
|
+
options.apply_defaults timeout: @config.timeout,
|
2875
|
+
metadata: @config.metadata,
|
2876
|
+
retry_policy: @config.retry_policy
|
2877
|
+
|
2878
|
+
@database_admin_stub.list_backup_schedules request, options do |result, operation|
|
2879
|
+
result = ::Gapic::Rest::PagedEnumerable.new @database_admin_stub, :list_backup_schedules, "backup_schedules", request, result, options
|
2880
|
+
yield result, operation if block_given?
|
2881
|
+
return result
|
2882
|
+
end
|
2883
|
+
rescue ::Gapic::Rest::Error => e
|
2884
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2885
|
+
end
|
2886
|
+
|
2389
2887
|
##
|
2390
2888
|
# Configuration class for the DatabaseAdmin REST API.
|
2391
2889
|
#
|
@@ -2619,6 +3117,31 @@ module Google
|
|
2619
3117
|
# @return [::Gapic::Config::Method]
|
2620
3118
|
#
|
2621
3119
|
attr_reader :list_database_roles
|
3120
|
+
##
|
3121
|
+
# RPC-specific configuration for `create_backup_schedule`
|
3122
|
+
# @return [::Gapic::Config::Method]
|
3123
|
+
#
|
3124
|
+
attr_reader :create_backup_schedule
|
3125
|
+
##
|
3126
|
+
# RPC-specific configuration for `get_backup_schedule`
|
3127
|
+
# @return [::Gapic::Config::Method]
|
3128
|
+
#
|
3129
|
+
attr_reader :get_backup_schedule
|
3130
|
+
##
|
3131
|
+
# RPC-specific configuration for `update_backup_schedule`
|
3132
|
+
# @return [::Gapic::Config::Method]
|
3133
|
+
#
|
3134
|
+
attr_reader :update_backup_schedule
|
3135
|
+
##
|
3136
|
+
# RPC-specific configuration for `delete_backup_schedule`
|
3137
|
+
# @return [::Gapic::Config::Method]
|
3138
|
+
#
|
3139
|
+
attr_reader :delete_backup_schedule
|
3140
|
+
##
|
3141
|
+
# RPC-specific configuration for `list_backup_schedules`
|
3142
|
+
# @return [::Gapic::Config::Method]
|
3143
|
+
#
|
3144
|
+
attr_reader :list_backup_schedules
|
2622
3145
|
|
2623
3146
|
# @private
|
2624
3147
|
def initialize parent_rpcs = nil
|
@@ -2662,6 +3185,16 @@ module Google
|
|
2662
3185
|
@list_backup_operations = ::Gapic::Config::Method.new list_backup_operations_config
|
2663
3186
|
list_database_roles_config = parent_rpcs.list_database_roles if parent_rpcs.respond_to? :list_database_roles
|
2664
3187
|
@list_database_roles = ::Gapic::Config::Method.new list_database_roles_config
|
3188
|
+
create_backup_schedule_config = parent_rpcs.create_backup_schedule if parent_rpcs.respond_to? :create_backup_schedule
|
3189
|
+
@create_backup_schedule = ::Gapic::Config::Method.new create_backup_schedule_config
|
3190
|
+
get_backup_schedule_config = parent_rpcs.get_backup_schedule if parent_rpcs.respond_to? :get_backup_schedule
|
3191
|
+
@get_backup_schedule = ::Gapic::Config::Method.new get_backup_schedule_config
|
3192
|
+
update_backup_schedule_config = parent_rpcs.update_backup_schedule if parent_rpcs.respond_to? :update_backup_schedule
|
3193
|
+
@update_backup_schedule = ::Gapic::Config::Method.new update_backup_schedule_config
|
3194
|
+
delete_backup_schedule_config = parent_rpcs.delete_backup_schedule if parent_rpcs.respond_to? :delete_backup_schedule
|
3195
|
+
@delete_backup_schedule = ::Gapic::Config::Method.new delete_backup_schedule_config
|
3196
|
+
list_backup_schedules_config = parent_rpcs.list_backup_schedules if parent_rpcs.respond_to? :list_backup_schedules
|
3197
|
+
@list_backup_schedules = ::Gapic::Config::Method.new list_backup_schedules_config
|
2665
3198
|
|
2666
3199
|
yield self if block_given?
|
2667
3200
|
end
|