google-cloud-spanner-admin-database-v1 0.7.5 → 0.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38328804718433b12c9422707c62c5a2860f6d49d9e30e2b5618386fd039967c
4
- data.tar.gz: f688ab1055a703babe7cfd2198c23c9f725380fe01773373a67b4a9c4ac3284a
3
+ metadata.gz: 293b4c56347cacdb4c27599512924dc52ffc6edaeea9f647921f0eec327822ba
4
+ data.tar.gz: efee1840fb9c9781be92d58b842dd5b3d236f7f10013603a6ec0974a7ec5f981
5
5
  SHA512:
6
- metadata.gz: ba3ec39b5f1263114c9e56734e8df0ac372909858b432d736abd5f558c2e5e6f51a61ab96c8eb110d240bd16895e3b419239916ec689b1fe40bc5ca220ee86a5
7
- data.tar.gz: 9fc030210c542c23e65bcecc9a941a906950bbf7c8295210aa4e0e6d509945a5b761fdabcf48cc200e3fb6ced559d000af3d9e21851b17a340b6bccba77a8399
6
+ metadata.gz: 83b47a5f6e47a5e65ffcf8dd546f9bb5b21d90ea5dfe10b280ecd24895735eee2c1ac13ffb3369c1aab1fa9e3250f25f61584371b593be3013f9685ccb3bf189
7
+ data.tar.gz: a4790423c7b7108bd358ac96610812879d7abaaf1a3bc4a49f0cfd140a297e69088d57038b6755bea1b31c1485ff9f24fcc38d9dad84c537cf1e774265513a0d
data/README.md CHANGED
@@ -37,7 +37,7 @@ request = ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.ne
37
37
  response = client.list_databases request
38
38
  ```
39
39
 
40
- View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-spanner-admin-database-v1/latest)
40
+ View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-spanner-admin-database-v1/latest)
41
41
  for class and method documentation.
42
42
 
43
43
  See also the [Product Documentation](https://cloud.google.com/spanner)
@@ -31,10 +31,11 @@ module Google
31
31
  #
32
32
  # Cloud Spanner Database Admin API
33
33
  #
34
- # The Cloud Spanner Database Admin API can be used to create, drop, and
35
- # list databases. It also enables updating the schema of pre-existing
36
- # databases. It can be also used to create, delete and list backups for a
37
- # database and to restore from an existing backup.
34
+ # The Cloud Spanner Database Admin API can be used to:
35
+ # * create, drop, and list databases
36
+ # * update the schema of pre-existing databases
37
+ # * create, delete and list backups for a database
38
+ # * restore a database from an existing backup
38
39
  #
39
40
  class Client
40
41
  include Paths
@@ -109,6 +110,8 @@ module Google
109
110
 
110
111
  default_config.rpcs.create_backup.timeout = 3600.0
111
112
 
113
+ default_config.rpcs.copy_backup.timeout = 3600.0
114
+
112
115
  default_config.rpcs.get_backup.timeout = 3600.0
113
116
  default_config.rpcs.get_backup.retry_policy = {
114
117
  initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
@@ -354,7 +357,7 @@ module Google
354
357
  # @param options [::Gapic::CallOptions, ::Hash]
355
358
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
356
359
  #
357
- # @overload create_database(parent: nil, create_statement: nil, extra_statements: nil, encryption_config: nil)
360
+ # @overload create_database(parent: nil, create_statement: nil, extra_statements: nil, encryption_config: nil, database_dialect: nil)
358
361
  # Pass arguments to `create_database` via keyword arguments. Note that at
359
362
  # least one keyword argument is required. To specify no parameters, or to keep all
360
363
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -377,6 +380,8 @@ module Google
377
380
  # Optional. The encryption configuration for the database. If this field is not
378
381
  # specified, Cloud Spanner will encrypt/decrypt all data at rest using
379
382
  # Google default encryption.
383
+ # @param database_dialect [::Google::Cloud::Spanner::Admin::Database::V1::DatabaseDialect]
384
+ # Optional. The dialect of the Cloud Spanner Database.
380
385
  #
381
386
  # @yield [response, operation] Access the result along with the RPC operation
382
387
  # @yieldparam response [::Gapic::Operation]
@@ -661,6 +666,8 @@ module Google
661
666
  # Drops (aka deletes) a Cloud Spanner database.
662
667
  # Completed backups for the database will be retained according to their
663
668
  # `expire_time`.
669
+ # Note: Cloud Spanner might continue to accept requests for a few seconds
670
+ # after the database has been deleted.
664
671
  #
665
672
  # @overload drop_database(request, options = nil)
666
673
  # Pass arguments to `drop_database` via a request object, either of type
@@ -852,7 +859,7 @@ module Google
852
859
  # @param options [::Gapic::CallOptions, ::Hash]
853
860
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
854
861
  #
855
- # @overload set_iam_policy(resource: nil, policy: nil)
862
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
856
863
  # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
857
864
  # least one keyword argument is required. To specify no parameters, or to keep all
858
865
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -865,6 +872,12 @@ module Google
865
872
  # the policy is limited to a few 10s of KB. An empty policy is a
866
873
  # valid policy but certain Cloud Platform services (such as Projects)
867
874
  # might reject them.
875
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
876
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
877
+ # the fields in the mask will be modified. If no mask is provided, the
878
+ # following default mask is used:
879
+ #
880
+ # `paths: "bindings, etag"`
868
881
  #
869
882
  # @yield [response, operation] Access the result along with the RPC operation
870
883
  # @yieldparam response [::Google::Iam::V1::Policy]
@@ -960,7 +973,7 @@ module Google
960
973
  # See the operation documentation for the appropriate value for this field.
961
974
  # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
962
975
  # OPTIONAL: A `GetPolicyOptions` object for specifying options to
963
- # `GetIamPolicy`. This field is only used by Cloud IAM.
976
+ # `GetIamPolicy`.
964
977
  #
965
978
  # @yield [response, operation] Access the result along with the RPC operation
966
979
  # @yieldparam response [::Google::Iam::V1::Policy]
@@ -1247,6 +1260,134 @@ module Google
1247
1260
  raise ::Google::Cloud::Error.from_error(e)
1248
1261
  end
1249
1262
 
1263
+ ##
1264
+ # Starts copying a Cloud Spanner Backup.
1265
+ # The returned backup {::Google::Longrunning::Operation long-running operation}
1266
+ # will have a name of the format
1267
+ # `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
1268
+ # and can be used to track copying of the backup. The operation is associated
1269
+ # with the destination backup.
1270
+ # The {::Google::Longrunning::Operation#metadata metadata} field type is
1271
+ # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata}.
1272
+ # The {::Google::Longrunning::Operation#response response} field type is
1273
+ # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}, if successful. Cancelling the returned operation will stop the
1274
+ # copying and delete the backup.
1275
+ # Concurrent CopyBackup requests can run on the same source backup.
1276
+ #
1277
+ # @overload copy_backup(request, options = nil)
1278
+ # Pass arguments to `copy_backup` via a request object, either of type
1279
+ # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest} or an equivalent Hash.
1280
+ #
1281
+ # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest, ::Hash]
1282
+ # A request object representing the call parameters. Required. To specify no
1283
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1284
+ # @param options [::Gapic::CallOptions, ::Hash]
1285
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1286
+ #
1287
+ # @overload copy_backup(parent: nil, backup_id: nil, source_backup: nil, expire_time: nil, encryption_config: nil)
1288
+ # Pass arguments to `copy_backup` via keyword arguments. Note that at
1289
+ # least one keyword argument is required. To specify no parameters, or to keep all
1290
+ # the default parameter values, pass an empty Hash as a request object (see above).
1291
+ #
1292
+ # @param parent [::String]
1293
+ # Required. The name of the destination instance that will contain the backup copy.
1294
+ # Values are of the form: `projects/<project>/instances/<instance>`.
1295
+ # @param backup_id [::String]
1296
+ # Required. The id of the backup copy.
1297
+ # The `backup_id` appended to `parent` forms the full backup_uri of the form
1298
+ # `projects/<project>/instances/<instance>/backups/<backup>`.
1299
+ # @param source_backup [::String]
1300
+ # Required. The source backup to be copied.
1301
+ # The source backup needs to be in READY state for it to be copied.
1302
+ # Once CopyBackup is in progress, the source backup cannot be deleted or
1303
+ # cleaned up on expiration until CopyBackup is finished.
1304
+ # Values are of the form:
1305
+ # `projects/<project>/instances/<instance>/backups/<backup>`.
1306
+ # @param expire_time [::Google::Protobuf::Timestamp, ::Hash]
1307
+ # Required. The expiration time of the backup in microsecond granularity.
1308
+ # The expiration time must be at least 6 hours and at most 366 days
1309
+ # from the `create_time` of the source backup. Once the `expire_time` has
1310
+ # passed, the backup is eligible to be automatically deleted by Cloud Spanner
1311
+ # to free the resources used by the backup.
1312
+ # @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig, ::Hash]
1313
+ # Optional. The encryption configuration used to encrypt the backup. If this field is
1314
+ # not specified, the backup will use the same
1315
+ # encryption configuration as the source backup by default, namely
1316
+ # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig#encryption_type encryption_type} =
1317
+ # `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
1318
+ #
1319
+ # @yield [response, operation] Access the result along with the RPC operation
1320
+ # @yieldparam response [::Gapic::Operation]
1321
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1322
+ #
1323
+ # @return [::Gapic::Operation]
1324
+ #
1325
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1326
+ #
1327
+ # @example Basic example
1328
+ # require "google/cloud/spanner/admin/database/v1"
1329
+ #
1330
+ # # Create a client object. The client can be reused for multiple calls.
1331
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new
1332
+ #
1333
+ # # Create a request. To set request fields, pass in keyword arguments.
1334
+ # request = Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new
1335
+ #
1336
+ # # Call the copy_backup method.
1337
+ # result = client.copy_backup request
1338
+ #
1339
+ # # The returned object is of type Gapic::Operation. You can use this
1340
+ # # object to check the status of an operation, cancel it, or wait
1341
+ # # for results. Here is how to block until completion:
1342
+ # result.wait_until_done! timeout: 60
1343
+ # if result.response?
1344
+ # p result.response
1345
+ # else
1346
+ # puts "Error!"
1347
+ # end
1348
+ #
1349
+ def copy_backup request, options = nil
1350
+ raise ::ArgumentError, "request must be provided" if request.nil?
1351
+
1352
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest
1353
+
1354
+ # Converts hash and nil to an options object
1355
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1356
+
1357
+ # Customize the options with defaults
1358
+ metadata = @config.rpcs.copy_backup.metadata.to_h
1359
+
1360
+ # Set x-goog-api-client and x-goog-user-project headers
1361
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1362
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1363
+ gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION
1364
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1365
+
1366
+ header_params = {}
1367
+ if request.parent
1368
+ header_params["parent"] = request.parent
1369
+ end
1370
+
1371
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1372
+ metadata[:"x-goog-request-params"] ||= request_params_header
1373
+
1374
+ options.apply_defaults timeout: @config.rpcs.copy_backup.timeout,
1375
+ metadata: metadata,
1376
+ retry_policy: @config.rpcs.copy_backup.retry_policy
1377
+
1378
+ options.apply_defaults timeout: @config.timeout,
1379
+ metadata: @config.metadata,
1380
+ retry_policy: @config.retry_policy
1381
+
1382
+ @database_admin_stub.call_rpc :copy_backup, request, options: options do |response, operation|
1383
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1384
+ yield response, operation if block_given?
1385
+ return response
1386
+ end
1387
+ rescue ::GRPC::BadStatus => e
1388
+ raise ::Google::Cloud::Error.from_error(e)
1389
+ end
1390
+
1250
1391
  ##
