@google-cloud/spanner 5.17.0 → 5.18.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,21 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/nodejs-spanner?activeTab=versions
6
6
 
7
+ ## [5.18.0](https://github.com/googleapis/nodejs-spanner/compare/v5.17.0...v5.18.0) (2022-04-03)
8
+
9
+
10
+ ### Features
11
+
12
+ * add support for Cross region backup proto changes ([#1587](https://github.com/googleapis/nodejs-spanner/issues/1587)) ([9439ca4](https://github.com/googleapis/nodejs-spanner/commit/9439ca4cf260923a7cb90e0568864cb719ab8fc6))
13
+ * integration testing for postgres dialect ([#1593](https://github.com/googleapis/nodejs-spanner/issues/1593)) ([ebe06a6](https://github.com/googleapis/nodejs-spanner/commit/ebe06a6cefbeacc37c40f2474b9d265b78c846e2))
14
+ * Postgres Numeric and database support ([#1592](https://github.com/googleapis/nodejs-spanner/issues/1592)) ([7ca3975](https://github.com/googleapis/nodejs-spanner/commit/7ca3975c5e25e78983f77df9e921642c90874f90))
15
+ * Spanner copy backup ([#1530](https://github.com/googleapis/nodejs-spanner/issues/1530)) ([cefb1b4](https://github.com/googleapis/nodejs-spanner/commit/cefb1b4c831997e5c52122c5e6c3fd9cd9cb2c76))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * removing table_catalog from schema information ([#1595](https://github.com/googleapis/nodejs-spanner/issues/1595)) ([8bcbd95](https://github.com/googleapis/nodejs-spanner/commit/8bcbd95e7423f03aa16ffd500fca998f75c8d0cf))
21
+
7
22
  ## [5.17.0](https://github.com/googleapis/nodejs-spanner/compare/v5.16.3...v5.17.0) (2022-03-09)
8
23
 
9
24
 
package/README.md CHANGED
@@ -90,6 +90,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
90
90
  | Sample | Source Code | Try it |
91
91
  | --------------------------- | --------------------------------- | ------ |
92
92
  | Backups-cancel | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups-cancel.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-cancel.js,samples/README.md) |
93
+ | Copies a source backup | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups-copy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-copy.js,samples/README.md) |
93
94
  | Backups-create-with-encryption-key | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups-create-with-encryption-key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-create-with-encryption-key.js,samples/README.md) |
94
95
  | Backups-create | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups-create.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-create.js,samples/README.md) |
95
96
  | Backups-delete | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups-delete.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/backups-delete.js,samples/README.md) |
@@ -128,6 +129,18 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
128
129
  | Numeric-add-column | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/numeric-add-column.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/numeric-add-column.js,samples/README.md) |
129
130
  | Numeric-query-parameter | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/numeric-query-parameter.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/numeric-query-parameter.js,samples/README.md) |
130
131
  | Numeric-update-data | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/numeric-update-data.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/numeric-update-data.js,samples/README.md) |
132
+ | Showcase the rules for case-sensitivity and case folding for a Spanner PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-case-sensitivity.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-case-sensitivity.js,samples/README.md) |
133
+ | Creates a PostgreSQL Database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-database-create.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-database-create.js,samples/README.md) |
134
+ | Use cast operator to cast from one data type to another in a Spanner PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-datatypes-casting.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-datatypes-casting.js,samples/README.md) |
135
+ | Execute a batch of DML statements on a Spanner PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-dml-batch.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-dml-batch.js,samples/README.md) |
136
+ | Execute a Partitioned DML on a Spanner PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-dml-partitioned.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-dml-partitioned.js,samples/README.md) |
137
+ | Execute a DML statement with parameters on a Spanner PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-dml-with-parameter.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-dml-with-parameter.js,samples/README.md) |
138
+ | Calls a server side function on a Spanner PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-functions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-functions.js,samples/README.md) |
139
+ | Created interleaved table hierarchy using PostgreSQL dialect. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-interleaving.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-interleaving.js,samples/README.md) |
140
+ | Showcase how to work with the PostgreSQL NUMERIC/DECIMAL data type on a Spanner PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-numeric-data-type.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-numeric-data-type.js,samples/README.md) |
141
+ | Showcases how a Spanner PostgreSQL database orders null values in a query. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-ordering-nulls.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-ordering-nulls.js,samples/README.md) |
142
+ | Execute a query with parameters on a Spanner PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-query-parameter.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-query-parameter.js,samples/README.md) |
143
+ | Query the information schema metadata in a Spanner PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-schema-information.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-schema-information.js,samples/README.md) |
131
144
  | Queryoptions | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/queryoptions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/queryoptions.js,samples/README.md) |
