@google-cloud/spanner 7.7.0 → 7.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +5 -0
  3. package/build/protos/google/spanner/admin/database/v1/backup.proto +190 -109
  4. package/build/protos/google/spanner/admin/database/v1/common.proto +30 -10
  5. package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +166 -100
  6. package/build/protos/google/spanner/admin/instance/v1/common.proto +1 -1
  7. package/build/protos/google/spanner/executor/v1/cloud_executor.proto +1 -1
  8. package/build/protos/google/spanner/v1/commit_response.proto +1 -1
  9. package/build/protos/google/spanner/v1/keys.proto +1 -1
  10. package/build/protos/google/spanner/v1/mutation.proto +1 -1
  11. package/build/protos/google/spanner/v1/query_plan.proto +1 -1
  12. package/build/protos/google/spanner/v1/result_set.proto +1 -1
  13. package/build/protos/google/spanner/v1/spanner.proto +1 -1
  14. package/build/protos/google/spanner/v1/transaction.proto +1 -1
  15. package/build/protos/google/spanner/v1/type.proto +1 -1
  16. package/build/protos/protos.d.ts +30 -0
  17. package/build/protos/protos.js +204 -0
  18. package/build/protos/protos.json +43 -0
  19. package/build/src/codec.d.ts +55 -1
  20. package/build/src/codec.js +109 -4
  21. package/build/src/common-grpc/service.d.ts +0 -1
  22. package/build/src/common.js +2 -2
  23. package/build/src/database.d.ts +94 -7
  24. package/build/src/database.js +131 -0
  25. package/build/src/index.d.ts +59 -3
  26. package/build/src/index.js +55 -1
  27. package/build/src/instance.d.ts +0 -2
  28. package/build/src/partial-result-stream.d.ts +41 -1
  29. package/build/src/partial-result-stream.js +8 -3
  30. package/build/src/session-pool.d.ts +0 -2
  31. package/build/src/session-pool.js +7 -7
  32. package/build/src/table.d.ts +1 -0
  33. package/build/src/table.js +36 -2
  34. package/build/src/transaction-runner.d.ts +1 -0
  35. package/build/src/transaction-runner.js +5 -2
  36. package/build/src/transaction.d.ts +100 -2
  37. package/build/src/transaction.js +135 -30
  38. package/build/src/v1/database_admin_client.d.ts +175 -127
  39. package/build/src/v1/database_admin_client.js +85 -57
  40. package/build/src/v1/instance_admin_client.d.ts +0 -1
  41. package/build/src/v1/spanner_client.d.ts +0 -1
  42. package/build/src/v1/spanner_client_config.json +15 -14
  43. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -4,6 +4,37 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/nodejs-spanner?activeTab=versions
6
6
 