1251
1392
  # Gets metadata on a pending or completed {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}.
1252
1393
  #
@@ -1828,6 +1969,8 @@ module Google
1828
1969
  # for {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata} is
1829
1970
  # `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
1830
1971
  # * `metadata.<field_name>` - any field in metadata.value.
1972
+ # `metadata.@type` must be specified first, if filtering on metadata
1973
+ # fields.
1831
1974
  # * `error` - Error associated with the long-running operation.
1832
1975
  # * `response.@type` - the type of response.
1833
1976
  # * `response.<field_name>` - any field in response.value.
@@ -1980,6 +2123,8 @@ module Google
1980
2123
  # for {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} is
1981
2124
  # `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
1982
2125
  # * `metadata.<field_name>` - any field in metadata.value.
2126
+ # `metadata.@type` must be specified first if filtering on metadata
2127
+ # fields.
1983
2128
  # * `error` - Error associated with the long-running operation.
1984
2129
  # * `response.@type` - the type of response.
1985
2130
  # * `response.<field_name>` - any field in response.value.
@@ -1991,8 +2136,11 @@ module Google
1991
2136
  # Here are a few examples:
1992
2137
  #
1993
2138
  # * `done:true` - The operation is complete.
1994
- # * `metadata.database:prod` - The database the backup was taken from has
1995
- # a name containing the string "prod".
2139
+ # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
2140
+ # `metadata.database:prod` - Returns operations where:
2141
+ # * The operation's metadata type is {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}.
2142
+ # * The database the backup was taken from has a name containing the
2143
+ # string "prod".
1996
2144
  # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
1997
2145
  # `(metadata.name:howl) AND` \
1998
2146
  # `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
@@ -2001,6 +2149,29 @@ module Google
2001
2149
  # * The backup name contains the string "howl".
2002
2150
  # * The operation started before 2018-03-28T14:50:00Z.
2003
2151
  # * The operation resulted in an error.
