google-cloud-spanner-admin-database-v1 0.7.4 → 0.8.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: 7850a1030f9dc1f0b3a33740017a9e604c1703a83d3d44535f0511aa788aab52
4
- data.tar.gz: 1d23ea38d3052035f60789383cb3e27bbfd86abe07ef7d467071cc6127a64c1b
3
+ metadata.gz: 9219a47f66e9f55a4fe552b65d5b4710d5fef956b657a2756cc7080dbaa7c146
4
+ data.tar.gz: e044561ca992c478d3d3f147797e15d81b7eb3852800de829850668c9559af79
5
5
  SHA512:
6
- metadata.gz: 506f8c559aa0a749bbe2e1f6697d56271403c407055a9f9b7c07880133028c4023087559f2d0acedb1080b859448f0ee375ecbf931af95a45bf3769148132c8f
7
- data.tar.gz: 6da0f55b46a7550ff59d9626a354cf49e3e8e2ea0777012bea3d9d3e7f1494f8486f04335f76c3068130135e367f207fb8698a967f631e63a5a7260ec2d87340
6
+ metadata.gz: 499542169d3a14c1bb054b655f0f12427db68a90b87dd1d412dad1c83441c13102a75e14fe0221e30e0a858ffe605406f870059ac2a5919278c9949796ce2b2d
7
+ data.tar.gz: 6a743d549430da2af1f3336d12c350fb8f5abaf71488840ad364ea3da5f332bda19dda027488bbbea217402ed2f4c7ca4689b741da3170168faae4d7f510583c
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
- --title=Cloud Spanner Database Admin V1 API
2
+ --title="Cloud Spanner Database Admin V1 API"
3
3
  --exclude _pb\.rb$
4
4
  --markup markdown
5
5
  --markup-provider redcarpet
data/AUTHENTICATION.md CHANGED
@@ -120,15 +120,6 @@ To configure your system for this, simply:
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
121
121
  *should* only be used during development.
122
122
 