132
145
  | Quickstart | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
133
146
  | Sets a request tag for a single query | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/request-tag.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/request-tag.js,samples/README.md) |
@@ -1,4 +1,4 @@
1
- // Copyright 2021 Google LLC
1
+ // Copyright 2022 Google LLC
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@ syntax = "proto3";
16
16
 
17
17
  package google.spanner.admin.database.v1;
18
18
 
19
- import "google/api/annotations.proto";
20
19
  import "google/api/field_behavior.proto";
21
20
  import "google/api/resource.proto";
22
21
  import "google/longrunning/operations.proto";
@@ -120,6 +119,27 @@ message Backup {
120
119
 
121
120
  // Output only. The database dialect information for the backup.
122
121
  DatabaseDialect database_dialect = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
122
+
123
+ // Output only. The names of the destination backups being created by copying
124
+ // this source backup. The backup names are of the form
125
+ // `projects/<project>/instances/<instance>/backups/<backup>`.
126
+ // Referencing backups may exist in different instances. The existence of
127
+ // any referencing backup prevents the backup from being deleted. When the
128
+ // copy operation is done (either successfully completed or cancelled or the
129
+ // destination backup is deleted), the reference to the backup is removed.
130
+ repeated string referencing_backups = 11 [
131
+ (google.api.field_behavior) = OUTPUT_ONLY,
132
+ (google.api.resource_reference) = {
133
+ type: "spanner.googleapis.com/Backup"
134
+ }
135
+ ];
136
+
137
+ // Output only. The max allowed expiration time of the backup, with
138
+ // microseconds granularity. A backup's expiration time can be configured in
139
+ // multiple APIs: CreateBackup, UpdateBackup, CopyBackup. When updating or
140
+ // copying an existing backup, the expiration time specified must be
141
+ // less than `Backup.max_expire_time`.
142
+ google.protobuf.Timestamp max_expire_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
123
143
  }
124
144
 
125
145
  // The request for [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
@@ -185,6 +205,86 @@ message CreateBackupMetadata {
185
205
  google.protobuf.Timestamp cancel_time = 4;
186
206
  }
187
207
 