2152
+ # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \
2153
+ # `(metadata.source_backup:test) AND` \
2154
+ # `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \
2155
+ # `(error:*)` - Returns operations where:
2156
+ # * The operation's metadata type is {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata}.
2157
+ # * The source backup of the copied backup name contains the string
2158
+ # "test".
2159
+ # * The operation started before 2022-01-18T14:50:00Z.
2160
+ # * The operation resulted in an error.
2161
+ # * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
2162
+ # `(metadata.database:test_db)) OR` \
2163
+ # `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata)
2164
+ # AND` \
2165
+ # `(metadata.source_backup:test_bkp)) AND` \
2166
+ # `(error:*)` - Returns operations where:
2167
+ # * The operation's metadata matches either of criteria:
2168
+ # * The operation's metadata type is {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} AND the
2169
+ # database the backup was taken from has name containing string
2170
+ # "test_db"
2171
+ # * The operation's metadata type is {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata} AND the
2172
+ # backup the backup was copied from has name containing string
2173
+ # "test_bkp"
2174
+ # * The operation resulted in an error.
2004
2175
  # @param page_size [::Integer]
2005
2176
  # Number of operations to be returned in the response. If 0 or
2006
2177
  # less, defaults to the server's maximum allowed page size.
@@ -2268,6 +2439,11 @@ module Google
2268
2439
  #
2269
2440
  attr_reader :create_backup
2270
2441
  ##
2442
+ # RPC-specific configuration for `copy_backup`
2443
+ # @return [::Gapic::Config::Method]
2444
+ #
2445
+ attr_reader :copy_backup
2446
+ ##
2271
2447
  # RPC-specific configuration for `get_backup`
2272
2448
  # @return [::Gapic::Config::Method]
2273
2449
  #
@@ -2325,6 +2501,8 @@ module Google
2325
2501
  @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
2326
2502
  create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup
2327
2503
  @create_backup = ::Gapic::Config::Method.new create_backup_config
2504
+ copy_backup_config = parent_rpcs.copy_backup if parent_rpcs.respond_to? :copy_backup
2505
+ @copy_backup = ::Gapic::Config::Method.new copy_backup_config
2328
2506
  get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
2329
2507
  @get_backup = ::Gapic::Config::Method.new get_backup_config
2330
2508
  update_backup_config = parent_rpcs.update_backup if parent_rpcs.respond_to? :update_backup
@@ -36,10 +36,11 @@ module Google
36
36
  ##
37
37
  # Cloud Spanner Database Admin API
38
38
  #
39
- # The Cloud Spanner Database Admin API can be used to create, drop, and
40
- # list databases. It also enables updating the schema of pre-existing
41
- # databases. It can be also used to create, delete and list backups for a
42
- # database and to restore from an existing backup.
39
+ # The Cloud Spanner Database Admin API can be used to:
40
+ # * create, drop, and list databases
41
+ # * update the schema of pre-existing databases
42
+ # * create, delete and list backups for a database
43
+ # * restore a database from an existing backup
43
44
  #
44
45
  # To load this service and instantiate a client:
45
46
  #
@@ -23,7 +23,7 @@ module Google
23
23
  module Admin
24
24
  module Database
25
25
  module V1
26
- VERSION = "0.7.5"
26
+ VERSION = "0.9.0"
27
27
  end
28
28
  end
29
29
  end
@@ -27,6 +27,8 @@ module Google
27
27
  ##
28
28
  # To load this package, including all its services, and instantiate a client:
29
29
  #
30
+ # @example
31
+ #
30
32
  # require "google/cloud/spanner/admin/database/v1"
31
33
  # client = ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new
32
34
  #
@@ -7,7 +7,6 @@ require 'google/longrunning/operations_pb'
7
7
  require 'google/protobuf/field_mask_pb'
8
8
  require 'google/protobuf/timestamp_pb'
9
9
  require 'google/spanner/admin/database/v1/common_pb'
10
- require 'google/api/annotations_pb'
11
10
  require 'google/protobuf'
12
11
 
13
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
@@ -22,6 +21,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
22
21
  optional :state, :enum, 6, "google.spanner.admin.database.v1.Backup.State"
23
22
  repeated :referencing_databases, :string, 7
24
23
  optional :encryption_info, :message, 8, "google.spanner.admin.database.v1.EncryptionInfo"
24
+ optional :database_dialect, :enum, 10, "google.spanner.admin.database.v1.DatabaseDialect"
25
+ repeated :referencing_backups, :string, 11
26
+ optional :max_expire_time, :message, 12, "google.protobuf.Timestamp"
25
27
  end
26
28
  add_enum "google.spanner.admin.database.v1.Backup.State" do
27
29
  value :STATE_UNSPECIFIED, 0
@@ -40,6 +42,19 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
40
42
  optional :progress, :message, 3, "google.spanner.admin.database.v1.OperationProgress"
41
43
  optional :cancel_time, :message, 4, "google.protobuf.Timestamp"
42
44
  end
45
+ add_message "google.spanner.admin.database.v1.CopyBackupRequest" do
46
+ optional :parent, :string, 1
47
+ optional :backup_id, :string, 2
48
+ optional :source_backup, :string, 3
49
+ optional :expire_time, :message, 4, "google.protobuf.Timestamp"
50
+ optional :encryption_config, :message, 5, "google.spanner.admin.database.v1.CopyBackupEncryptionConfig"
51
+ end
52
+ add_message "google.spanner.admin.database.v1.CopyBackupMetadata" do
53
+ optional :name, :string, 1
54
+ optional :source_backup, :string, 2
55
+ optional :progress, :message, 3, "google.spanner.admin.database.v1.OperationProgress"
56
+ optional :cancel_time, :message, 4, "google.protobuf.Timestamp"
57
+ end
43
58
  add_message "google.spanner.admin.database.v1.UpdateBackupRequest" do
44
59
  optional :backup, :message, 1, "google.spanner.admin.database.v1.Backup"
45
60
  optional :update_mask, :message, 2, "google.protobuf.FieldMask"
@@ -86,6 +101,16 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
86
101
  value :GOOGLE_DEFAULT_ENCRYPTION, 2
87
102
  value :CUSTOMER_MANAGED_ENCRYPTION, 3
88
103
  end
104
+ add_message "google.spanner.admin.database.v1.CopyBackupEncryptionConfig" do
105
+ optional :encryption_type, :enum, 1, "google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType"
106
+ optional :kms_key_name, :string, 2
107
+ end
108
+ add_enum "google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType" do
109
+ value :ENCRYPTION_TYPE_UNSPECIFIED, 0
110
+ value :USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION, 1
111
+ value :GOOGLE_DEFAULT_ENCRYPTION, 2
112
+ value :CUSTOMER_MANAGED_ENCRYPTION, 3
113
+ end
89
114
  end
90
115
  end
91
116
 
@@ -99,6 +124,8 @@ module Google
99
124
  Backup::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.Backup.State").enummodule
100
125
  CreateBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupRequest").msgclass
101
126
  CreateBackupMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupMetadata").msgclass
127
+ CopyBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CopyBackupRequest").msgclass
128
+ CopyBackupMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CopyBackupMetadata").msgclass
102
129
  UpdateBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.UpdateBackupRequest").msgclass