123
- [gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
124
- [dev-console]: https://console.cloud.google.com/project
125
-
126
- [enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
127
-
128
- [create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
129
- [create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
130
- [reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
131
-
132
123
  ## Creating a Service Account
133
124
 
134
125
  Google Cloud requires **Service Account Credentials** to
@@ -139,31 +130,22 @@ If you are not running this client within
139
130
  [Google Cloud Platform environments](#google-cloud-platform-environments), you
140
131
  need a Google Developers service account.
141
132
 
142
- 1. Visit the [Google Developers Console][dev-console].
133
+ 1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
143
134
  2. Create a new project or click on an existing project.
144
- 3. Activate the slide-out navigation tray and select **API Manager**. From
135
+ 3. Activate the menu in the upper left and select **APIs & Services**. From
145
136
  here, you will enable the APIs that your application requires.
146
137
 
147
- ![Enable the APIs that your application requires][enable-apis]
148
-
149
138
  *Note: You may need to enable billing in order to use these services.*
150
139
 
151
140
  4. Select **Credentials** from the side navigation.
152
141
 
153
- You should see a screen like one of the following.
154
-
155
- ![Create a new service account][create-new-service-account]
156
-
157
- ![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
158
-
159
- Find the "Add credentials" drop down and select "Service account" to be
160
- guided through downloading a new JSON key file.
142
+ Find the "Create credentials" drop down near the top of the page, and select
143
+ "Service account" to be guided through downloading a new JSON key file.
161
144
 
162
145
  If you want to re-use an existing service account, you can easily generate a
163
- new key file. Just select the account you wish to re-use, and click "Generate
164
- new JSON key":
165
-
166
- ![Re-use an existing service account][reuse-service-account]
146
+ new key file. Just select the account you wish to re-use, click the pencil
147
+ tool on the right side to edit the service account, select the **Keys** tab,
148
+ and then select **Add Key**.
167
149
 
168
150
  The key file you download will be used by this library to authenticate API
169
151
  requests and should be stored in a secure location.
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]
@@ -212,6 +215,7 @@ module Google
212
215
 
213
216
  @operations_client = Operations.new do |config|
214
217
  config.credentials = credentials
218
+ config.quota_project = @quota_project_id
215
219
  config.endpoint = @config.endpoint
216
220
  end
217
221
 
@@ -353,7 +357,7 @@ module Google
353
357
  # @param options [::Gapic::CallOptions, ::Hash]
354
358
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
355
359
  #
356
- # @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)
357
361
  # Pass arguments to `create_database` via keyword arguments. Note that at
358
362
  # least one keyword argument is required. To specify no parameters, or to keep all
359
363
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -376,6 +380,8 @@ module Google
376
380
  # Optional. The encryption configuration for the database. If this field is not
377
381
  # specified, Cloud Spanner will encrypt/decrypt all data at rest using
378
382
  # Google default encryption.
383
+ # @param database_dialect [::Google::Cloud::Spanner::Admin::Database::V1::DatabaseDialect]
384
+ # Optional. The dialect of the Cloud Spanner Database.
379
385
  #
380
386
  # @yield [response, operation] Access the result along with the RPC operation
381
387
  # @yieldparam response [::Gapic::Operation]
@@ -660,6 +666,8 @@ module Google
660
666
  # Drops (aka deletes) a Cloud Spanner database.
661
667
  # Completed backups for the database will be retained according to their
662
668
  # `expire_time`.
669
+ # Note: Cloud Spanner might continue to accept requests for a few seconds
670
+ # after the database has been deleted.
663
671
  #
664
672
  # @overload drop_database(request, options = nil)
665
673
  # Pass arguments to `drop_database` via a request object, either of type
@@ -1246,6 +1254,134 @@ module Google
1246
1254
  raise ::Google::Cloud::Error.from_error(e)
1247
1255
  end
1248
1256
 
1257
+ ##
1258
+ # Starts copying a Cloud Spanner Backup.
1259
+ # The returned backup {::Google::Longrunning::Operation long-running operation}
1260
+ # will have a name of the format
1261
+ # `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
1262
+ # and can be used to track copying of the backup. The operation is associated
1263
+ # with the destination backup.
1264
+ # The {::Google::Longrunning::Operation#metadata metadata} field type is
1265
+ # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata}.
1266
+ # The {::Google::Longrunning::Operation#response response} field type is
1267
+ # {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}, if successful. Cancelling the returned operation will stop the
1268
+ # copying and delete the backup.
1269
+ # Concurrent CopyBackup requests can run on the same source backup.
1270
+ #
1271
+ # @overload copy_backup(request, options = nil)
1272
+ # Pass arguments to `copy_backup` via a request object, either of type
1273
+ # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest} or an equivalent Hash.
1274
+ #
1275
+ # @param request [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest, ::Hash]
1276
+ # A request object representing the call parameters. Required. To specify no
1277
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1278
+ # @param options [::Gapic::CallOptions, ::Hash]
1279
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1280
+ #
1281
+ # @overload copy_backup(parent: nil, backup_id: nil, source_backup: nil, expire_time: nil, encryption_config: nil)
1282
+ # Pass arguments to `copy_backup` via keyword arguments. Note that at
1283
+ # least one keyword argument is required. To specify no parameters, or to keep all
1284
+ # the default parameter values, pass an empty Hash as a request object (see above).
1285
+ #
1286
+ # @param parent [::String]
1287
+ # Required. The name of the destination instance that will contain the backup copy.
1288
+ # Values are of the form: `projects/<project>/instances/<instance>`.
1289
+ # @param backup_id [::String]
1290
+ # Required. The id of the backup copy.
1291
+ # The `backup_id` appended to `parent` forms the full backup_uri of the form
1292
+ # `projects/<project>/instances/<instance>/backups/<backup>`.
1293
+ # @param source_backup [::String]
1294
+ # Required. The source backup to be copied.
1295
+ # The source backup needs to be in READY state for it to be copied.
1296
+ # Once CopyBackup is in progress, the source backup cannot be deleted or
1297
+ # cleaned up on expiration until CopyBackup is finished.
1298
+ # Values are of the form:
1299
+ # `projects/<project>/instances/<instance>/backups/<backup>`.
1300
+ # @param expire_time [::Google::Protobuf::Timestamp, ::Hash]
1301
+ # Required. The expiration time of the backup in microsecond granularity.
1302
+ # The expiration time must be at least 6 hours and at most 366 days
1303
+ # from the `create_time` of the source backup. Once the `expire_time` has
1304
+ # passed, the backup is eligible to be automatically deleted by Cloud Spanner
1305
+ # to free the resources used by the backup.
1306
+ # @param encryption_config [::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig, ::Hash]
1307
+ # Optional. The encryption configuration used to encrypt the backup. If this field is
1308
+ # not specified, the backup will use the same
1309
+ # encryption configuration as the source backup by default, namely
1310
+ # {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupEncryptionConfig#encryption_type encryption_type} =
1311
+ # `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
1312
+ #
1313
+ # @yield [response, operation] Access the result along with the RPC operation
1314
+ # @yieldparam response [::Gapic::Operation]
1315
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1316
+ #
1317
+ # @return [::Gapic::Operation]
1318
+ #
1319
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1320
+ #
1321
+ # @example Basic example
1322
+ # require "google/cloud/spanner/admin/database/v1"
1323
+ #
1324
+ # # Create a client object. The client can be reused for multiple calls.
1325
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new
1326
+ #
1327
+ # # Create a request. To set request fields, pass in keyword arguments.
1328
+ # request = Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new
1329
+ #
1330
+ # # Call the copy_backup method.
1331
+ # result = client.copy_backup request
1332
+ #
1333
+ # # The returned object is of type Gapic::Operation. You can use this
1334
+ # # object to check the status of an operation, cancel it, or wait
1335
+ # # for results. Here is how to block until completion:
1336
+ # result.wait_until_done! timeout: 60
1337
+ # if result.response?
1338
+ # p result.response
1339
+ # else
1340
+ # puts "Error!"
1341
+ # end
1342
+ #
1343
+ def copy_backup request, options = nil
1344
+ raise ::ArgumentError, "request must be provided" if request.nil?
1345
+
1346
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest
1347
+
1348
+ # Converts hash and nil to an options object
1349
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1350
+
1351
+ # Customize the options with defaults
1352
+ metadata = @config.rpcs.copy_backup.metadata.to_h
1353
+
1354
+ # Set x-goog-api-client and x-goog-user-project headers
1355
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1356
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1357
+ gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION
1358
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1359
+
1360
+ header_params = {}
1361
+ if request.parent
1362
+ header_params["parent"] = request.parent
1363
+ end
1364
+
1365
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1366
+ metadata[:"x-goog-request-params"] ||= request_params_header
1367
+
1368
+ options.apply_defaults timeout: @config.rpcs.copy_backup.timeout,
1369
+ metadata: metadata,
1370
+ retry_policy: @config.rpcs.copy_backup.retry_policy
1371
+
1372
+ options.apply_defaults timeout: @config.timeout,
1373
+ metadata: @config.metadata,
1374
+ retry_policy: @config.retry_policy
1375
+
1376
+ @database_admin_stub.call_rpc :copy_backup, request, options: options do |response, operation|
1377
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1378
+ yield response, operation if block_given?
1379
+ return response
1380
+ end
1381
+ rescue ::GRPC::BadStatus => e
1382
+ raise ::Google::Cloud::Error.from_error(e)
1383
+ end
1384
+
1249
1385
  ##
1250
1386
  # Gets metadata on a pending or completed {::Google::Cloud::Spanner::Admin::Database::V1::Backup Backup}.
1251
1387
  #
@@ -1827,6 +1963,8 @@ module Google
1827
1963
  # for {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata} is
1828
1964
  # `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
1829
1965
  # * `metadata.<field_name>` - any field in metadata.value.
1966
+ # `metadata.@type` must be specified first, if filtering on metadata
1967
+ # fields.
1830
1968
  # * `error` - Error associated with the long-running operation.
1831
1969
  # * `response.@type` - the type of response.
1832
1970
  # * `response.<field_name>` - any field in response.value.
@@ -1979,6 +2117,8 @@ module Google
1979
2117
  # for {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} is
1980
2118
  # `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
1981
2119
  # * `metadata.<field_name>` - any field in metadata.value.
2120
+ # `metadata.@type` must be specified first if filtering on metadata
2121
+ # fields.
1982
2122
  # * `error` - Error associated with the long-running operation.
1983
2123
  # * `response.@type` - the type of response.
1984
2124
  # * `response.<field_name>` - any field in response.value.
@@ -1990,8 +2130,11 @@ module Google
1990
2130
  # Here are a few examples:
1991
2131
  #
1992
2132
  # * `done:true` - The operation is complete.
1993
- # * `metadata.database:prod` - The database the backup was taken from has
1994
- # a name containing the string "prod".
2133
+ # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
2134
+ # `metadata.database:prod` - Returns operations where:
2135
+ # * The operation's metadata type is {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata}.
2136
+ # * The database the backup was taken from has a name containing the
2137
+ # string "prod".
1995
2138
  # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
1996
2139
  # `(metadata.name:howl) AND` \
1997
2140
  # `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
@@ -2000,6 +2143,29 @@ module Google
2000
2143
  # * The backup name contains the string "howl".
2001
2144
  # * The operation started before 2018-03-28T14:50:00Z.
2002
2145
  # * The operation resulted in an error.
2146
+ # * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \
2147
+ # `(metadata.source_backup:test) AND` \
2148
+ # `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \
2149
+ # `(error:*)` - Returns operations where:
2150
+ # * The operation's metadata type is {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata}.
2151
+ # * The source backup of the copied backup name contains the string
2152
+ # "test".
2153
+ # * The operation started before 2022-01-18T14:50:00Z.
2154
+ # * The operation resulted in an error.
2155
+ # * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
2156
+ # `(metadata.database:test_db)) OR` \
2157
+ # `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata)
2158
+ # AND` \
2159
+ # `(metadata.source_backup:test_bkp)) AND` \
2160
+ # `(error:*)` - Returns operations where:
2161
+ # * The operation's metadata matches either of criteria:
2162
+ # * The operation's metadata type is {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata CreateBackupMetadata} AND the
2163
+ # database the backup was taken from has name containing string
2164
+ # "test_db"
2165
+ # * The operation's metadata type is {::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupMetadata CopyBackupMetadata} AND the
2166
+ # backup the backup was copied from has name containing string
2167
+ # "test_bkp"
2168
+ # * The operation resulted in an error.
2003
2169
  # @param page_size [::Integer]
2004
2170
  # Number of operations to be returned in the response. If 0 or
2005
2171
  # less, defaults to the server's maximum allowed page size.
@@ -2267,6 +2433,11 @@ module Google
2267
2433
  #
2268
2434
  attr_reader :create_backup
2269
2435
  ##
2436
+ # RPC-specific configuration for `copy_backup`
2437
+ # @return [::Gapic::Config::Method]
2438
+ #
2439
+ attr_reader :copy_backup
2440
+ ##
2270
2441
  # RPC-specific configuration for `get_backup`
2271
2442
  # @return [::Gapic::Config::Method]
2272
2443
  #
@@ -2324,6 +2495,8 @@ module Google
2324
2495
  @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
2325
2496
  create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup
2326
2497
  @create_backup = ::Gapic::Config::Method.new create_backup_config
2498
+ copy_backup_config = parent_rpcs.copy_backup if parent_rpcs.respond_to? :copy_backup
2499
+ @copy_backup = ::Gapic::Config::Method.new copy_backup_config
2327
2500
  get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
2328
2501
  @get_backup = ::Gapic::Config::Method.new get_backup_config
2329
2502
  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.4"
26
+ VERSION = "0.8.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].
@@ -33,11 +33,7 @@ module Google
33
33
  # // For Kubernetes resources, the format is {api group}/{kind}.
34
34
  # option (google.api.resource) = {
35
35
  # type: "pubsub.googleapis.com/Topic"
36
- # name_descriptor: {
37
- # pattern: "projects/{project}/topics/{topic}"
38
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
39
- # parent_name_extractor: "projects/{project}"
40
- # }
36
+ # pattern: "projects/{project}/topics/{topic}"
41
37
  # };
42
38
  # }
43
39
  #
@@ -45,10 +41,7 @@ module Google
45
41
  #
46
42
  # resources:
47
43
  # - type: "pubsub.googleapis.com/Topic"
48
- # name_descriptor:
49
- # - pattern: "projects/{project}/topics/{topic}"
50
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
- # parent_name_extractor: "projects/{project}"
44
+ # pattern: "projects/{project}/topics/{topic}"
52
45
  #
53
46
  # Sometimes, resources have multiple patterns, typically because they can
54
47
  # live under multiple parents.
@@ -58,26 +51,10 @@ module Google
58
51
  # message LogEntry {
59
52
  # option (google.api.resource) = {
60
53
  # type: "logging.googleapis.com/LogEntry"
61
- # name_descriptor: {
62
- # pattern: "projects/{project}/logs/{log}"
63
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
64
- # parent_name_extractor: "projects/{project}"
65
- # }
66
- # name_descriptor: {
67
- # pattern: "folders/{folder}/logs/{log}"
68
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
69
- # parent_name_extractor: "folders/{folder}"
70
- # }
71
- # name_descriptor: {
72
- # pattern: "organizations/{organization}/logs/{log}"
73
- # parent_type: "cloudresourcemanager.googleapis.com/Organization"
74
- # parent_name_extractor: "organizations/{organization}"
75
- # }
76
- # name_descriptor: {
77
- # pattern: "billingAccounts/{billing_account}/logs/{log}"
78
- # parent_type: "billing.googleapis.com/BillingAccount"
79
- # parent_name_extractor: "billingAccounts/{billing_account}"
80
- # }
54
+ # pattern: "projects/{project}/logs/{log}"
55
+ # pattern: "folders/{folder}/logs/{log}"
56
+ # pattern: "organizations/{organization}/logs/{log}"
57
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
81
58
  # };
82
59
  # }
83
60
  #
@@ -85,48 +62,10 @@ module Google
85
62
  #
86
63
  # resources:
87
64
  # - type: 'logging.googleapis.com/LogEntry'
88
- # name_descriptor:
89
- # - pattern: "projects/{project}/logs/{log}"
90
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
91
- # parent_name_extractor: "projects/{project}"
92
- # - pattern: "folders/{folder}/logs/{log}"
93
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
94
- # parent_name_extractor: "folders/{folder}"
95
- # - pattern: "organizations/{organization}/logs/{log}"
96
- # parent_type: "cloudresourcemanager.googleapis.com/Organization"
97
- # parent_name_extractor: "organizations/{organization}"
98
- # - pattern: "billingAccounts/{billing_account}/logs/{log}"
99
- # parent_type: "billing.googleapis.com/BillingAccount"
100
- # parent_name_extractor: "billingAccounts/{billing_account}"
101
- #
102
- # For flexible resources, the resource name doesn't contain parent names, but
103
- # the resource itself has parents for policy evaluation.
104
- #
105
- # Example:
106
- #
107
- # message Shelf {
108
- # option (google.api.resource) = {
109
- # type: "library.googleapis.com/Shelf"
110
- # name_descriptor: {
111
- # pattern: "shelves/{shelf}"
112
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
113
- # }
114
- # name_descriptor: {
115
- # pattern: "shelves/{shelf}"
116
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
117
- # }
118
- # };
119
- # }
120
- #
121
- # The ResourceDescriptor Yaml config will look like:
122
- #
123
- # resources:
124
- # - type: 'library.googleapis.com/Shelf'
125
- # name_descriptor:
126
- # - pattern: "shelves/{shelf}"
127
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
128
- # - pattern: "shelves/{shelf}"
129
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
65
+ # pattern: "projects/{project}/logs/{log}"
66
+ # pattern: "folders/{folder}/logs/{log}"
67
+ # pattern: "organizations/{organization}/logs/{log}"
68
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
130
69
  # @!attribute [rw] type
131
70
  # @return [::String]
132
71
  # The resource type. It must be in the format of
@@ -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.4
4
+ version: 0.8.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: 2021-11-08 00:00:00.000000000 Z
11
+ date: 2022-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -237,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
237
  - !ruby/object:Gem::Version
238
238
  version: '0'
239
239
  requirements: []
240
- rubygems_version: 3.2.17
240
+ rubygems_version: 3.3.5
241
241
  signing_key:
242
242
  specification_version: 4
243
243
  summary: API Client library for the Cloud Spanner Database Admin V1 API