@google-cloud/spanner 5.17.0 → 6.1.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +16 -0
  3. package/build/protos/google/spanner/admin/database/v1/backup.proto +174 -9
  4. package/build/protos/google/spanner/admin/database/v1/common.proto +1 -2
  5. package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +27 -2
  6. package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +22 -10
  7. package/build/protos/google/spanner/v1/commit_response.proto +1 -3
  8. package/build/protos/google/spanner/v1/keys.proto +1 -2
  9. package/build/protos/google/spanner/v1/mutation.proto +1 -2
  10. package/build/protos/google/spanner/v1/query_plan.proto +1 -2
  11. package/build/protos/google/spanner/v1/result_set.proto +1 -3
  12. package/build/protos/google/spanner/v1/spanner.proto +4 -1
  13. package/build/protos/google/spanner/v1/transaction.proto +73 -22
  14. package/build/protos/google/spanner/v1/type.proto +1 -2
  15. package/build/protos/protos.d.ts +883 -282
  16. package/build/protos/protos.js +2447 -880
  17. package/build/protos/protos.json +297 -87
  18. package/build/src/backup.d.ts +27 -5
  19. package/build/src/backup.js +62 -31
  20. package/build/src/batch-transaction.js +1 -1
  21. package/build/src/codec.d.ts +12 -1
  22. package/build/src/codec.js +44 -13
  23. package/build/src/common-grpc/service-object.js +1 -1
  24. package/build/src/common-grpc/service.js +2 -2
  25. package/build/src/database.d.ts +26 -6
  26. package/build/src/database.js +8 -8
  27. package/build/src/index.d.ts +18 -3
  28. package/build/src/index.js +26 -7
  29. package/build/src/instance.d.ts +41 -1
  30. package/build/src/instance.js +56 -2
  31. package/build/src/session-pool.d.ts +1 -0
  32. package/build/src/session-pool.js +46 -46
  33. package/build/src/session.js +1 -1
  34. package/build/src/table.d.ts +5 -1
  35. package/build/src/table.js +1 -1
  36. package/build/src/transaction-runner.js +3 -3
  37. package/build/src/transaction.d.ts +10 -2
  38. package/build/src/transaction.js +12 -12
  39. package/build/src/v1/database_admin_client.d.ts +267 -30
  40. package/build/src/v1/database_admin_client.js +148 -13
  41. package/build/src/v1/database_admin_client_config.json +5 -0
  42. package/build/src/v1/index.js +1 -0
  43. package/build/src/v1/instance_admin_client.d.ts +63 -18
  44. package/build/src/v1/instance_admin_client.js +42 -9
  45. package/build/src/v1/spanner_client.d.ts +70 -19
  46. package/build/src/v1/spanner_client.js +7 -8
  47. package/package.json +12 -12
package/CHANGELOG.md CHANGED
@@ -4,6 +4,59 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/nodejs-spanner?activeTab=versions
6
6
 