103
130
  GetBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.GetBackupRequest").msgclass
104
131
  DeleteBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.DeleteBackupRequest").msgclass
@@ -109,6 +136,8 @@ module Google
109
136
  BackupInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.BackupInfo").msgclass
110
137
  CreateBackupEncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupEncryptionConfig").msgclass
111
138
  CreateBackupEncryptionConfig::EncryptionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType").enummodule
139
+ CopyBackupEncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CopyBackupEncryptionConfig").msgclass
140
+ CopyBackupEncryptionConfig::EncryptionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType").enummodule
112
141
  end
113
142
  end
114
143
  end
@@ -5,7 +5,6 @@ require 'google/api/field_behavior_pb'
5
5
  require 'google/api/resource_pb'
6
6
  require 'google/protobuf/timestamp_pb'
7
7
  require 'google/rpc/status_pb'
8
- require 'google/api/annotations_pb'
9
8
  require 'google/protobuf'
10
9
 
11
10
  Google::Protobuf::DescriptorPool.generated_pool.build do
@@ -28,6 +27,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
28
27
  value :GOOGLE_DEFAULT_ENCRYPTION, 1
29
28
  value :CUSTOMER_MANAGED_ENCRYPTION, 2
30
29
  end
30
+ add_enum "google.spanner.admin.database.v1.DatabaseDialect" do
31
+ value :DATABASE_DIALECT_UNSPECIFIED, 0
32
+ value :GOOGLE_STANDARD_SQL, 1
33
+ value :POSTGRESQL, 2
34
+ end
31
35
  end
32
36
  end
33
37
 
@@ -41,6 +45,7 @@ module Google
41
45
  EncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.EncryptionConfig").msgclass
42
46
  EncryptionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.EncryptionInfo").msgclass
43
47
  EncryptionInfo::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.EncryptionInfo.Type").enummodule
48
+ DatabaseDialect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.DatabaseDialect").enummodule
44
49
  end
45
50
  end
46
51
  end
@@ -32,6 +32,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
32
32
  optional :version_retention_period, :string, 6
33
33
  optional :earliest_version_time, :message, 7, "google.protobuf.Timestamp"
34
34
  optional :default_leader, :string, 9
35
+ optional :database_dialect, :enum, 10, "google.spanner.admin.database.v1.DatabaseDialect"
35
36
  end
36
37
  add_enum "google.spanner.admin.database.v1.Database.State" do
37
38
  value :STATE_UNSPECIFIED, 0
@@ -53,6 +54,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
53
54
  optional :create_statement, :string, 2
54
55
  repeated :extra_statements, :string, 3
55
56
  optional :encryption_config, :message, 4, "google.spanner.admin.database.v1.EncryptionConfig"
57
+ optional :database_dialect, :enum, 5, "google.spanner.admin.database.v1.DatabaseDialect"
56
58
  end
57
59
  add_message "google.spanner.admin.database.v1.CreateDatabaseMetadata" do
58
60
  optional :database, :string, 1
@@ -28,10 +28,11 @@ module Google
28
28
  module DatabaseAdmin
29
29
  # Cloud Spanner Database Admin API
30
30
  #
31
- # The Cloud Spanner Database Admin API can be used to create, drop, and
32
- # list databases. It also enables updating the schema of pre-existing
33
- # databases. It can be also used to create, delete and list backups for a
34
- # database and to restore from an existing backup.
31
+ # The Cloud Spanner Database Admin API can be used to:
32
+ # * create, drop, and list databases
33
+ # * update the schema of pre-existing databases
34
+ # * create, delete and list backups for a database
35
+ # * restore a database from an existing backup
35
36
  class Service
36
37
 
37
38
  include ::GRPC::GenericService
@@ -64,6 +65,8 @@ module Google
64
65
  # Drops (aka deletes) a Cloud Spanner database.
65
66
  # Completed backups for the database will be retained according to their
66
67
  # `expire_time`.
68
+ # Note: Cloud Spanner might continue to accept requests for a few seconds
69
+ # after the database has been deleted.
67
70
  rpc :DropDatabase, ::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest, ::Google::Protobuf::Empty
68
71
  # Returns the schema of a Cloud Spanner database as a list of formatted
69
72
  # DDL statements. This method does not show pending schema updates, those may
@@ -110,6 +113,19 @@ module Google
110
113
  # There can be only one pending backup creation per database. Backup creation
111
114
  # of different databases can run concurrently.
112
115
  rpc :CreateBackup, ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest, ::Google::Longrunning::Operation
116
+ # Starts copying a Cloud Spanner Backup.
117
+ # The returned backup [long-running operation][google.longrunning.Operation]
118
+ # will have a name of the format
119
+ # `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
120
+ # and can be used to track copying of the backup. The operation is associated
121
+ # with the destination backup.
122
+ # The [metadata][google.longrunning.Operation.metadata] field type is
123
+ # [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
124
+ # The [response][google.longrunning.Operation.response] field type is
125
+ # [Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
126
+ # copying and delete the backup.
127
+ # Concurrent CopyBackup requests can run on the same source backup.
128
+ rpc :CopyBackup, ::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest, ::Google::Longrunning::Operation
113
129
  # Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
114
130
  rpc :GetBackup, ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest, ::Google::Cloud::Spanner::Admin::Database::V1::Backup
115
131
  # Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
@@ -31,6 +31,13 @@ module Google
31
31
  # the policy is limited to a few 10s of KB. An empty policy is a
32
32
  # valid policy but certain Cloud Platform services (such as Projects)
33
33
  # might reject them.
34
+ # @!attribute [rw] update_mask
35
+ # @return [::Google::Protobuf::FieldMask]
36
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
37
+ # the fields in the mask will be modified. If no mask is provided, the
38
+ # following default mask is used:
39
+ #
40
+ # `paths: "bindings, etag"`
34
41
  class SetIamPolicyRequest
35
42
  include ::Google::Protobuf::MessageExts
36
43
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -44,7 +51,7 @@ module Google
44
51
  # @!attribute [rw] options
45
52
  # @return [::Google::Iam::V1::GetPolicyOptions]
46
53
  # OPTIONAL: A `GetPolicyOptions` object for specifying options to
47
- # `GetIamPolicy`. This field is only used by Cloud IAM.
54
+ # `GetIamPolicy`.
48
55
  class GetIamPolicyRequest
49
56
  include ::Google::Protobuf::MessageExts
50
57
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -23,14 +23,24 @@ module Google
23
23
  # Encapsulates settings provided to GetIamPolicy.
24
24
  # @!attribute [rw] requested_policy_version
25
25
  # @return [::Integer]
26
- # Optional. The policy format version to be returned.
26
+ # Optional. The maximum policy version that will be used to format the
27
+ # policy.
27
28
  #
28
29
  # Valid values are 0, 1, and 3. Requests specifying an invalid value will be
29
30
  # rejected.
30
31
  #