208
+ // The request for [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup].
209
+ message CopyBackupRequest {
210
+ // Required. The name of the destination instance that will contain the backup copy.
211
+ // Values are of the form: `projects/<project>/instances/<instance>`.
212
+ string parent = 1 [
213
+ (google.api.field_behavior) = REQUIRED,
214
+ (google.api.resource_reference) = {
215
+ type: "spanner.googleapis.com/Instance"
216
+ }
217
+ ];
218
+
219
+ // Required. The id of the backup copy.
220
+ // The `backup_id` appended to `parent` forms the full backup_uri of the form
221
+ // `projects/<project>/instances/<instance>/backups/<backup>`.
222
+ string backup_id = 2 [(google.api.field_behavior) = REQUIRED];
223
+
224
+ // Required. The source backup to be copied.
225
+ // The source backup needs to be in READY state for it to be copied.
226
+ // Once CopyBackup is in progress, the source backup cannot be deleted or
227
+ // cleaned up on expiration until CopyBackup is finished.
228
+ // Values are of the form:
229
+ // `projects/<project>/instances/<instance>/backups/<backup>`.
230
+ string source_backup = 3 [
231
+ (google.api.field_behavior) = REQUIRED,
232
+ (google.api.resource_reference) = {
233
+ type: "spanner.googleapis.com/Backup"
234
+ }
235
+ ];
236
+
237
+ // Required. The expiration time of the backup in microsecond granularity.
238
+ // The expiration time must be at least 6 hours and at most 366 days
239
+ // from the `create_time` of the source backup. Once the `expire_time` has
240
+ // passed, the backup is eligible to be automatically deleted by Cloud Spanner
241
+ // to free the resources used by the backup.
242
+ google.protobuf.Timestamp expire_time = 4 [(google.api.field_behavior) = REQUIRED];
243
+
244
+ // Optional. The encryption configuration used to encrypt the backup. If this field is
245
+ // not specified, the backup will use the same
246
+ // encryption configuration as the source backup by default, namely
247
+ // [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] =
248
+ // `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
249
+ CopyBackupEncryptionConfig encryption_config = 5 [(google.api.field_behavior) = OPTIONAL];
250
+ }
251
+
252
+ // Metadata type for the google.longrunning.Operation returned by
253
+ // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup].
254
+ message CopyBackupMetadata {
255
+ // The name of the backup being created through the copy operation.
256
+ // Values are of the form
257
+ // `projects/<project>/instances/<instance>/backups/<backup>`.
258
+ string name = 1 [(google.api.resource_reference) = {
259
+ type: "spanner.googleapis.com/Backup"
260
+ }];
261
+
262
+ // The name of the source backup that is being copied.
263
+ // Values are of the form
264
+ // `projects/<project>/instances/<instance>/backups/<backup>`.
265
+ string source_backup = 2 [(google.api.resource_reference) = {
266
+ type: "spanner.googleapis.com/Backup"
267
+ }];
268
+
269
+ // The progress of the
270
+ // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] operation.
271
+ OperationProgress progress = 3;
272
+
273
+ // The time at which cancellation of CopyBackup operation was received.
274
+ // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
275
+ // starts asynchronous cancellation on a long-running operation. The server
276
+ // makes a best effort to cancel the operation, but success is not guaranteed.
277
+ // Clients can use
278
+ // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
279
+ // other methods to check whether the cancellation succeeded or whether the
280
+ // operation completed despite cancellation. On successful cancellation,
281
+ // the operation is not deleted; instead, it becomes an operation with
282
+ // an [Operation.error][google.longrunning.Operation.error] value with a
283
+ // [google.rpc.Status.code][google.rpc.Status.code] of 1,
284
+ // corresponding to `Code.CANCELLED`.
285
+ google.protobuf.Timestamp cancel_time = 4;
286
+ }
287
+
188
288
  // The request for [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup].