7
+ ## [7.9.0](https://github.com/googleapis/nodejs-spanner/compare/v7.8.0...v7.9.0) (2024-06-21)
8
+
9
+
10
+ ### Features
11
+
12
+ * **spanner:** Add support for batchWrite ([#2054](https://github.com/googleapis/nodejs-spanner/issues/2054)) ([06aab6e](https://github.com/googleapis/nodejs-spanner/commit/06aab6e39bbce9e3786f1ac631c80e8909197e92))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **deps:** Update dependency google-gax to v4.3.4 ([#2051](https://github.com/googleapis/nodejs-spanner/issues/2051)) ([80abf06](https://github.com/googleapis/nodejs-spanner/commit/80abf06ba8ef9497318ffc597b83fb63e4408f9c))
18
+ * **deps:** Update dependency google-gax to v4.3.5 ([#2055](https://github.com/googleapis/nodejs-spanner/issues/2055)) ([702c9b0](https://github.com/googleapis/nodejs-spanner/commit/702c9b0f34e6cc34233c5aa52b97601b19f70980))
19
+ * **deps:** Update dependency google-gax to v4.3.6 ([#2057](https://github.com/googleapis/nodejs-spanner/issues/2057)) ([74ebf1e](https://github.com/googleapis/nodejs-spanner/commit/74ebf1e45cddf614c180295f3a761a8f84c5cb32))
20
+ * **deps:** Update dependency google-gax to v4.3.7 ([#2068](https://github.com/googleapis/nodejs-spanner/issues/2068)) ([28fec6c](https://github.com/googleapis/nodejs-spanner/commit/28fec6ca505d78d725efc123950be978e0c84ab7))
21
+
22
+ ## [7.8.0](https://github.com/googleapis/nodejs-spanner/compare/v7.7.0...v7.8.0) (2024-05-24)
23
+
24
+
25
+ ### Features
26
+
27
+ * Add `RESOURCE_EXHAUSTED` to the list of retryable error codes ([#2032](https://github.com/googleapis/nodejs-spanner/issues/2032)) ([a4623c5](https://github.com/googleapis/nodejs-spanner/commit/a4623c560c16fa1f37a06cb57a5e47a1d6759d27))
28
+ * Add support for multi region encryption config ([81fa610](https://github.com/googleapis/nodejs-spanner/commit/81fa610895fe709cbb7429896493a67407a6343c))
29
+ * Add support for Proto columns ([#1991](https://github.com/googleapis/nodejs-spanner/issues/1991)) ([ae59c7f](https://github.com/googleapis/nodejs-spanner/commit/ae59c7f957660e08cd5965b5e67694fa1ccc0057))
30
+ * **spanner:** Add support for change streams transaction exclusion option ([#2049](https://github.com/googleapis/nodejs-spanner/issues/2049)) ([d95cab5](https://github.com/googleapis/nodejs-spanner/commit/d95cab5abe50cdb56cbc1d6d935aee29526e1096))
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * **deps:** Update dependency google-gax to v4.3.3 ([#2038](https://github.com/googleapis/nodejs-spanner/issues/2038)) ([d86c1b0](https://github.com/googleapis/nodejs-spanner/commit/d86c1b0c21c7c95e3110221b3ca6ff9ff3b4a088))
36
+ * Drop table statement ([#2036](https://github.com/googleapis/nodejs-spanner/issues/2036)) ([f31d7b2](https://github.com/googleapis/nodejs-spanner/commit/f31d7b205d74d4a783f0d5159dd5b62efe968fe6))
37
+
7
38
  ## [7.7.0](https://github.com/googleapis/nodejs-spanner/compare/v7.6.0...v7.7.0) (2024-04-17)
8
39
 
9
40
 
package/README.md CHANGED
@@ -102,6 +102,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
102
102
  | Backups-restore | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups-restore.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-restore.js,samples/README.md) |
103
103
  | Backups-update | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups-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/backups-update.js,samples/README.md) |
104
104
  | Backups | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/backups.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.js,samples/README.md) |
105
+ | Batch Write | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/batch-write.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/batch-write.js,samples/README.md) |
105
106
  | Batch | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/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/batch.js,samples/README.md) |
106
107
  | CRUD | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/crud.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/crud.js,samples/README.md) |
107
108
  | Creates a new database with a specific default leader | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/database-create-with-default-leader.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/database-create-with-default-leader.js,samples/README.md) |
@@ -167,6 +168,10 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
167
168
  | Alters a sequence in a PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-sequence-alter.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-sequence-alter.js,samples/README.md) |
168
169
  | Creates sequence in PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-sequence-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-sequence-create.js,samples/README.md) |
169
170
  | Drops a sequence in PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-sequence-drop.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-sequence-drop.js,samples/README.md) |
171
+ | Proto-query-data | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/proto-query-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/proto-query-data.js,samples/README.md) |
172
+ | Creates a new database with a proto column and enum | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/proto-type-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/proto-type-add-column.js,samples/README.md) |
173
+ | Proto-update-data-dml | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/proto-update-data-dml.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/proto-update-data-dml.js,samples/README.md) |
174
+ | Proto-update-data | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/proto-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/proto-update-data.js,samples/README.md) |
170
175
  | 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) |
171
176
  | 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) |
172
177
  | Read data with database role | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/read-data-with-database-role.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/read-data-with-database-role.js,samples/README.md) |
@@ -1,4 +1,4 @@
1
- // Copyright 2022 Google LLC
1
+ // Copyright 2024 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.
@@ -51,14 +51,14 @@ message Backup {
51
51
  READY = 2;
52
52
  }
53
53
 
54
- // Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
55
- // Name of the database from which this backup was
56
- // created. This needs to be in the same instance as the backup.
57
- // Values are of the form
54
+ // Required for the
55
+ // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
56
+ // operation. Name of the database from which this backup was created. This
57
+ // needs to be in the same instance as the backup. Values are of the form
58
58
  // `projects/<project>/instances/<instance>/databases/<database>`.
59
59
  string database = 2 [(google.api.resource_reference) = {
60
- type: "spanner.googleapis.com/Database"
61
- }];
60
+ type: "spanner.googleapis.com/Database"
61
+ }];
62
62
 
63
63
  // The backup will contain an externally consistent copy of the database at
64
64
  // the timestamp specified by `version_time`. If `version_time` is not
@@ -66,7 +66,8 @@ message Backup {
66
66
  // backup.
67
67
  google.protobuf.Timestamp version_time = 9;
68
68
 
69
- // Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
69
+ // Required for the
70
+ // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
70
71
  // operation. The expiration time of the backup, with microseconds
71
72
  // granularity that must be at least 6 hours and at most 366 days
72
73
  // from the time the CreateBackup request is processed. Once the `expire_time`
@@ -74,8 +75,11 @@ message Backup {
74
75
  // Spanner to free the resources used by the backup.
75
76
  google.protobuf.Timestamp expire_time = 3;
76
77
 
77
- // Output only for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
78
- // Required for the [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] operation.
78
+ // Output only for the
79
+ // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
80
+ // operation. Required for the
81
+ // [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup]
82
+ // operation.
79
83
  //
80
84
  // A globally unique identifier for the backup which cannot be
81
85
  // changed. Values are of the form
@@ -89,10 +93,12 @@ message Backup {
89
93
  // `projects/<project>/instances/<instance>`.
90
94
  string name = 1;
91
95
 
92
- // Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
96
+ // Output only. The time the
97
+ // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
93
98
  // request is received. If the request does not specify `version_time`, the
94
99
  // `version_time` of the backup will be equivalent to the `create_time`.
95
- google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
100
+ google.protobuf.Timestamp create_time = 4
101
+ [(google.api.field_behavior) = OUTPUT_ONLY];
96
102
 
97
103
  // Output only. Size of the backup in bytes.
98
104
  int64 size_bytes = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
@@ -115,10 +121,21 @@ message Backup {
115
121
  ];
116
122
 
117
123
  // Output only. The encryption information for the backup.
118
- EncryptionInfo encryption_info = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
124
+ EncryptionInfo encryption_info = 8
125
+ [(google.api.field_behavior) = OUTPUT_ONLY];
126
+
127
+ // Output only. The encryption information for the backup, whether it is
128
+ // protected by one or more KMS keys. The information includes all Cloud
129
+ // KMS key versions used to encrypt the backup. The `encryption_status' field
130
+ // inside of each `EncryptionInfo` is not populated. At least one of the key
131
+ // versions must be available for the backup to be restored. If a key version
132
+ // is revoked in the middle of a restore, the restore behavior is undefined.
133
+ repeated EncryptionInfo encryption_information = 13
134
+ [(google.api.field_behavior) = OUTPUT_ONLY];
119
135
 
120
136
  // Output only. The database dialect information for the backup.
121
- DatabaseDialect database_dialect = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
137
+ DatabaseDialect database_dialect = 10
138
+ [(google.api.field_behavior) = OUTPUT_ONLY];
122
139
 
123
140
  // Output only. The names of the destination backups being created by copying
124
141
  // this source backup. The backup names are of the form
@@ -129,9 +146,7 @@ message Backup {
129
146
  // destination backup is deleted), the reference to the backup is removed.
130
147
  repeated string referencing_backups = 11 [
131
148
  (google.api.field_behavior) = OUTPUT_ONLY,
132
- (google.api.resource_reference) = {
133
- type: "spanner.googleapis.com/Backup"
134
- }
149
+ (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
135
150
  ];
136
151
 
137
152
  // Output only. The max allowed expiration time of the backup, with
@@ -139,10 +154,12 @@ message Backup {
139
154
  // multiple APIs: CreateBackup, UpdateBackup, CopyBackup. When updating or
140
155
  // copying an existing backup, the expiration time specified must be
141
156
  // less than `Backup.max_expire_time`.
142
- google.protobuf.Timestamp max_expire_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
157
+ google.protobuf.Timestamp max_expire_time = 12
158
+ [(google.api.field_behavior) = OUTPUT_ONLY];
143
159
  }
144
160
 
145
- // The request for [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
161
+ // The request for
162
+ // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
146
163
  message CreateBackupRequest {
147
164
  // Required. The name of the instance in which the backup will be
148
165
  // created. This must be the same instance that contains the database the
@@ -165,29 +182,31 @@ message CreateBackupRequest {
165
182
  // Required. The backup to create.
166
183
  Backup backup = 3 [(google.api.field_behavior) = REQUIRED];
167
184
 
168
- // Optional. The encryption configuration used to encrypt the backup. If this field is
169
- // not specified, the backup will use the same
170
- // encryption configuration as the database by default, namely
171
- // [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] =
172
- // `USE_DATABASE_ENCRYPTION`.
173
- CreateBackupEncryptionConfig encryption_config = 4 [(google.api.field_behavior) = OPTIONAL];
185
+ // Optional. The encryption configuration used to encrypt the backup. If this
186
+ // field is not specified, the backup will use the same encryption
187
+ // configuration as the database by default, namely
188
+ // [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type]
189
+ // = `USE_DATABASE_ENCRYPTION`.
190
+ CreateBackupEncryptionConfig encryption_config = 4
191
+ [(google.api.field_behavior) = OPTIONAL];
174
192
  }
175
193
 
176
194
  // Metadata type for the operation returned by
177
195
  // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
178
196
  message CreateBackupMetadata {
179
197
  // The name of the backup being created.
180
- string name = 1 [(google.api.resource_reference) = {
181
- type: "spanner.googleapis.com/Backup"
182
- }];
198
+ string name = 1 [
199
+ (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
200
+ ];
183
201
 
184
202
  // The name of the database the backup is created from.
185
203
  string database = 2 [(google.api.resource_reference) = {
186
- type: "spanner.googleapis.com/Database"
187
- }];
204
+ type: "spanner.googleapis.com/Database"
205
+ }];
188
206
 
189
207
  // The progress of the
190
- // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
208
+ // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
209
+ // operation.
191
210
  OperationProgress progress = 3;
192
211
 
193
212
  // The time at which cancellation of this operation was received.
@@ -205,10 +224,11 @@ message CreateBackupMetadata {
205
224
  google.protobuf.Timestamp cancel_time = 4;
206
225
  }
207
226
 
208
- // The request for [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup].
227
+ // The request for
228
+ // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup].
209
229
  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>`.
230
+ // Required. The name of the destination instance that will contain the backup
231
+ // copy. Values are of the form: `projects/<project>/instances/<instance>`.
212
232
  string parent = 1 [
213
233
  (google.api.field_behavior) = REQUIRED,
214
234
  (google.api.resource_reference) = {
@@ -229,9 +249,7 @@ message CopyBackupRequest {
229
249
  // `projects/<project>/instances/<instance>/backups/<backup>`.
230
250
  string source_backup = 3 [
231
251
  (google.api.field_behavior) = REQUIRED,
232
- (google.api.resource_reference) = {
233
- type: "spanner.googleapis.com/Backup"
234
- }
252
+ (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
235
253
  ];
236
254
 
237
255
  // Required. The expiration time of the backup in microsecond granularity.
@@ -239,35 +257,38 @@ message CopyBackupRequest {
239
257
  // from the `create_time` of the source backup. Once the `expire_time` has
240
258
  // passed, the backup is eligible to be automatically deleted by Cloud Spanner
241
259
  // 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];
260
+ google.protobuf.Timestamp expire_time = 4
261
+ [(google.api.field_behavior) = REQUIRED];
262
+
263
+ // Optional. The encryption configuration used to encrypt the backup. If this
264
+ // field is not specified, the backup will use the same encryption
265
+ // configuration as the source backup by default, namely
266
+ // [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type]
267
+ // = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
268
+ CopyBackupEncryptionConfig encryption_config = 5
269
+ [(google.api.field_behavior) = OPTIONAL];
250
270
  }
251
271
 
252
- // Metadata type for the google.longrunning.Operation returned by
272
+ // Metadata type for the operation returned by
253
273
  // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup].
254
274
  message CopyBackupMetadata {
255
275
  // The name of the backup being created through the copy operation.
256
276
  // Values are of the form
257
277
  // `projects/<project>/instances/<instance>/backups/<backup>`.
258
- string name = 1 [(google.api.resource_reference) = {
259
- type: "spanner.googleapis.com/Backup"
260
- }];
278
+ string name = 1 [
279
+ (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
280
+ ];
261
281
 
262
282
  // The name of the source backup that is being copied.
263
283
  // Values are of the form
264
284
  // `projects/<project>/instances/<instance>/backups/<backup>`.
265
- string source_backup = 2 [(google.api.resource_reference) = {
266
- type: "spanner.googleapis.com/Backup"
267
- }];
285
+ string source_backup = 2 [
286
+ (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
287
+ ];
268
288
 
269
289
  // The progress of the
270
- // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] operation.
290
+ // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]
291
+ // operation.
271
292
  OperationProgress progress = 3;
272
293
 
273
294
  // The time at which cancellation of CopyBackup operation was received.
@@ -285,7 +306,8 @@ message CopyBackupMetadata {
285
306
  google.protobuf.Timestamp cancel_time = 4;
286
307
  }
287
308
 
288
- // The request for [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup].
309
+ // The request for
310
+ // [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup].
289
311
  message UpdateBackupRequest {
290
312
  // Required. The backup to update. `backup.name`, and the fields to be updated
291
313
  // as specified by `update_mask` are required. Other fields are ignored.
@@ -298,36 +320,36 @@ message UpdateBackupRequest {
298
320
  // resource, not to the request message. The field mask must always be
299
321
  // specified; this prevents any future fields from being erased accidentally
300
322
  // by clients that do not know about them.
301
- google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
323
+ google.protobuf.FieldMask update_mask = 2
324
+ [(google.api.field_behavior) = REQUIRED];
302
325
  }
303
326
 
304
- // The request for [GetBackup][google.spanner.admin.database.v1.DatabaseAdmin.GetBackup].
327
+ // The request for
328
+ // [GetBackup][google.spanner.admin.database.v1.DatabaseAdmin.GetBackup].
305
329
  message GetBackupRequest {
306
330
  // Required. Name of the backup.
307
331
  // Values are of the form
308
332
  // `projects/<project>/instances/<instance>/backups/<backup>`.
309
333
  string name = 1 [
310
334
  (google.api.field_behavior) = REQUIRED,
311
- (google.api.resource_reference) = {
312
- type: "spanner.googleapis.com/Backup"
313
- }
335
+ (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
314
336
  ];
315
337
  }
316
338
 
317
- // The request for [DeleteBackup][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup].
339
+ // The request for
340
+ // [DeleteBackup][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup].
318
341
  message DeleteBackupRequest {
319
342
  // Required. Name of the backup to delete.
320
343
  // Values are of the form
321
344
  // `projects/<project>/instances/<instance>/backups/<backup>`.
322
345
  string name = 1 [
323
346
  (google.api.field_behavior) = REQUIRED,
324
- (google.api.resource_reference) = {
325
- type: "spanner.googleapis.com/Backup"
326
- }
347
+ (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
327
348
  ];
328
349
  }
329
350
 
330
- // The request for [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
351
+ // The request for
352
+ // [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
331
353
  message ListBackupsRequest {
332
354
  // Required. The instance to list backups from. Values are of the
333
355
  // form `projects/<project>/instances/<instance>`.
@@ -346,7 +368,9 @@ message ListBackupsRequest {
346
368
  // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
347
369
  // Colon `:` is the contains operator. Filter rules are not case sensitive.
348
370
  //
349
- // The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering:
371
+ // The following fields in the
372
+ // [Backup][google.spanner.admin.database.v1.Backup] are eligible for
373
+ // filtering:
350
374
  //
351
375
  // * `name`
352
376
  // * `database`
@@ -380,21 +404,23 @@ message ListBackupsRequest {
380
404
  int32 page_size = 3;
381
405
 
382
406
  // If non-empty, `page_token` should contain a
383
- // [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] from a
384
- // previous [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] to the same `parent` and with the same
385
- // `filter`.
407
+ // [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token]
408
+ // from a previous
409
+ // [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse]
410
+ // to the same `parent` and with the same `filter`.
386
411
  string page_token = 4;
387
412
  }
388
413
 
389
- // The response for [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
414
+ // The response for
415
+ // [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
390
416
  message ListBackupsResponse {
391
417
  // The list of matching backups. Backups returned are ordered by `create_time`
392
418
  // in descending order, starting from the most recent `create_time`.
393
419
  repeated Backup backups = 1;
394
420
 
395
421
  // `next_page_token` can be sent in a subsequent
396
- // [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] call to fetch more
397
- // of the matching backups.
422
+ // [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups]
423
+ // call to fetch more of the matching backups.
398
424
  string next_page_token = 2;
399
425
  }
400
426
 
@@ -424,7 +450,9 @@ message ListBackupOperationsRequest {
424
450
  // * `name` - The name of the long-running operation
425
451
  // * `done` - False if the operation is in progress, else true.
426
452
  // * `metadata.@type` - the type of metadata. For example, the type string
427
- // for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is
453
+ // for
454
+ // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]
455
+ // is
428
456
  // `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
429
457
  // * `metadata.<field_name>` - any field in metadata.value.
430
458
  // `metadata.@type` must be specified first if filtering on metadata
@@ -442,14 +470,15 @@ message ListBackupOperationsRequest {
442
470
  // * `done:true` - The operation is complete.
443
471
  // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
444
472
  // `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".
473
+ // * The operation's metadata type is
474
+ // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
475
+ // * The source database name of backup contains the string "prod".
448
476
  // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
449
477
  // `(metadata.name:howl) AND` \
450
478
  // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
451
479
  // `(error:*)` - Returns operations where:
452
- // * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
480
+ // * The operation's metadata type is
481
+ // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
453
482
  // * The backup name contains the string "howl".
454
483
  // * The operation started before 2018-03-28T14:50:00Z.
455
484
  // * The operation resulted in an error.
@@ -457,9 +486,9 @@ message ListBackupOperationsRequest {
457
486
  // `(metadata.source_backup:test) AND` \
458
487
  // `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \
459
488
  // `(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".
489
+ // * The operation's metadata type is
490
+ // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
491
+ // * The source backup name contains the string "test".
463
492
  // * The operation started before 2022-01-18T14:50:00Z.
464
493
  // * The operation resulted in an error.
465
494
  // * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
@@ -469,12 +498,13 @@ message ListBackupOperationsRequest {
469
498
  // `(metadata.source_backup:test_bkp)) AND` \
470
499
  // `(error:*)` - Returns operations where:
471
500
  // * 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
501
+ // * The operation's metadata type is
502
+ // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]
503
+ // AND the source database name of the backup contains the string
474
504
  // "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"
505
+ // * The operation's metadata type is
506
+ // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]
507
+ // AND the source backup name contains the string "test_bkp"
478
508
  // * The operation resulted in an error.
479
509
  string filter = 2;
480
510
 
@@ -484,8 +514,9 @@ message ListBackupOperationsRequest {
484
514
 
485
515
  // If non-empty, `page_token` should contain a
486
516
  // [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token]
487
- // from a previous [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] to the
488
- // same `parent` and with the same `filter`.
517
+ // from a previous
518
+ // [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse]
519
+ // to the same `parent` and with the same `filter`.
489
520
  string page_token = 4;
490
521
  }
491
522
 
@@ -512,25 +543,26 @@ message ListBackupOperationsResponse {
512
543
  // Information about a backup.
513
544
  message BackupInfo {
514
545
  // Name of the backup.
515
- string backup = 1 [(google.api.resource_reference) = {
516
- type: "spanner.googleapis.com/Backup"
517
- }];
546
+ string backup = 1 [
547
+ (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
548
+ ];
518
549
 
519
550
  // The backup contains an externally consistent copy of `source_database` at
520
551
  // the timestamp specified by `version_time`. If the
521
- // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
522
- // `version_time`, the `version_time` of the backup is equivalent to the
523
- // `create_time`.
552
+ // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
553
+ // request did not specify `version_time`, the `version_time` of the backup is
554
+ // equivalent to the `create_time`.
524
555
  google.protobuf.Timestamp version_time = 4;
525
556
 
526
- // The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
527
- // received.
557
+ // The time the
558
+ // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
559
+ // request was received.
528
560
  google.protobuf.Timestamp create_time = 2;
529
561
 
530
562
  // Name of the database the backup was created from.
531
563
  string source_database = 3 [(google.api.resource_reference) = {
532
- type: "spanner.googleapis.com/Database"
533
- }];
564
+ type: "spanner.googleapis.com/Database"
565
+ }];
534
566
  }
535
567
 
536
568
  // Encryption configuration for the backup to create.
@@ -542,9 +574,10 @@ message CreateBackupEncryptionConfig {
542
574
 
543
575
  // Use the same encryption configuration as the database. This is the
544
576
  // default option when
545
- // [encryption_config][google.spanner.admin.database.v1.CreateBackupEncryptionConfig] is empty.
546
- // For example, if the database is using `Customer_Managed_Encryption`, the
547
- // backup will be using the same Cloud KMS key as the database.
577
+ // [encryption_config][google.spanner.admin.database.v1.CreateBackupEncryptionConfig]
578
+ // is empty. For example, if the database is using
579
+ // `Customer_Managed_Encryption`, the backup will be using the same Cloud
580
+ // KMS key as the database.
548
581
  USE_DATABASE_ENCRYPTION = 1;
549
582
 
550
583
  // Use Google default encryption.
@@ -560,8 +593,8 @@ message CreateBackupEncryptionConfig {
560
593
 
561
594
  // Optional. The Cloud KMS key that will be used to protect the backup.
562
595
  // This field should be set only when
563
- // [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] is
564
- // `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
596
+ // [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type]
597
+ // is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
565
598
  // `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
566
599
  string kms_key_name = 2 [
567
600
  (google.api.field_behavior) = OPTIONAL,
@@ -569,6 +602,28 @@ message CreateBackupEncryptionConfig {
569
602
  type: "cloudkms.googleapis.com/CryptoKey"
570
603
  }
571
604
  ];
605
+
606
+ // Optional. Specifies the KMS configuration for the one or more keys used to
607
+ // protect the backup. Values are of the form
608
+ // `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
609
+ //
610
+ // The keys referenced by kms_key_names must fully cover all
611
+ // regions of the backup's instance configuration. Some examples:
612
+ // * For single region instance configs, specify a single regional
613
+ // location KMS key.
614
+ // * For multi-regional instance configs of type GOOGLE_MANAGED,
615
+ // either specify a multi-regional location KMS key or multiple regional
616
+ // location KMS keys that cover all regions in the instance config.
617
+ // * For an instance config of type USER_MANAGED, please specify only
618
+ // regional location KMS keys to cover each region in the instance config.
619
+ // Multi-regional location KMS keys are not supported for USER_MANAGED
620
+ // instance configs.
621
+ repeated string kms_key_names = 3 [
622
+ (google.api.field_behavior) = OPTIONAL,
623
+ (google.api.resource_reference) = {
624
+ type: "cloudkms.googleapis.com/CryptoKey"
625
+ }
626
+ ];
572
627
  }
573
628
 
574
629
  // Encryption configuration for the copied backup.
@@ -578,17 +633,20 @@ message CopyBackupEncryptionConfig {
578
633
  // Unspecified. Do not use.
579
634
  ENCRYPTION_TYPE_UNSPECIFIED = 0;
580
635
 
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.
636
+ // This is the default option for
637
+ // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]
638
+ // when
639
+ // [encryption_config][google.spanner.admin.database.v1.CopyBackupEncryptionConfig]
640
+ // is not specified. For example, if the source backup is using
641
+ // `Customer_Managed_Encryption`, the backup will be using the same Cloud
642
+ // KMS key as the source backup.
585
643
  USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1;
586
644
 
587
645
  // Use Google default encryption.
588
646
  GOOGLE_DEFAULT_ENCRYPTION = 2;
589
647
 
590
- // Use customer managed encryption. If specified, `kms_key_name`
591
- // must contain a valid Cloud KMS key.
648
+ // Use customer managed encryption. If specified, either `kms_key_name` or
649
+ // `kms_key_names` must contain valid Cloud KMS key(s).
592
650
  CUSTOMER_MANAGED_ENCRYPTION = 3;
593
651
  }
594
652
 
@@ -597,8 +655,8 @@ message CopyBackupEncryptionConfig {
597
655
 
598
656
  // Optional. The Cloud KMS key that will be used to protect the backup.
599
657
  // 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
658
+ // [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type]
659
+ // is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
602
660
  // `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
603
661
  string kms_key_name = 2 [
604
662
  (google.api.field_behavior) = OPTIONAL,
@@ -606,4 +664,27 @@ message CopyBackupEncryptionConfig {
606
664
  type: "cloudkms.googleapis.com/CryptoKey"
607
665
  }
608
666
  ];
667
+
668
+ // Optional. Specifies the KMS configuration for the one or more keys used to
669
+ // protect the backup. Values are of the form
670
+ // `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
671
+ // Kms keys specified can be in any order.
672
+ //
673
+ // The keys referenced by kms_key_names must fully cover all
674
+ // regions of the backup's instance configuration. Some examples:
675
+ // * For single region instance configs, specify a single regional
676
+ // location KMS key.
677
+ // * For multi-regional instance configs of type GOOGLE_MANAGED,
678
+ // either specify a multi-regional location KMS key or multiple regional
679
+ // location KMS keys that cover all regions in the instance config.
680
+ // * For an instance config of type USER_MANAGED, please specify only
681
+ // regional location KMS keys to cover each region in the instance config.
682
+ // Multi-regional location KMS keys are not supported for USER_MANAGED
683
+ // instance configs.
684
+ repeated string kms_key_names = 3 [
685
+ (google.api.field_behavior) = OPTIONAL,
686
+ (google.api.resource_reference) = {
687
+ type: "cloudkms.googleapis.com/CryptoKey"
688
+ }
689
+ ];
609
690
  }