31
- # Requests for policies with any conditional bindings must specify version 3.
32
- # Policies without any conditional bindings may specify any valid value or
33
- # leave the field unset.
32
+ # Requests for policies with any conditional role bindings must specify
33
+ # version 3. Policies with no conditional role bindings may specify any valid
34
+ # value or leave the field unset.
35
+ #
36
+ # The policy in the response might use the policy version that you specified,
37
+ # or it might use a lower policy version. For example, if you specify version
38
+ # 3, but the policy has no conditional role bindings, the response uses
39
+ # version 1.
40
+ #
41
+ # To learn which resources support conditions in their IAM policies, see the
42
+ # [IAM
43
+ # documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
34
44
  class GetPolicyOptions
35
45
  include ::Google::Protobuf::MessageExts
36
46
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -20,19 +20,24 @@
20
20
  module Google
21
21
  module Iam
22
22
  module V1
23
- # Defines an Identity and Access Management (IAM) policy. It is used to
24
- # specify access control policies for Cloud Platform resources.
23
+ # An Identity and Access Management (IAM) policy, which specifies access
24
+ # controls for Google Cloud resources.
25
25
  #
26
26
  #
27
27
  # A `Policy` is a collection of `bindings`. A `binding` binds one or more
28
- # `members` to a single `role`. Members can be user accounts, service accounts,
29
- # Google groups, and domains (such as G Suite). A `role` is a named list of
30
- # permissions (defined by IAM or configured by users). A `binding` can
31
- # optionally specify a `condition`, which is a logic expression that further
32
- # constrains the role binding based on attributes about the request and/or
33
- # target resource.
28
+ # `members`, or principals, to a single `role`. Principals can be user
29
+ # accounts, service accounts, Google groups, and domains (such as G Suite). A
30
+ # `role` is a named list of permissions; each `role` can be an IAM predefined
31
+ # role or a user-created custom role.
34
32
  #
35
- # **JSON Example**
33
+ # For some types of Google Cloud resources, a `binding` can also specify a
34
+ # `condition`, which is a logical expression that allows access to a resource
35
+ # only if the expression evaluates to `true`. A condition can add constraints
36
+ # based on attributes of the request, the resource, or both. To learn which
37
+ # resources support conditions in their IAM policies, see the
38
+ # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
39
+ #
40
+ # **JSON example:**
36
41
  #
37
42
  # {
38
43
  # "bindings": [
@@ -47,18 +52,21 @@ module Google
47
52
  # },
48
53
  # {
49
54
  # "role": "roles/resourcemanager.organizationViewer",
50
- # "members": ["user:eve@example.com"],
55
+ # "members": [
56
+ # "user:eve@example.com"
57
+ # ],
51
58
  # "condition": {
52
59
  # "title": "expirable access",
53
60
  # "description": "Does not grant access after Sep 2020",
54
- # "expression": "request.time <
55
- # timestamp('2020-10-01T00:00:00.000Z')",
61
+ # "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')",
56
62
  # }
57
63
  # }
58
- # ]
64
+ # ],
65
+ # "etag": "BwWWja0YfJA=",
66
+ # "version": 3
59
67
  # }
60
68
  #
61
- # **YAML Example**
69
+ # **YAML example:**
62
70
  #
63
71
  # bindings:
64
72
  # - members:
@@ -74,30 +82,52 @@ module Google
74
82
  # title: expirable access
75
83
  # description: Does not grant access after Sep 2020
76
84
  # expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
85
+ # etag: BwWWja0YfJA=
86
+ # version: 3
77
87
  #
78
88
  # For a description of IAM and its features, see the
79
- # [IAM developer's guide](https://cloud.google.com/iam/docs).
89
+ # [IAM documentation](https://cloud.google.com/iam/docs/).
80
90
  # @!attribute [rw] version
81
91
  # @return [::Integer]
82
92
  # Specifies the format of the policy.
83
93
  #
84
- # Valid values are 0, 1, and 3. Requests specifying an invalid value will be
85
- # rejected.
94
+ # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
95
+ # are rejected.
96
+ #
97
+ # Any operation that affects conditional role bindings must specify version
98
+ # `3`. This requirement applies to the following operations:
86
99
  #
87
- # Operations affecting conditional bindings must specify version 3. This can
88
- # be either setting a conditional policy, modifying a conditional binding,
89
- # or removing a binding (conditional or unconditional) from the stored
90
- # conditional policy.
91
- # Operations on non-conditional policies may specify any valid value or
92
- # leave the field unset.
100
+ # * Getting a policy that includes a conditional role binding
101
+ # * Adding a conditional role binding to a policy
102
+ # * Changing a conditional role binding in a policy
103
+ # * Removing any role binding, with or without a condition, from a policy
104
+ # that includes conditions
93
105
  #
94
- # If no etag is provided in the call to `setIamPolicy`, version compliance
95
- # checks against the stored policy is skipped.
106
+ # **Important:** If you use IAM Conditions, you must include the `etag` field
107
+ # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
108
+ # you to overwrite a version `3` policy with a version `1` policy, and all of
109
+ # the conditions in the version `3` policy are lost.
110
+ #
111
+ # If a policy does not include any conditions, operations on that policy may
112
+ # specify any valid version or leave the field unset.
113
+ #
114
+ # To learn which resources support conditions in their IAM policies, see the
115
+ # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
96
116
  # @!attribute [rw] bindings
97
117
  # @return [::Array<::Google::Iam::V1::Binding>]
98
- # Associates a list of `members` to a `role`. Optionally may specify a
99
- # `condition` that determines when binding is in effect.
100
- # `bindings` with no members will result in an error.
118
+ # Associates a list of `members`, or principals, with a `role`. Optionally,
119
+ # may specify a `condition` that determines how and when the `bindings` are
120
+ # applied. Each of the `bindings` must contain at least one principal.
121
+ #
122
+ # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250
123
+ # of these principals can be Google groups. Each occurrence of a principal
124
+ # counts towards these limits. For example, if the `bindings` grant 50
125
+ # different roles to `user:alice@example.com`, and not to any other
126
+ # principal, then you can add another 1,450 principals to the `bindings` in
127
+ # the `Policy`.
128
+ # @!attribute [rw] audit_configs
129
+ # @return [::Array<::Google::Iam::V1::AuditConfig>]
130
+ # Specifies cloud audit logging configuration for this policy.
101
131
  # @!attribute [rw] etag
102
132
  # @return [::String]
103
133
  # `etag` is used for optimistic concurrency control as a way to help
@@ -108,23 +138,23 @@ module Google
108
138
  # systems are expected to put that etag in the request to `setIamPolicy` to
109
139
  # ensure that their change will be applied to the same version of the policy.
110
140
  #
111
- # If no `etag` is provided in the call to `setIamPolicy`, then the existing
112
- # policy is overwritten. Due to blind-set semantics of an etag-less policy,
113
- # 'setIamPolicy' will not fail even if the incoming policy version does not
114
- # meet the requirements for modifying the stored policy.
141
+ # **Important:** If you use IAM Conditions, you must include the `etag` field
142
+ # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
143
+ # you to overwrite a version `3` policy with a version `1` policy, and all of
144
+ # the conditions in the version `3` policy are lost.
115
145
  class Policy