189
289
  message UpdateBackupRequest {
190
290
  // Required. The backup to update. `backup.name`, and the fields to be updated
@@ -327,6 +427,8 @@ message ListBackupOperationsRequest {
327
427
  // for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is
328
428
  // `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
329
429
  // * `metadata.<field_name>` - any field in metadata.value.
430
+ // `metadata.@type` must be specified first if filtering on metadata
431
+ // fields.
330
432
  // * `error` - Error associated with the long-running operation.
331
433
  // * `response.@type` - the type of response.
332
434
  // * `response.<field_name>` - any field in response.value.
@@ -338,8 +440,11 @@ message ListBackupOperationsRequest {
338
440
  // Here are a few examples:
339
441
  //
340
442
  // * `done:true` - The operation is complete.
341
- // * `metadata.database:prod` - The database the backup was taken from has
342
- // a name containing the string "prod".
443
+ // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
444
+ // `metadata.database:prod` - Returns operations where:
445
+ // * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
446
+ // * The database the backup was taken from has a name containing the
447
+ // string "prod".
343
448
  // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
344
449
  // `(metadata.name:howl) AND` \
345
450
  // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
@@ -348,6 +453,29 @@ message ListBackupOperationsRequest {
348
453
  // * The backup name contains the string "howl".
349
454
  // * The operation started before 2018-03-28T14:50:00Z.
350
455
  // * The operation resulted in an error.
456
+ // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \
457
+ // `(metadata.source_backup:test) AND` \
458
+ // `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \
459
+ // `(error:*)` - Returns operations where:
460
+ // * The operation's metadata type is [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
461
+ // * The source backup of the copied backup name contains the string
462
+ // "test".
463
+ // * The operation started before 2022-01-18T14:50:00Z.
464
+ // * The operation resulted in an error.
465
+ // * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
466
+ // `(metadata.database:test_db)) OR` \
467
+ // `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata)
468
+ // AND` \
469
+ // `(metadata.source_backup:test_bkp)) AND` \
470
+ // `(error:*)` - Returns operations where:
471
+ // * The operation's metadata matches either of criteria:
472
+ // * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] AND the
473
+ // database the backup was taken from has name containing string
474
+ // "test_db"
475
+ // * The operation's metadata type is [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] AND the
476
+ // backup the backup was copied from has name containing string
477
+ // "test_bkp"
478
+ // * The operation resulted in an error.
351
479
  string filter = 2;
352
480
 
353
481
  // Number of operations to be returned in the response. If 0 or
@@ -366,11 +494,11 @@ message ListBackupOperationsRequest {
366
494
  message ListBackupOperationsResponse {
367
495
  // The list of matching backup [long-running
368
496
  // operations][google.longrunning.Operation]. Each operation's name will be
369
- // prefixed by the backup's name and the operation's
370
- // [metadata][google.longrunning.Operation.metadata] will be of type
371
- // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
372
- // pending or have completed/failed/canceled within the last 7 days.
373
- // Operations returned are ordered by
497
+ // prefixed by the backup's name. The operation's
498
+ // [metadata][google.longrunning.Operation.metadata] field type
499
+ // `metadata.type_url` describes the type of the metadata. Operations returned
500
+ // include those that are pending or have completed/failed/canceled within the
501
+ // last 7 days. Operations returned are ordered by
374
502
  // `operation.metadata.value.progress.start_time` in descending order starting
375
503
  // from the most recently started operation.
376
504
  repeated google.longrunning.Operation operations = 1;
@@ -442,3 +570,40 @@ message CreateBackupEncryptionConfig {
442
570
  }
443
571
  ];
444
572
  }
573
+
574
+ // Encryption configuration for the copied backup.
575
+ message CopyBackupEncryptionConfig {
576
+ // Encryption types for the backup.
577
+ enum EncryptionType {
578
+ // Unspecified. Do not use.
579
+ ENCRYPTION_TYPE_UNSPECIFIED = 0;
580
+
581
+ // This is the default option for [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]
582
+ // when [encryption_config][google.spanner.admin.database.v1.CopyBackupEncryptionConfig] is not specified.
583
+ // For example, if the source backup is using `Customer_Managed_Encryption`,
584
+ // the backup will be using the same Cloud KMS key as the source backup.
585
+ USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1;
586
+
587
+ // Use Google default encryption.
588
+ GOOGLE_DEFAULT_ENCRYPTION = 2;
589
+
590
+ // Use customer managed encryption. If specified, `kms_key_name`
591
+ // must contain a valid Cloud KMS key.
592
+ CUSTOMER_MANAGED_ENCRYPTION = 3;
593
+ }
594
+
595
+ // Required. The encryption type of the backup.
596
+ EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED];
597
+
598
+ // Optional. The Cloud KMS key that will be used to protect the backup.
599
+ // This field should be set only when
600
+ // [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] is
601
+ // `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
602
+ // `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
603
+ string kms_key_name = 2 [
604
+ (google.api.field_behavior) = OPTIONAL,
605
+ (google.api.resource_reference) = {
606
+ type: "cloudkms.googleapis.com/CryptoKey"
607
+ }
608
+ ];
609
+ }
@@ -1,4 +1,4 @@
1
- // Copyright 2021 Google LLC
1
+ // Copyright 2022 Google LLC
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@ syntax = "proto3";
16
16
 
17
17
  package google.spanner.admin.database.v1;
18
18
 
19
- import "google/api/annotations.proto";
20
19
  import "google/api/field_behavior.proto";
21
20
  import "google/api/resource.proto";
22
21
  import "google/protobuf/timestamp.proto";
@@ -1,4 +1,4 @@
1
- // Copyright 2021 Google LLC
1
+ // Copyright 2022 Google LLC
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -24,7 +24,6 @@ import "google/iam/v1/iam_policy.proto";
24
24
  import "google/iam/v1/policy.proto";
25
25
  import "google/longrunning/operations.proto";
26
26
  import "google/protobuf/empty.proto";
27
- import "google/protobuf/field_mask.proto";
28
27
  import "google/protobuf/timestamp.proto";
29
28
  import "google/spanner/admin/database/v1/backup.proto";
30
29
  import "google/spanner/admin/database/v1/common.proto";
@@ -216,6 +215,30 @@ service DatabaseAdmin {
216
215
  };
217
216
  }
218
217
 
218
+ // Starts copying a Cloud Spanner Backup.
219
+ // The returned backup [long-running operation][google.longrunning.Operation]
220
+ // will have a name of the format
221
+ // `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
222
+ // and can be used to track copying of the backup. The operation is associated
223
+ // with the destination backup.
224
+ // The [metadata][google.longrunning.Operation.metadata] field type is
225
+ // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
226
+ // The [response][google.longrunning.Operation.response] field type is
227
+ // [Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
228
+ // copying and delete the backup.
229
+ // Concurrent CopyBackup requests can run on the same source backup.
230
+ rpc CopyBackup(CopyBackupRequest) returns (google.longrunning.Operation) {
231
+ option (google.api.http) = {
232
+ post: "/v1/{parent=projects/*/instances/*}/backups:copy"
233
+ body: "*"
234
+ };
235
+ option (google.api.method_signature) = "parent,backup_id,source_backup,expire_time";
236
+ option (google.longrunning.operation_info) = {
237
+ response_type: "google.spanner.admin.database.v1.Backup"
238
+ metadata_type: "google.spanner.admin.database.v1.CopyBackupMetadata"
239
+ };
240
+ }
241
+
219
242
  // Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
220
243
  rpc GetBackup(GetBackupRequest) returns (Backup) {
221
244
  option (google.api.http) = {
@@ -645,6 +668,8 @@ message ListDatabaseOperationsRequest {
645
668
  // for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] is
646
669
  // `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
647
670
  // * `metadata.<field_name>` - any field in metadata.value.
671
+ // `metadata.@type` must be specified first, if filtering on metadata
672
+ // fields.
648
673
  // * `error` - Error associated with the long-running operation.
649
674
  // * `response.@type` - the type of response.
650
675
  // * `response.<field_name>` - any field in response.value.
@@ -16,8 +16,6 @@ syntax = "proto3";
16
16
 
17
17
  package google.spanner.v1;
18
18
 
19
- import "google/api/annotations.proto";
20
- import "google/protobuf/duration.proto";
21
19
  import "google/protobuf/timestamp.proto";
22
20
 
23
21
  option csharp_namespace = "Google.Cloud.Spanner.V1";
@@ -16,7 +16,6 @@ syntax = "proto3";
16
16
 
17
17
  package google.spanner.v1;
18
18
 
19
- import "google/api/annotations.proto";
20
19
  import "google/protobuf/struct.proto";
21
20
 
22
21
  option csharp_namespace = "Google.Cloud.Spanner.V1";
@@ -16,7 +16,6 @@ syntax = "proto3";
16
16
 
17
17
  package google.spanner.v1;
18
18
 
19
- import "google/api/annotations.proto";
20
19
  import "google/api/field_behavior.proto";
21
20
  import "google/protobuf/struct.proto";
22
21
  import "google/spanner/v1/keys.proto";
@@ -16,7 +16,6 @@ syntax = "proto3";
16
16
 
17
17
  package google.spanner.v1;
18
18
 
19
- import "google/api/annotations.proto";
20
19
  import "google/protobuf/struct.proto";
21
20
 
22
21
  option csharp_namespace = "Google.Cloud.Spanner.V1";
@@ -16,7 +16,6 @@ syntax = "proto3";
16
16
 
17
17
  package google.spanner.v1;
18
18
 
19
- import "google/api/annotations.proto";
20
19
  import "google/protobuf/struct.proto";
21
20
  import "google/spanner/v1/commit_response.proto";
22
21
  import "google/spanner/v1/query_plan.proto";
@@ -16,7 +16,6 @@ syntax = "proto3";
16
16
 
17
17
  package google.spanner.v1;
18
18
 
19
- import "google/api/annotations.proto";
20
19
  import "google/protobuf/duration.proto";
21
20
  import "google/protobuf/timestamp.proto";
22
21
 
@@ -16,7 +16,6 @@ syntax = "proto3";
16
16
 
17
17
  package google.spanner.v1;
18
18
 
19
- import "google/api/annotations.proto";
20
19
  import "google/api/field_behavior.proto";
21
20
 
22
21
  option csharp_namespace = "Google.Cloud.Spanner.V1";