7
+ ## [6.1.0](https://github.com/googleapis/nodejs-spanner/compare/v6.0.0...v6.1.0) (2022-07-04)
8
+
9
+
10
+ ### Features
11
+
12
+ * add Session creator role ([91ef6d3](https://github.com/googleapis/nodejs-spanner/commit/91ef6d373a1ed2c7e191de4003571270bfc4e895))
13
+ * Adding two new fields for Instance create_time and update_time ([#1641](https://github.com/googleapis/nodejs-spanner/issues/1641)) ([91ef6d3](https://github.com/googleapis/nodejs-spanner/commit/91ef6d373a1ed2c7e191de4003571270bfc4e895))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * **deps:** update dependency @google-cloud/promisify to v3 ([#1629](https://github.com/googleapis/nodejs-spanner/issues/1629)) ([1467956](https://github.com/googleapis/nodejs-spanner/commit/1467956314c77f66034fa3db166ba68d7c2aba2d))
19
+ * Improve spanner.date handling of years before 1000AD ([#1654](https://github.com/googleapis/nodejs-spanner/issues/1654)) ([fd89a29](https://github.com/googleapis/nodejs-spanner/commit/fd89a294dcab017dbbe7000bce613b0d4ed60f96))
20
+
21
+ ## [6.0.0](https://github.com/googleapis/nodejs-spanner/compare/v5.18.0...v6.0.0) (2022-06-07)
22
+
23
+
24
+ ### ⚠ BREAKING CHANGES
25
+
26
+ * update library to use Node 12 (#1637)
27
+
28
+ ### Features
29
+
30
+ * Adding IT for date and commit timestamp ([#1621](https://github.com/googleapis/nodejs-spanner/issues/1621)) ([1367aa7](https://github.com/googleapis/nodejs-spanner/commit/1367aa7dc9818be5610dfc5ae67d09652e7009e5))
31
+ * AuditConfig for IAM v1 ([#1599](https://github.com/googleapis/nodejs-spanner/issues/1599)) ([c358d66](https://github.com/googleapis/nodejs-spanner/commit/c358d668ca2a25f99ab73a4b6c1ebbe09c34d4de))
32
+
33
+
34
+ ### Bug Fixes
35
+
36
+ * **deps:** update dependency grpc-gcp to ^0.4.0 ([#1603](https://github.com/googleapis/nodejs-spanner/issues/1603)) ([f00b3c6](https://github.com/googleapis/nodejs-spanner/commit/f00b3c65e58c2f36e69a05fef0b3c9bc68a4ee55))
37
+ * fixes for dynamic routing and streaming descriptors ([#1639](https://github.com/googleapis/nodejs-spanner/issues/1639)) ([977a543](https://github.com/googleapis/nodejs-spanner/commit/977a543d693ca2f2e8bb303be6df592aa4def1dd))
38
+ * pin version for nodejs gax-node ([#1617](https://github.com/googleapis/nodejs-spanner/issues/1617)) ([fb0017f](https://github.com/googleapis/nodejs-spanner/commit/fb0017ffab3cfa41cd132df4511a47fb68439bf5))
39
+
40
+
41
+ ### Build System
42
+
43
+ * update library to use Node 12 ([#1637](https://github.com/googleapis/nodejs-spanner/issues/1637)) ([994acf3](https://github.com/googleapis/nodejs-spanner/commit/994acf3edd7c261085f58722fa2f86f95b3a56f3))
44
+
45
+ ## [5.18.0](https://github.com/googleapis/nodejs-spanner/compare/v5.17.0...v5.18.0) (2022-04-03)
46
+
47
+
48
+ ### Features
49
+
50
+ * 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))
51
+ * integration testing for postgres dialect ([#1593](https://github.com/googleapis/nodejs-spanner/issues/1593)) ([ebe06a6](https://github.com/googleapis/nodejs-spanner/commit/ebe06a6cefbeacc37c40f2474b9d265b78c846e2))
52
+ * Postgres Numeric and database support ([#1592](https://github.com/googleapis/nodejs-spanner/issues/1592)) ([7ca3975](https://github.com/googleapis/nodejs-spanner/commit/7ca3975c5e25e78983f77df9e921642c90874f90))
53
+ * Spanner copy backup ([#1530](https://github.com/googleapis/nodejs-spanner/issues/1530)) ([cefb1b4](https://github.com/googleapis/nodejs-spanner/commit/cefb1b4c831997e5c52122c5e6c3fd9cd9cb2c76))
54
+
55
+
56
+ ### Bug Fixes
57
+
58
+ * removing table_catalog from schema information ([#1595](https://github.com/googleapis/nodejs-spanner/issues/1595)) ([8bcbd95](https://github.com/googleapis/nodejs-spanner/commit/8bcbd95e7423f03aa16ffd500fca998f75c8d0cf))
59
+
7
60
  ## [5.17.0](https://github.com/googleapis/nodejs-spanner/compare/v5.16.3...v5.17.0) (2022-03-09)
8
61
 
9
62
 
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,21 @@ 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
+ | Adds a column to an existing table in a Spanner PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-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/pg-add-column.js,samples/README.md) |
133
+ | 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) |
134
+ | 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) |
135
+ | 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) |
136
+ | 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) |
137
+ | Updates data in a table in a Spanner PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-dml-getting-started-update.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-getting-started-update.js,samples/README.md) |
138
+ | 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) |
139
+ | 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) |
140
+ | 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) |
141
+ | Creates a new storing index in a Spanner PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-index-create-storing.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-index-create-storing.js,samples/README.md) |
142
+ | 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) |
143
+ | 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) |
144
+ | 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) |
145
+ | 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) |
146
+ | 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
147
  | 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
148
  | 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
149
  | 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.
@@ -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.
@@ -179,7 +179,7 @@ service InstanceAdmin {
179
179
  // [Instance][google.spanner.admin.instance.v1.Instance], if successful.
180
180
  //
181
181
  // Authorization requires `spanner.instances.update` permission on
182
- // resource [name][google.spanner.admin.instance.v1.Instance.name].
182
+ // the resource [name][google.spanner.admin.instance.v1.Instance.name].
183
183
  rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) {
184
184
  option (google.api.http) = {
185
185
  patch: "/v1/{instance.name=projects/*/instances/*}"
@@ -309,7 +309,7 @@ message InstanceConfig {
309
309
 
310
310
  // A unique identifier for the instance configuration. Values
311
311
  // are of the form
312
- // `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`
312
+ // `projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`.
313
313
  string name = 1;
314
314
 
315
315
  // The name of this instance configuration as it appears in UIs.
@@ -319,7 +319,7 @@ message InstanceConfig {
319
319
  // replication properties.
320
320
  repeated ReplicaInfo replicas = 3;
321
321
 
322
- // Allowed values of the “default_leader” schema option for databases in
322
+ // Allowed values of the "default_leader" schema option for databases in
323
323
  // instances that use this instance configuration.
324
324
  repeated string leader_options = 4;
325
325
  }
@@ -367,17 +367,23 @@ message Instance {
367
367
  // Must be unique per project and between 4 and 30 characters in length.
368
368
  string display_name = 3 [(google.api.field_behavior) = REQUIRED];
369
369
 
370
- // Required. The number of nodes allocated to this instance. This may be zero
371
- // in API responses for instances that are not yet in state `READY`.
370
+ // The number of nodes allocated to this instance. At most one of either
371
+ // node_count or processing_units should be present in the message. This
372
+ // may be zero in API responses for instances that are not yet in state
373
+ // `READY`.
372
374
  //
373
375
  // See [the
374
- // documentation](https://cloud.google.com/spanner/docs/instances#node_count)
375
- // for more information about nodes.
376
+ // documentation](https://cloud.google.com/spanner/docs/compute-capacity)
377
+ // for more information about nodes and processing units.
376
378
  int32 node_count = 5;
377
379
 
378
380
  // The number of processing units allocated to this instance. At most one of
379
381
  // processing_units or node_count should be present in the message. This may
380
382
  // be zero in API responses for instances that are not yet in state `READY`.
383
+ //
384
+ // See [the
385
+ // documentation](https://cloud.google.com/spanner/docs/compute-capacity)
386
+ // for more information about nodes and processing units.
381
387
  int32 processing_units = 9;
382
388
 
383
389
  // Output only. The current instance state. For
@@ -395,9 +401,9 @@ message Instance {
395
401
  // firewall, load balancing, etc.).
396
402
  //
397
403
  // * Label keys must be between 1 and 63 characters long and must conform to
398
- // the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.
404
+ // the following regular expression: `[a-z][a-z0-9_-]{0,62}`.
399
405
  // * Label values must be between 0 and 63 characters long and must conform
400
- // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
406
+ // to the regular expression `[a-z0-9_-]{0,63}`.
401
407
  // * No more than 64 labels can be associated with a given resource.
402
408
  //
403
409
  // See https://goo.gl/xmQnxf for more information on and examples of labels.
@@ -412,6 +418,12 @@ message Instance {
412
418
 
413
419
  // Deprecated. This field is not populated.
414
420
  repeated string endpoint_uris = 8;
421
+
422
+ // Output only. The time at which the instance was created.
423
+ google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
424
+
425
+ // Output only. The time at which the instance was most recently updated.
426
+ google.protobuf.Timestamp update_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
415
427
  }
416
428
 
417
429
  // The request for [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs].
@@ -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,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";
@@ -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.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";
@@ -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.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";
@@ -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.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";
@@ -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,9 +16,7 @@ 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
- import "google/spanner/v1/commit_response.proto";
22
20
  import "google/spanner/v1/query_plan.proto";
23
21
  import "google/spanner/v1/transaction.proto";
24
22
  import "google/spanner/v1/type.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.
@@ -358,6 +358,9 @@ message Session {
358
358
  // Output only. The approximate timestamp when the session is last used. It is
359
359
  // typically earlier than the actual last use time.
360
360
  google.protobuf.Timestamp approximate_last_use_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
361
+
362
+ // The database role which created this session.
363
+ string creator_role = 5;
361
364
  }
362
365
 
363
366
  // The request for [GetSession][google.spanner.v1.Spanner.GetSession].