116
146
  include ::Google::Protobuf::MessageExts
117
147
  extend ::Google::Protobuf::MessageExts::ClassMethods
118
148
  end
119
149
 
120
- # Associates `members` with a `role`.
150
+ # Associates `members`, or principals, with a `role`.
121
151
  # @!attribute [rw] role
122
152
  # @return [::String]
123
- # Role that is assigned to `members`.
153
+ # Role that is assigned to the list of `members`, or principals.
124
154
  # For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
125
155
  # @!attribute [rw] members
126
156
  # @return [::Array<::String>]
127
- # Specifies the identities requesting access for a Cloud Platform resource.
157
+ # Specifies the principals requesting access for a Cloud Platform resource.
128
158
  # `members` can have the following values:
129
159
  #
130
160
  # * `allUsers`: A special identifier that represents anyone who is
@@ -143,20 +173,160 @@ module Google
143
173
  # * `group:{emailid}`: An email address that represents a Google group.
144
174
  # For example, `admins@example.com`.
145
175
  #
176
+ # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
177
+ # identifier) representing a user that has been recently deleted. For
178
+ # example, `alice@example.com?uid=123456789012345678901`. If the user is
179
+ # recovered, this value reverts to `user:{emailid}` and the recovered user
180
+ # retains the role in the binding.
181
+ #
182
+ # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
183
+ # unique identifier) representing a service account that has been recently
184
+ # deleted. For example,
185
+ # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
186
+ # If the service account is undeleted, this value reverts to
187
+ # `serviceAccount:{emailid}` and the undeleted service account retains the
188
+ # role in the binding.
189
+ #
190
+ # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
191
+ # identifier) representing a Google group that has been recently
192
+ # deleted. For example, `admins@example.com?uid=123456789012345678901`. If
193
+ # the group is recovered, this value reverts to `group:{emailid}` and the
194
+ # recovered group retains the role in the binding.
195
+ #
146
196
  #
147
197
  # * `domain:{domain}`: The G Suite domain (primary) that represents all the
148
198
  # users of that domain. For example, `google.com` or `example.com`.
149
199
  # @!attribute [rw] condition
150
200
  # @return [::Google::Type::Expr]
151
201
  # The condition that is associated with this binding.
152
- # NOTE: An unsatisfied condition will not allow user access via current
153
- # binding. Different bindings, including their conditions, are examined
154
- # independently.
202
+ #
203
+ # If the condition evaluates to `true`, then this binding applies to the
204
+ # current request.
205
+ #
206
+ # If the condition evaluates to `false`, then this binding does not apply to
207
+ # the current request. However, a different role binding might grant the same
208
+ # role to one or more of the principals in this binding.
209
+ #
210
+ # To learn which resources support conditions in their IAM policies, see the
211
+ # [IAM
212
+ # documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
155
213
  class Binding
156
214
  include ::Google::Protobuf::MessageExts
157
215
  extend ::Google::Protobuf::MessageExts::ClassMethods
158
216
  end
159
217
 
218
+ # Specifies the audit configuration for a service.
219
+ # The configuration determines which permission types are logged, and what
220
+ # identities, if any, are exempted from logging.
221
+ # An AuditConfig must have one or more AuditLogConfigs.
222
+ #
223
+ # If there are AuditConfigs for both `allServices` and a specific service,
224
+ # the union of the two AuditConfigs is used for that service: the log_types
225
+ # specified in each AuditConfig are enabled, and the exempted_members in each
226
+ # AuditLogConfig are exempted.
227
+ #
228
+ # Example Policy with multiple AuditConfigs:
229
+ #
230
+ # {
231
+ # "audit_configs": [
232
+ # {
233
+ # "service": "allServices",
234
+ # "audit_log_configs": [
235
+ # {
236
+ # "log_type": "DATA_READ",
237
+ # "exempted_members": [
238
+ # "user:jose@example.com"
239
+ # ]
240
+ # },
241
+ # {
242
+ # "log_type": "DATA_WRITE"
243
+ # },
244
+ # {
245
+ # "log_type": "ADMIN_READ"
246
+ # }
247
+ # ]
248
+ # },
249
+ # {
250
+ # "service": "sampleservice.googleapis.com",
251
+ # "audit_log_configs": [
252
+ # {
253
+ # "log_type": "DATA_READ"
254
+ # },
255
+ # {
256
+ # "log_type": "DATA_WRITE",
257
+ # "exempted_members": [
258
+ # "user:aliya@example.com"
259
+ # ]
260
+ # }
261
+ # ]
262
+ # }
263
+ # ]
264
+ # }
265
+ #
266
+ # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
267
+ # logging. It also exempts jose@example.com from DATA_READ logging, and
268
+ # aliya@example.com from DATA_WRITE logging.
269
+ # @!attribute [rw] service
270
+ # @return [::String]
271
+ # Specifies a service that will be enabled for audit logging.
272
+ # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
273
+ # `allServices` is a special value that covers all services.
274
+ # @!attribute [rw] audit_log_configs
275
+ # @return [::Array<::Google::Iam::V1::AuditLogConfig>]
276
+ # The configuration for logging of each type of permission.
277
+ class AuditConfig
278
+ include ::Google::Protobuf::MessageExts
279
+ extend ::Google::Protobuf::MessageExts::ClassMethods
280
+ end
281
+
282
+ # Provides the configuration for logging a type of permissions.
283
+ # Example:
284
+ #
285
+ # {
286
+ # "audit_log_configs": [
287
+ # {
288
+ # "log_type": "DATA_READ",
289
+ # "exempted_members": [
290
+ # "user:jose@example.com"
291
+ # ]
292
+ # },
293
+ # {
294
+ # "log_type": "DATA_WRITE"
295
+ # }
296
+ # ]
297
+ # }
298
+ #
299
+ # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting
300
+ # jose@example.com from DATA_READ logging.
301
+ # @!attribute [rw] log_type
302
+ # @return [::Google::Iam::V1::AuditLogConfig::LogType]
303
+ # The log type that this config enables.
304
+ # @!attribute [rw] exempted_members
305
+ # @return [::Array<::String>]
306
+ # Specifies the identities that do not cause logging for this type of
307
+ # permission.
308
+ # Follows the same format of {::Google::Iam::V1::Binding#members Binding.members}.
309
+ class AuditLogConfig
310
+ include ::Google::Protobuf::MessageExts
311
+ extend ::Google::Protobuf::MessageExts::ClassMethods
312
+
313
+ # The list of valid permission types for which logging can be configured.
314
+ # Admin writes are always logged, and are not configurable.
315
+ module LogType
316
+ # Default case. Should never be this.
317
+ LOG_TYPE_UNSPECIFIED = 0
318
+
319
+ # Admin reads. Example: CloudIAM getIamPolicy
320
+ ADMIN_READ = 1
321
+
322
+ # Data writes. Example: CloudSQL Users create
323
+ DATA_WRITE = 2
324
+
325
+ # Data reads. Example: CloudSQL Users list
326
+ DATA_READ = 3
327
+ end
328
+ end
329
+
160
330
  # The difference delta between two policies.
161
331
  # @!attribute [rw] binding_deltas
162
332
  # @return [::Array<::Google::Iam::V1::BindingDelta>]
@@ -83,6 +83,25 @@ module Google
83
83
  # @!attribute [r] encryption_info
84
84
  # @return [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo]
85
85
  # Output only. The encryption information for the backup.
86
+ # @!attribute [r] database_dialect
87
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::DatabaseDialect]
88
+ # Output only. The database dialect information for the backup.
89
+ # @!attribute [r] referencing_backups
90
+ # @return [::Array<::String>]
91
+ # Output only. The names of the destination backups being created by copying
92
+ # this source backup. The backup names are of the form
93
+ # `projects/<project>/instances/<instance>/backups/<backup>`.
94
+ # Referencing backups may exist in different instances. The existence of
95
+ # any referencing backup prevents the backup from being deleted. When the
96
+ # copy operation is done (either successfully completed or cancelled or the
97
+ # destination backup is deleted), the reference to the backup is removed.
98
+ # @!attribute [r] max_expire_time
99
+ # @return [::Google::Protobuf::Timestamp]
100
+ # Output only. The max allowed expiration time of the backup, with
101
+ # microseconds granularity. A backup's expiration time can be configured in
102
+ # multiple APIs: CreateBackup, UpdateBackup, CopyBackup. When updating or
103
+ # copying an existing backup, the expiration time specified must be
104
+ # less than `Backup.max_expire_time`.
86
105
  class Backup
87
106
  include ::Google::Protobuf::MessageExts
88
107
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -161,6 +180,78 @@ module Google
161
180
  extend ::Google::Protobuf::MessageExts::ClassMethods
162
181
  end
163
182
 
183
+ # The request for {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup CopyBackup}.
184
+ # @!attribute [rw] parent
185
+ # @return [::String]
186
+ # Required. The name of the destination instance that will contain the backup copy.
187
+ # Values are of the form: `projects/<project>/instances/<instance>`.
188
+ # @!attribute [rw] backup_id
189
+ # @return [::String]
190
+ # Required. The id of the backup copy.
191
+ # The `backup_id` appended to `parent` forms the full backup_uri of the form
192
+ # `projects/<project>/instances/<instance>/backups/<backup>`.
193
+ # @!attribute [rw] source_backup
194
+ # @return [::String]
195
+ # Required. The source backup to be copied.
196
+ # The source backup needs to be in READY state for it to be copied.
197
+ # Once CopyBackup is in progress, the source backup cannot be deleted or
198
+ # cleaned up on expiration until CopyBackup is finished.
199
+ # Values are of the form:
200
+ # `projects/<project>/instances/<instance>/backups/<backup>`.
201
+ # @!attribute [rw] expire_time
202
+ # @return [::Google::Protobuf::Timestamp]
203
+ # Required. The expiration time of the backup in microsecond granularity.
204
+ # The expiration time must be at least 6 hours and at most 366 days
205
+ # from the `create_time` of the source backup. Once the `expire_time` has
206
+ # passed, the backup is eligible to be automatically deleted by Cloud Spanner
207
+ # to free the resources used by the backup.
208
+ # @!attribute [rw] encryption_config
209
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig]
210
+ # Optional. The encryption configuration used to encrypt the backup. If this field is
211
+ # not specified, the backup will use the same
212
+ # encryption configuration as the source backup by default, namely
213
+ # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig#encryption_type encryption_type} =
214
+ # `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
215
+ class CopyBackupRequest
216
+ include ::Google::Protobuf::MessageExts
217
+ extend ::Google::Protobuf::MessageExts::ClassMethods
218
+ end
219
+
220
+ # Metadata type for the google.longrunning.Operation returned by
221
+ # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup CopyBackup}.
222
+ # @!attribute [rw] name
223
+ # @return [::String]
224
+ # The name of the backup being created through the copy operation.
225
+ # Values are of the form
226
+ # `projects/<project>/instances/<instance>/backups/<backup>`.
227
+ # @!attribute [rw] source_backup
228
+ # @return [::String]
229
+ # The name of the source backup that is being copied.
230
+ # Values are of the form
231
+ # `projects/<project>/instances/<instance>/backups/<backup>`.
232
+ # @!attribute [rw] progress
233
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::OperationProgress]
234
+ # The progress of the
235
+ # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup CopyBackup} operation.
236
+ # @!attribute [rw] cancel_time
237
+ # @return [::Google::Protobuf::Timestamp]
238
+ # The time at which cancellation of CopyBackup operation was received.
239
+ # Operations.CancelOperation
240
+ # starts asynchronous cancellation on a long-running operation. The server
241
+ # makes a best effort to cancel the operation, but success is not guaranteed.
242
+ # Clients can use
243
+ # Operations.GetOperation or
244
+ # other methods to check whether the cancellation succeeded or whether the
245
+ # operation completed despite cancellation. On successful cancellation,
246
+ # the operation is not deleted; instead, it becomes an operation with
247
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
248
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
249
+ # corresponding to `Code.CANCELLED`.
250
+ class CopyBackupMetadata
251
+ include ::Google::Protobuf::MessageExts
252
+ extend ::Google::Protobuf::MessageExts::ClassMethods
253
+ end
254
+
164
255
  # The request for {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup UpdateBackup}.
165
256
  # @!attribute [rw] backup
166
257
  # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup]
@@ -299,6 +390,8 @@ module Google
299
390
  # for {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} is
300
391
  # `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
301
392
  # * `metadata.<field_name>` - any field in metadata.value.
393
+ # `metadata.@type` must be specified first if filtering on metadata
394
+ # fields.
302
395
  # * `error` - Error associated with the long-running operation.
303
396
  # * `response.@type` - the type of response.
304
397
  # * `response.<field_name>` - any field in response.value.
@@ -310,8 +403,11 @@ module Google
310
403
  # Here are a few examples:
311
404
  #
312
405
  # * `done:true` - The operation is complete.
313
- # * `metadata.database:prod` - The database the backup was taken from has
314
- # a name containing the string "prod".
406
+ # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
407
+ # `metadata.database:prod` - Returns operations where:
408
+ # * The operation's metadata type is {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}.
409
+ # * The database the backup was taken from has a name containing the
410
+ # string "prod".
315
411
  # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
316
412
  # `(metadata.name:howl) AND` \
317
413
  # `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
@@ -320,6 +416,29 @@ module Google
320
416
  # * The backup name contains the string "howl".
321
417
  # * The operation started before 2018-03-28T14:50:00Z.
322
418
  # * The operation resulted in an error.
419
+ # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \
420
+ # `(metadata.source_backup:test) AND` \
421
+ # `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \
422
+ # `(error:*)` - Returns operations where:
423
+ # * The operation's metadata type is {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata}.
424
+ # * The source backup of the copied backup name contains the string
425
+ # "test".
426
+ # * The operation started before 2022-01-18T14:50:00Z.
427
+ # * The operation resulted in an error.
428
+ # * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
429
+ # `(metadata.database:test_db)) OR` \
430
+ # `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata)
431
+ # AND` \
432
+ # `(metadata.source_backup:test_bkp)) AND` \
433
+ # `(error:*)` - Returns operations where:
434
+ # * The operation's metadata matches either of criteria:
435
+ # * The operation's metadata type is {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} AND the
436
+ # database the backup was taken from has name containing string
437
+ # "test_db"
438
+ # * The operation's metadata type is {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata} AND the
439
+ # backup the backup was copied from has name containing string
440
+ # "test_bkp"
441
+ # * The operation resulted in an error.
323
442
  # @!attribute [rw] page_size
324
443
  # @return [::Integer]
325
444
  # Number of operations to be returned in the response. If 0 or
@@ -341,11 +460,11 @@ module Google
341
460
  # @return [::Array<::Google::Longrunning::Operation>]
342
461
  # The list of matching backup [long-running
343
462
  # operations][google.longrunning.Operation]. Each operation's name will be
344
- # prefixed by the backup's name and the operation's
345
- # {::Google::Longrunning::Operation#metadata metadata} will be of type
346
- # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}. Operations returned include those that are
347
- # pending or have completed/failed/canceled within the last 7 days.
348
- # Operations returned are ordered by
463
+ # prefixed by the backup's name. The operation's
464
+ # {::Google::Longrunning::Operation#metadata metadata} field type
465
+ # `metadata.type_url` describes the type of the metadata. Operations returned
466
+ # include those that are pending or have completed/failed/canceled within the
467
+ # last 7 days. Operations returned are ordered by
349
468
  # `operation.metadata.value.progress.start_time` in descending order starting
350
469
  # from the most recently started operation.
351
470
  # @!attribute [rw] next_page_token
@@ -416,6 +535,41 @@ module Google
416
535
  CUSTOMER_MANAGED_ENCRYPTION = 3
417
536
  end
418
537
  end
538
+
539
+ # Encryption configuration for the copied backup.
540
+ # @!attribute [rw] encryption_type
541
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig::EncryptionType]
542
+ # Required. The encryption type of the backup.
543
+ # @!attribute [rw] kms_key_name
544
+ # @return [::String]
545
+ # Optional. The Cloud KMS key that will be used to protect the backup.
546
+ # This field should be set only when
547
+ # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig#encryption_type encryption_type} is
548
+ # `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
549
+ # `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
550
+ class CopyBackupEncryptionConfig
551
+ include ::Google::Protobuf::MessageExts
552
+ extend ::Google::Protobuf::MessageExts::ClassMethods
553
+
554
+ # Encryption types for the backup.
555
+ module EncryptionType
556
+ # Unspecified. Do not use.
557
+ ENCRYPTION_TYPE_UNSPECIFIED = 0
558
+
559
+ # This is the default option for {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup CopyBackup}
560
+ # when {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig encryption_config} is not specified.
561
+ # For example, if the source backup is using `Customer_Managed_Encryption`,
562
+ # the backup will be using the same Cloud KMS key as the source backup.
563
+ USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1
564
+
565
+ # Use Google default encryption.
566
+ GOOGLE_DEFAULT_ENCRYPTION = 2
567
+
568
+ # Use customer managed encryption. If specified, `kms_key_name`
569
+ # must contain a valid Cloud KMS key.
570
+ CUSTOMER_MANAGED_ENCRYPTION = 3
571
+ end
572
+ end
419
573
  end
420
574
  end
421
575
  end
@@ -85,6 +85,19 @@ module Google
85
85
  CUSTOMER_MANAGED_ENCRYPTION = 2
86
86
  end
87
87
  end
88
+
89
+ # Indicates the dialect type of a database.
90
+ module DatabaseDialect
91
+ # Default value. This value will create a database with the
92
+ # GOOGLE_STANDARD_SQL dialect.
93
+ DATABASE_DIALECT_UNSPECIFIED = 0
94
+
95
+ # Google standard SQL.
96
+ GOOGLE_STANDARD_SQL = 1
97
+
98
+ # PostgreSQL supported SQL.
99
+ POSTGRESQL = 2
100
+ end
88
101
  end
89
102
  end
90
103
  end
@@ -93,6 +93,9 @@ module Google
93
93
  # This is the same as the value of default_leader
94
94
  # database option set using DatabaseAdmin.CreateDatabase or
95
95
  # DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty.
96
+ # @!attribute [r] database_dialect
97
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::DatabaseDialect]
98
+ # Output only. The dialect of the Cloud Spanner Database.
96
99
  class Database
97
100
  include ::Google::Protobuf::MessageExts
98
101
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -177,6 +180,9 @@ module Google
177
180
  # Optional. The encryption configuration for the database. If this field is not
178
181
  # specified, Cloud Spanner will encrypt/decrypt all data at rest using
179
182
  # Google default encryption.
183
+ # @!attribute [rw] database_dialect
184
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::DatabaseDialect]
185
+ # Optional. The dialect of the Cloud Spanner Database.
180
186
  class CreateDatabaseRequest
181
187
  include ::Google::Protobuf::MessageExts
182
188
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -339,6 +345,8 @@ module Google
339
345
  # for {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata} is
340
346
  # `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
341
347
  # * `metadata.<field_name>` - any field in metadata.value.
348
+ # `metadata.@type` must be specified first, if filtering on metadata
349
+ # fields.
342
350
  # * `error` - Error associated with the long-running operation.
343
351
  # * `response.@type` - the type of response.
344
352
  # * `response.<field_name>` - any field in response.value.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-spanner-admin-database-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-11 00:00:00.000000000 Z
11
+ date: 2022-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -48,22 +48,16 @@ dependencies:
48
48
  name: grpc-google-iam-v1
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: 0.6.10
54
- - - "<"
51
+ - - "~>"
55
52
  - !ruby/object:Gem::Version
56
- version: 2.a
53
+ version: '1.1'
57
54
  type: :runtime
58
55
  prerelease: false
59
56
  version_requirements: !ruby/object:Gem::Requirement
60
57
  requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: 0.6.10
64
- - - "<"
58
+ - - "~>"
65
59
  - !ruby/object:Gem::Version
66
- version: 2.a
60
+ version: '1.1'
67
61
  - !ruby/object:Gem::Dependency
68
62
  name: google-style
69
63
  requirement: !ruby/object:Gem::Requirement
@@ -237,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
231
  - !ruby/object:Gem::Version
238
232
  version: '0'
239
233
  requirements: []
240
- rubygems_version: 3.3.4
234
+ rubygems_version: 3.3.5
241
235
  signing_key:
242
236
  specification_version: 4
243
237
  summary: API Client library for the Cloud Spanner Database Admin V1 API