@google-cloud/spanner-api 0.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 (49) hide show
  1. package/README.md +111 -0
  2. package/build/protos/google/spanner/admin/database/v1/backup.proto +773 -0
  3. package/build/protos/google/spanner/admin/database/v1/backup_schedule.proto +230 -0
  4. package/build/protos/google/spanner/admin/database/v1/common.proto +132 -0
  5. package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +1314 -0
  6. package/build/protos/google/spanner/admin/instance/v1/common.proto +64 -0
  7. package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +2184 -0
  8. package/build/protos/google/spanner/executor/v1/cloud_executor.proto +1610 -0
  9. package/build/protos/google/spanner/v1/change_stream.proto +451 -0
  10. package/build/protos/google/spanner/v1/commit_response.proto +80 -0
  11. package/build/protos/google/spanner/v1/keys.proto +163 -0
  12. package/build/protos/google/spanner/v1/location.proto +388 -0
  13. package/build/protos/google/spanner/v1/mutation.proto +156 -0
  14. package/build/protos/google/spanner/v1/query_plan.proto +156 -0
  15. package/build/protos/google/spanner/v1/result_set.proto +260 -0
  16. package/build/protos/google/spanner/v1/spanner.proto +1472 -0
  17. package/build/protos/google/spanner/v1/transaction.proto +329 -0
  18. package/build/protos/google/spanner/v1/type.proto +214 -0
  19. package/build/protos/protos.d.ts +42547 -0
  20. package/build/protos/protos.js +1 -0
  21. package/build/protos/protos.json +1 -0
  22. package/build/src/index.d.ts +20 -0
  23. package/build/src/index.js +34 -0
  24. package/build/src/index.js.map +1 -0
  25. package/build/src/v1/database_admin_client.d.ts +2433 -0
  26. package/build/src/v1/database_admin_client.js +2938 -0
  27. package/build/src/v1/database_admin_client.js.map +1 -0
  28. package/build/src/v1/database_admin_client_config.json +169 -0
  29. package/build/src/v1/database_admin_proto_list.json +6 -0
  30. package/build/src/v1/gapic_metadata.json +253 -0
  31. package/build/src/v1/index.d.ts +4 -0
  32. package/build/src/v1/index.js +29 -0
  33. package/build/src/v1/index.js.map +1 -0
  34. package/build/src/v1/instance_admin_client.d.ts +2162 -0
  35. package/build/src/v1/instance_admin_client.js +2411 -0
  36. package/build/src/v1/instance_admin_client.js.map +1 -0
  37. package/build/src/v1/instance_admin_client_config.json +129 -0
  38. package/build/src/v1/instance_admin_proto_list.json +4 -0
  39. package/build/src/v1/spanner_client.d.ts +1353 -0
  40. package/build/src/v1/spanner_client.js +1456 -0
  41. package/build/src/v1/spanner_client.js.map +1 -0
  42. package/build/src/v1/spanner_client_config.json +123 -0
  43. package/build/src/v1/spanner_executor_proxy_client.d.ts +419 -0
  44. package/build/src/v1/spanner_executor_proxy_client.js +730 -0
  45. package/build/src/v1/spanner_executor_proxy_client.js.map +1 -0
  46. package/build/src/v1/spanner_executor_proxy_client_config.json +30 -0
  47. package/build/src/v1/spanner_executor_proxy_proto_list.json +15 -0
  48. package/build/src/v1/spanner_proto_list.json +12 -0
  49. package/package.json +65 -0
@@ -0,0 +1,773 @@
1
+ // Copyright 2025 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.spanner.admin.database.v1;
18
+
19
+ import "google/api/field_behavior.proto";
20
+ import "google/api/resource.proto";
21
+ import "google/longrunning/operations.proto";
22
+ import "google/protobuf/field_mask.proto";
23
+ import "google/protobuf/timestamp.proto";
24
+ import "google/spanner/admin/database/v1/common.proto";
25
+
26
+ option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1";
27
+ option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb";
28
+ option java_multiple_files = true;
29
+ option java_outer_classname = "BackupProto";
30
+ option java_package = "com.google.spanner.admin.database.v1";
31
+ option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1";
32
+ option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1";
33
+
34
+ // A backup of a Cloud Spanner database.
35
+ message Backup {
36
+ option (google.api.resource) = {
37
+ type: "spanner.googleapis.com/Backup"
38
+ pattern: "projects/{project}/instances/{instance}/backups/{backup}"
39
+ };
40
+
41
+ // Indicates the current state of the backup.
42
+ enum State {
43
+ // Not specified.
44
+ STATE_UNSPECIFIED = 0;
45
+
46
+ // The pending backup is still being created. Operations on the
47
+ // backup may fail with `FAILED_PRECONDITION` in this state.
48
+ CREATING = 1;
49
+
50
+ // The backup is complete and ready for use.
51
+ READY = 2;
52
+ }
53
+
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
+ // `projects/<project>/instances/<instance>/databases/<database>`.
59
+ string database = 2 [(google.api.resource_reference) = {
60
+ type: "spanner.googleapis.com/Database"
61
+ }];
62
+
63
+ // The backup will contain an externally consistent copy of the database at
64
+ // the timestamp specified by `version_time`. If `version_time` is not
65
+ // specified, the system will set `version_time` to the `create_time` of the
66
+ // backup.
67
+ google.protobuf.Timestamp version_time = 9;
68
+
69
+ // Required for the
70
+ // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
71
+ // operation. The expiration time of the backup, with microseconds
72
+ // granularity that must be at least 6 hours and at most 366 days
73
+ // from the time the CreateBackup request is processed. Once the `expire_time`
74
+ // has passed, the backup is eligible to be automatically deleted by Cloud
75
+ // Spanner to free the resources used by the backup.
76
+ google.protobuf.Timestamp expire_time = 3;
77
+
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.
83
+ //
84
+ // A globally unique identifier for the backup which cannot be
85
+ // changed. Values are of the form
86
+ // `projects/<project>/instances/<instance>/backups/[a-z][a-z0-9_\-]*[a-z0-9]`
87
+ // The final segment of the name must be between 2 and 60 characters
88
+ // in length.
89
+ //
90
+ // The backup is stored in the location(s) specified in the instance
91
+ // configuration of the instance containing the backup, identified
92
+ // by the prefix of the backup name of the form
93
+ // `projects/<project>/instances/<instance>`.
94
+ string name = 1;
95
+
96
+ // Output only. The time the
97
+ // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
98
+ // request is received. If the request does not specify `version_time`, the
99
+ // `version_time` of the backup will be equivalent to the `create_time`.
100
+ google.protobuf.Timestamp create_time = 4
101
+ [(google.api.field_behavior) = OUTPUT_ONLY];
102
+
103
+ // Output only. Size of the backup in bytes.
104
+ int64 size_bytes = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
105
+
106
+ // Output only. The number of bytes that will be freed by deleting this
107
+ // backup. This value will be zero if, for example, this backup is part of an
108
+ // incremental backup chain and younger backups in the chain require that we
109
+ // keep its data. For backups not in an incremental backup chain, this is
110
+ // always the size of the backup. This value may change if backups on the same
111
+ // chain get created, deleted or expired.
112
+ int64 freeable_size_bytes = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
113
+
114
+ // Output only. For a backup in an incremental backup chain, this is the
115
+ // storage space needed to keep the data that has changed since the previous
116
+ // backup. For all other backups, this is always the size of the backup. This
117
+ // value may change if backups on the same chain get deleted or expired.
118
+ //
119
+ // This field can be used to calculate the total storage space used by a set
120
+ // of backups. For example, the total space used by all backups of a database
121
+ // can be computed by summing up this field.
122
+ int64 exclusive_size_bytes = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
123
+
124
+ // Output only. The current state of the backup.
125
+ State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
126
+
127
+ // Output only. The names of the restored databases that reference the backup.
128
+ // The database names are of
129
+ // the form `projects/<project>/instances/<instance>/databases/<database>`.
130
+ // Referencing databases may exist in different instances. The existence of
131
+ // any referencing database prevents the backup from being deleted. When a
132
+ // restored database from the backup enters the `READY` state, the reference
133
+ // to the backup is removed.
134
+ repeated string referencing_databases = 7 [
135
+ (google.api.field_behavior) = OUTPUT_ONLY,
136
+ (google.api.resource_reference) = {
137
+ type: "spanner.googleapis.com/Database"
138
+ }
139
+ ];
140
+
141
+ // Output only. The encryption information for the backup.
142
+ EncryptionInfo encryption_info = 8
143
+ [(google.api.field_behavior) = OUTPUT_ONLY];
144
+
145
+ // Output only. The encryption information for the backup, whether it is
146
+ // protected by one or more KMS keys. The information includes all Cloud
147
+ // KMS key versions used to encrypt the backup. The `encryption_status' field
148
+ // inside of each `EncryptionInfo` is not populated. At least one of the key
149
+ // versions must be available for the backup to be restored. If a key version
150
+ // is revoked in the middle of a restore, the restore behavior is undefined.
151
+ repeated EncryptionInfo encryption_information = 13
152
+ [(google.api.field_behavior) = OUTPUT_ONLY];
153
+
154
+ // Output only. The database dialect information for the backup.
155
+ DatabaseDialect database_dialect = 10
156
+ [(google.api.field_behavior) = OUTPUT_ONLY];
157
+
158
+ // Output only. The names of the destination backups being created by copying
159
+ // this source backup. The backup names are of the form
160
+ // `projects/<project>/instances/<instance>/backups/<backup>`.
161
+ // Referencing backups may exist in different instances. The existence of
162
+ // any referencing backup prevents the backup from being deleted. When the
163
+ // copy operation is done (either successfully completed or cancelled or the
164
+ // destination backup is deleted), the reference to the backup is removed.
165
+ repeated string referencing_backups = 11 [
166
+ (google.api.field_behavior) = OUTPUT_ONLY,
167
+ (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
168
+ ];
169
+
170
+ // Output only. The max allowed expiration time of the backup, with
171
+ // microseconds granularity. A backup's expiration time can be configured in
172
+ // multiple APIs: CreateBackup, UpdateBackup, CopyBackup. When updating or
173
+ // copying an existing backup, the expiration time specified must be
174
+ // less than `Backup.max_expire_time`.
175
+ google.protobuf.Timestamp max_expire_time = 12
176
+ [(google.api.field_behavior) = OUTPUT_ONLY];
177
+
178
+ // Output only. List of backup schedule URIs that are associated with
179
+ // creating this backup. This is only applicable for scheduled backups, and
180
+ // is empty for on-demand backups.
181
+ //
182
+ // To optimize for storage, whenever possible, multiple schedules are
183
+ // collapsed together to create one backup. In such cases, this field captures
184
+ // the list of all backup schedule URIs that are associated with creating
185
+ // this backup. If collapsing is not done, then this field captures the
186
+ // single backup schedule URI associated with creating this backup.
187
+ repeated string backup_schedules = 14 [
188
+ (google.api.field_behavior) = OUTPUT_ONLY,
189
+ (google.api.resource_reference) = {
190
+ type: "spanner.googleapis.com/BackupSchedule"
191
+ }
192
+ ];
193
+
194
+ // Output only. Populated only for backups in an incremental backup chain.
195
+ // Backups share the same chain id if and only if they belong to the same
196
+ // incremental backup chain. Use this field to determine which backups are
197
+ // part of the same incremental backup chain. The ordering of backups in the
198
+ // chain can be determined by ordering the backup `version_time`.
199
+ string incremental_backup_chain_id = 17
200
+ [(google.api.field_behavior) = OUTPUT_ONLY];
201
+
202
+ // Output only. Data deleted at a time older than this is guaranteed not to be
203
+ // retained in order to support this backup. For a backup in an incremental
204
+ // backup chain, this is the version time of the oldest backup that exists or
205
+ // ever existed in the chain. For all other backups, this is the version time
206
+ // of the backup. This field can be used to understand what data is being
207
+ // retained by the backup system.
208
+ google.protobuf.Timestamp oldest_version_time = 18
209
+ [(google.api.field_behavior) = OUTPUT_ONLY];
210
+
211
+ // Output only. The instance partition(s) storing the backup.
212
+ //
213
+ // This is the same as the list of the instance partition(s) that the database
214
+ // had footprint in at the backup's `version_time`.
215
+ repeated BackupInstancePartition instance_partitions = 19
216
+ [(google.api.field_behavior) = OUTPUT_ONLY];
217
+ }
218
+
219
+ // The request for
220
+ // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
221
+ message CreateBackupRequest {
222
+ // Required. The name of the instance in which the backup will be
223
+ // created. This must be the same instance that contains the database the
224
+ // backup will be created from. The backup will be stored in the
225
+ // location(s) specified in the instance configuration of this
226
+ // instance. Values are of the form
227
+ // `projects/<project>/instances/<instance>`.
228
+ string parent = 1 [
229
+ (google.api.field_behavior) = REQUIRED,
230
+ (google.api.resource_reference) = {
231
+ type: "spanner.googleapis.com/Instance"
232
+ }
233
+ ];
234
+
235
+ // Required. The id of the backup to be created. The `backup_id` appended to
236
+ // `parent` forms the full backup name of the form
237
+ // `projects/<project>/instances/<instance>/backups/<backup_id>`.
238
+ string backup_id = 2 [(google.api.field_behavior) = REQUIRED];
239
+
240
+ // Required. The backup to create.
241
+ Backup backup = 3 [(google.api.field_behavior) = REQUIRED];
242
+
243
+ // Optional. The encryption configuration used to encrypt the backup. If this
244
+ // field is not specified, the backup will use the same encryption
245
+ // configuration as the database by default, namely
246
+ // [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type]
247
+ // = `USE_DATABASE_ENCRYPTION`.
248
+ CreateBackupEncryptionConfig encryption_config = 4
249
+ [(google.api.field_behavior) = OPTIONAL];
250
+ }
251
+
252
+ // Metadata type for the operation returned by
253
+ // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
254
+ message CreateBackupMetadata {
255
+ // The name of the backup being created.
256
+ string name = 1 [
257
+ (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
258
+ ];
259
+
260
+ // The name of the database the backup is created from.
261
+ string database = 2 [(google.api.resource_reference) = {
262
+ type: "spanner.googleapis.com/Database"
263
+ }];
264
+
265
+ // The progress of the
266
+ // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
267
+ // operation.
268
+ OperationProgress progress = 3;
269
+
270
+ // The time at which cancellation of this operation was received.
271
+ // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
272
+ // starts asynchronous cancellation on a long-running operation. The server
273
+ // makes a best effort to cancel the operation, but success is not guaranteed.
274
+ // Clients can use
275
+ // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
276
+ // other methods to check whether the cancellation succeeded or whether the
277
+ // operation completed despite cancellation. On successful cancellation,
278
+ // the operation is not deleted; instead, it becomes an operation with
279
+ // an [Operation.error][google.longrunning.Operation.error] value with a
280
+ // [google.rpc.Status.code][google.rpc.Status.code] of 1,
281
+ // corresponding to `Code.CANCELLED`.
282
+ google.protobuf.Timestamp cancel_time = 4;
283
+ }
284
+
285
+ // The request for
286
+ // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup].
287
+ message CopyBackupRequest {
288
+ // Required. The name of the destination instance that will contain the backup
289
+ // copy. Values are of the form: `projects/<project>/instances/<instance>`.
290
+ string parent = 1 [
291
+ (google.api.field_behavior) = REQUIRED,
292
+ (google.api.resource_reference) = {
293
+ type: "spanner.googleapis.com/Instance"
294
+ }
295
+ ];
296
+
297
+ // Required. The id of the backup copy.
298
+ // The `backup_id` appended to `parent` forms the full backup_uri of the form
299
+ // `projects/<project>/instances/<instance>/backups/<backup>`.
300
+ string backup_id = 2 [(google.api.field_behavior) = REQUIRED];
301
+
302
+ // Required. The source backup to be copied.
303
+ // The source backup needs to be in READY state for it to be copied.
304
+ // Once CopyBackup is in progress, the source backup cannot be deleted or
305
+ // cleaned up on expiration until CopyBackup is finished.
306
+ // Values are of the form:
307
+ // `projects/<project>/instances/<instance>/backups/<backup>`.
308
+ string source_backup = 3 [
309
+ (google.api.field_behavior) = REQUIRED,
310
+ (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
311
+ ];
312
+
313
+ // Required. The expiration time of the backup in microsecond granularity.
314
+ // The expiration time must be at least 6 hours and at most 366 days
315
+ // from the `create_time` of the source backup. Once the `expire_time` has
316
+ // passed, the backup is eligible to be automatically deleted by Cloud Spanner
317
+ // to free the resources used by the backup.
318
+ google.protobuf.Timestamp expire_time = 4
319
+ [(google.api.field_behavior) = REQUIRED];
320
+
321
+ // Optional. The encryption configuration used to encrypt the backup. If this
322
+ // field is not specified, the backup will use the same encryption
323
+ // configuration as the source backup by default, namely
324
+ // [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type]
325
+ // = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
326
+ CopyBackupEncryptionConfig encryption_config = 5
327
+ [(google.api.field_behavior) = OPTIONAL];
328
+ }
329
+
330
+ // Metadata type for the operation returned by
331
+ // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup].
332
+ message CopyBackupMetadata {
333
+ // The name of the backup being created through the copy operation.
334
+ // Values are of the form
335
+ // `projects/<project>/instances/<instance>/backups/<backup>`.
336
+ string name = 1 [
337
+ (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
338
+ ];
339
+
340
+ // The name of the source backup that is being copied.
341
+ // Values are of the form
342
+ // `projects/<project>/instances/<instance>/backups/<backup>`.
343
+ string source_backup = 2 [
344
+ (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
345
+ ];
346
+
347
+ // The progress of the
348
+ // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]
349
+ // operation.
350
+ OperationProgress progress = 3;
351
+
352
+ // The time at which cancellation of CopyBackup operation was received.
353
+ // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
354
+ // starts asynchronous cancellation on a long-running operation. The server
355
+ // makes a best effort to cancel the operation, but success is not guaranteed.
356
+ // Clients can use
357
+ // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
358
+ // other methods to check whether the cancellation succeeded or whether the
359
+ // operation completed despite cancellation. On successful cancellation,
360
+ // the operation is not deleted; instead, it becomes an operation with
361
+ // an [Operation.error][google.longrunning.Operation.error] value with a
362
+ // [google.rpc.Status.code][google.rpc.Status.code] of 1,
363
+ // corresponding to `Code.CANCELLED`.
364
+ google.protobuf.Timestamp cancel_time = 4;
365
+ }
366
+
367
+ // The request for
368
+ // [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup].
369
+ message UpdateBackupRequest {
370
+ // Required. The backup to update. `backup.name`, and the fields to be updated
371
+ // as specified by `update_mask` are required. Other fields are ignored.
372
+ // Update is only supported for the following fields:
373
+ // * `backup.expire_time`.
374
+ Backup backup = 1 [(google.api.field_behavior) = REQUIRED];
375
+
376
+ // Required. A mask specifying which fields (e.g. `expire_time`) in the
377
+ // Backup resource should be updated. This mask is relative to the Backup
378
+ // resource, not to the request message. The field mask must always be
379
+ // specified; this prevents any future fields from being erased accidentally
380
+ // by clients that do not know about them.
381
+ google.protobuf.FieldMask update_mask = 2
382
+ [(google.api.field_behavior) = REQUIRED];
383
+ }
384
+
385
+ // The request for
386
+ // [GetBackup][google.spanner.admin.database.v1.DatabaseAdmin.GetBackup].
387
+ message GetBackupRequest {
388
+ // Required. Name of the backup.
389
+ // Values are of the form
390
+ // `projects/<project>/instances/<instance>/backups/<backup>`.
391
+ string name = 1 [
392
+ (google.api.field_behavior) = REQUIRED,
393
+ (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
394
+ ];
395
+ }
396
+
397
+ // The request for
398
+ // [DeleteBackup][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup].
399
+ message DeleteBackupRequest {
400
+ // Required. Name of the backup to delete.
401
+ // Values are of the form
402
+ // `projects/<project>/instances/<instance>/backups/<backup>`.
403
+ string name = 1 [
404
+ (google.api.field_behavior) = REQUIRED,
405
+ (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
406
+ ];
407
+ }
408
+
409
+ // The request for
410
+ // [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
411
+ message ListBackupsRequest {
412
+ // Required. The instance to list backups from. Values are of the
413
+ // form `projects/<project>/instances/<instance>`.
414
+ string parent = 1 [
415
+ (google.api.field_behavior) = REQUIRED,
416
+ (google.api.resource_reference) = {
417
+ type: "spanner.googleapis.com/Instance"
418
+ }
419
+ ];
420
+
421
+ // An expression that filters the list of returned backups.
422
+ //
423
+ // A filter expression consists of a field name, a comparison operator, and a
424
+ // value for filtering.
425
+ // The value must be a string, a number, or a boolean. The comparison operator
426
+ // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
427
+ // Colon `:` is the contains operator. Filter rules are not case sensitive.
428
+ //
429
+ // The following fields in the
430
+ // [Backup][google.spanner.admin.database.v1.Backup] are eligible for
431
+ // filtering:
432
+ //
433
+ // * `name`
434
+ // * `database`
435
+ // * `state`
436
+ // * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
437
+ // * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
438
+ // * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
439
+ // * `size_bytes`
440
+ // * `backup_schedules`
441
+ //
442
+ // You can combine multiple expressions by enclosing each expression in
443
+ // parentheses. By default, expressions are combined with AND logic, but
444
+ // you can specify AND, OR, and NOT logic explicitly.
445
+ //
446
+ // Here are a few examples:
447
+ //
448
+ // * `name:Howl` - The backup's name contains the string "howl".
449
+ // * `database:prod`
450
+ // - The database's name contains the string "prod".
451
+ // * `state:CREATING` - The backup is pending creation.
452
+ // * `state:READY` - The backup is fully created and ready for use.
453
+ // * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")`
454
+ // - The backup name contains the string "howl" and `create_time`
455
+ // of the backup is before 2018-03-28T14:50:00Z.
456
+ // * `expire_time < \"2018-03-28T14:50:00Z\"`
457
+ // - The backup `expire_time` is before 2018-03-28T14:50:00Z.
458
+ // * `size_bytes > 10000000000` - The backup's size is greater than 10GB
459
+ // * `backup_schedules:daily`
460
+ // - The backup is created from a schedule with "daily" in its name.
461
+ string filter = 2;
462
+
463
+ // Number of backups to be returned in the response. If 0 or
464
+ // less, defaults to the server's maximum allowed page size.
465
+ int32 page_size = 3;
466
+
467
+ // If non-empty, `page_token` should contain a
468
+ // [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token]
469
+ // from a previous
470
+ // [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse]
471
+ // to the same `parent` and with the same `filter`.
472
+ string page_token = 4;
473
+ }
474
+
475
+ // The response for
476
+ // [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
477
+ message ListBackupsResponse {
478
+ // The list of matching backups. Backups returned are ordered by `create_time`
479
+ // in descending order, starting from the most recent `create_time`.
480
+ repeated Backup backups = 1;
481
+
482
+ // `next_page_token` can be sent in a subsequent
483
+ // [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups]
484
+ // call to fetch more of the matching backups.
485
+ string next_page_token = 2;
486
+ }
487
+
488
+ // The request for
489
+ // [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations].
490
+ message ListBackupOperationsRequest {
491
+ // Required. The instance of the backup operations. Values are of
492
+ // the form `projects/<project>/instances/<instance>`.
493
+ string parent = 1 [
494
+ (google.api.field_behavior) = REQUIRED,
495
+ (google.api.resource_reference) = {
496
+ type: "spanner.googleapis.com/Instance"
497
+ }
498
+ ];
499
+
500
+ // An expression that filters the list of returned backup operations.
501
+ //
502
+ // A filter expression consists of a field name, a
503
+ // comparison operator, and a value for filtering.
504
+ // The value must be a string, a number, or a boolean. The comparison operator
505
+ // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
506
+ // Colon `:` is the contains operator. Filter rules are not case sensitive.
507
+ //
508
+ // The following fields in the [operation][google.longrunning.Operation]
509
+ // are eligible for filtering:
510
+ //
511
+ // * `name` - The name of the long-running operation
512
+ // * `done` - False if the operation is in progress, else true.
513
+ // * `metadata.@type` - the type of metadata. For example, the type string
514
+ // for
515
+ // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]
516
+ // is
517
+ // `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
518
+ // * `metadata.<field_name>` - any field in metadata.value.
519
+ // `metadata.@type` must be specified first if filtering on metadata
520
+ // fields.
521
+ // * `error` - Error associated with the long-running operation.
522
+ // * `response.@type` - the type of response.
523
+ // * `response.<field_name>` - any field in response.value.
524
+ //
525
+ // You can combine multiple expressions by enclosing each expression in
526
+ // parentheses. By default, expressions are combined with AND logic, but
527
+ // you can specify AND, OR, and NOT logic explicitly.
528
+ //
529
+ // Here are a few examples:
530
+ //
531
+ // * `done:true` - The operation is complete.
532
+ // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
533
+ // `metadata.database:prod` - Returns operations where:
534
+ // * The operation's metadata type is
535
+ // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
536
+ // * The source database name of backup contains the string "prod".
537
+ // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
538
+ // `(metadata.name:howl) AND` \
539
+ // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
540
+ // `(error:*)` - Returns operations where:
541
+ // * The operation's metadata type is
542
+ // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
543
+ // * The backup name contains the string "howl".
544
+ // * The operation started before 2018-03-28T14:50:00Z.
545
+ // * The operation resulted in an error.
546
+ // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \
547
+ // `(metadata.source_backup:test) AND` \
548
+ // `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \
549
+ // `(error:*)` - Returns operations where:
550
+ // * The operation's metadata type is
551
+ // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
552
+ // * The source backup name contains the string "test".
553
+ // * The operation started before 2022-01-18T14:50:00Z.
554
+ // * The operation resulted in an error.
555
+ // * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
556
+ // `(metadata.database:test_db)) OR` \
557
+ // `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata)
558
+ // AND` \
559
+ // `(metadata.source_backup:test_bkp)) AND` \
560
+ // `(error:*)` - Returns operations where:
561
+ // * The operation's metadata matches either of criteria:
562
+ // * The operation's metadata type is
563
+ // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]
564
+ // AND the source database name of the backup contains the string
565
+ // "test_db"
566
+ // * The operation's metadata type is
567
+ // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]
568
+ // AND the source backup name contains the string "test_bkp"
569
+ // * The operation resulted in an error.
570
+ string filter = 2;
571
+
572
+ // Number of operations to be returned in the response. If 0 or
573
+ // less, defaults to the server's maximum allowed page size.
574
+ int32 page_size = 3;
575
+
576
+ // If non-empty, `page_token` should contain a
577
+ // [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token]
578
+ // from a previous
579
+ // [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse]
580
+ // to the same `parent` and with the same `filter`.
581
+ string page_token = 4;
582
+ }
583
+
584
+ // The response for
585
+ // [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations].
586
+ message ListBackupOperationsResponse {
587
+ // The list of matching backup [long-running
588
+ // operations][google.longrunning.Operation]. Each operation's name will be
589
+ // prefixed by the backup's name. The operation's
590
+ // [metadata][google.longrunning.Operation.metadata] field type
591
+ // `metadata.type_url` describes the type of the metadata. Operations returned
592
+ // include those that are pending or have completed/failed/canceled within the
593
+ // last 7 days. Operations returned are ordered by
594
+ // `operation.metadata.value.progress.start_time` in descending order starting
595
+ // from the most recently started operation.
596
+ repeated google.longrunning.Operation operations = 1;
597
+
598
+ // `next_page_token` can be sent in a subsequent
599
+ // [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]
600
+ // call to fetch more of the matching metadata.
601
+ string next_page_token = 2;
602
+ }
603
+
604
+ // Information about a backup.
605
+ message BackupInfo {
606
+ // Name of the backup.
607
+ string backup = 1 [
608
+ (google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
609
+ ];
610
+
611
+ // The backup contains an externally consistent copy of `source_database` at
612
+ // the timestamp specified by `version_time`. If the
613
+ // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
614
+ // request did not specify `version_time`, the `version_time` of the backup is
615
+ // equivalent to the `create_time`.
616
+ google.protobuf.Timestamp version_time = 4;
617
+
618
+ // The time the
619
+ // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
620
+ // request was received.
621
+ google.protobuf.Timestamp create_time = 2;
622
+
623
+ // Name of the database the backup was created from.
624
+ string source_database = 3 [(google.api.resource_reference) = {
625
+ type: "spanner.googleapis.com/Database"
626
+ }];
627
+ }
628
+
629
+ // Encryption configuration for the backup to create.
630
+ message CreateBackupEncryptionConfig {
631
+ // Encryption types for the backup.
632
+ enum EncryptionType {
633
+ // Unspecified. Do not use.
634
+ ENCRYPTION_TYPE_UNSPECIFIED = 0;
635
+
636
+ // Use the same encryption configuration as the database. This is the
637
+ // default option when
638
+ // [encryption_config][google.spanner.admin.database.v1.CreateBackupEncryptionConfig]
639
+ // is empty. For example, if the database is using
640
+ // `Customer_Managed_Encryption`, the backup will be using the same Cloud
641
+ // KMS key as the database.
642
+ USE_DATABASE_ENCRYPTION = 1;
643
+
644
+ // Use Google default encryption.
645
+ GOOGLE_DEFAULT_ENCRYPTION = 2;
646
+
647
+ // Use customer managed encryption. If specified, `kms_key_name`
648
+ // must contain a valid Cloud KMS key.
649
+ CUSTOMER_MANAGED_ENCRYPTION = 3;
650
+ }
651
+
652
+ // Required. The encryption type of the backup.
653
+ EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED];
654
+
655
+ // Optional. The Cloud KMS key that will be used to protect the backup.
656
+ // This field should be set only when
657
+ // [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type]
658
+ // is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
659
+ // `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
660
+ string kms_key_name = 2 [
661
+ (google.api.field_behavior) = OPTIONAL,
662
+ (google.api.resource_reference) = {
663
+ type: "cloudkms.googleapis.com/CryptoKey"
664
+ }
665
+ ];
666
+
667
+ // Optional. Specifies the KMS configuration for the one or more keys used to
668
+ // protect the backup. Values are of the form
669
+ // `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
670
+ //
671
+ // The keys referenced by kms_key_names must fully cover all
672
+ // regions of the backup's instance configuration. Some examples:
673
+ // * For single region instance configs, specify a single regional
674
+ // location KMS key.
675
+ // * For multi-regional instance configs of type GOOGLE_MANAGED,
676
+ // either specify a multi-regional location KMS key or multiple regional
677
+ // location KMS keys that cover all regions in the instance config.
678
+ // * For an instance config of type USER_MANAGED, please specify only
679
+ // regional location KMS keys to cover each region in the instance config.
680
+ // Multi-regional location KMS keys are not supported for USER_MANAGED
681
+ // instance configs.
682
+ repeated string kms_key_names = 3 [
683
+ (google.api.field_behavior) = OPTIONAL,
684
+ (google.api.resource_reference) = {
685
+ type: "cloudkms.googleapis.com/CryptoKey"
686
+ }
687
+ ];
688
+ }
689
+
690
+ // Encryption configuration for the copied backup.
691
+ message CopyBackupEncryptionConfig {
692
+ // Encryption types for the backup.
693
+ enum EncryptionType {
694
+ // Unspecified. Do not use.
695
+ ENCRYPTION_TYPE_UNSPECIFIED = 0;
696
+
697
+ // This is the default option for
698
+ // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]
699
+ // when
700
+ // [encryption_config][google.spanner.admin.database.v1.CopyBackupEncryptionConfig]
701
+ // is not specified. For example, if the source backup is using
702
+ // `Customer_Managed_Encryption`, the backup will be using the same Cloud
703
+ // KMS key as the source backup.
704
+ USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1;
705
+
706
+ // Use Google default encryption.
707
+ GOOGLE_DEFAULT_ENCRYPTION = 2;
708
+
709
+ // Use customer managed encryption. If specified, either `kms_key_name` or
710
+ // `kms_key_names` must contain valid Cloud KMS key(s).
711
+ CUSTOMER_MANAGED_ENCRYPTION = 3;
712
+ }
713
+
714
+ // Required. The encryption type of the backup.
715
+ EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED];
716
+
717
+ // Optional. The Cloud KMS key that will be used to protect the backup.
718
+ // This field should be set only when
719
+ // [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type]
720
+ // is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
721
+ // `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
722
+ string kms_key_name = 2 [
723
+ (google.api.field_behavior) = OPTIONAL,
724
+ (google.api.resource_reference) = {
725
+ type: "cloudkms.googleapis.com/CryptoKey"
726
+ }
727
+ ];
728
+
729
+ // Optional. Specifies the KMS configuration for the one or more keys used to
730
+ // protect the backup. Values are of the form
731
+ // `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
732
+ // Kms keys specified can be in any order.
733
+ //
734
+ // The keys referenced by kms_key_names must fully cover all
735
+ // regions of the backup's instance configuration. Some examples:
736
+ // * For single region instance configs, specify a single regional
737
+ // location KMS key.
738
+ // * For multi-regional instance configs of type GOOGLE_MANAGED,
739
+ // either specify a multi-regional location KMS key or multiple regional
740
+ // location KMS keys that cover all regions in the instance config.
741
+ // * For an instance config of type USER_MANAGED, please specify only
742
+ // regional location KMS keys to cover each region in the instance config.
743
+ // Multi-regional location KMS keys are not supported for USER_MANAGED
744
+ // instance configs.
745
+ repeated string kms_key_names = 3 [
746
+ (google.api.field_behavior) = OPTIONAL,
747
+ (google.api.resource_reference) = {
748
+ type: "cloudkms.googleapis.com/CryptoKey"
749
+ }
750
+ ];
751
+ }
752
+
753
+ // The specification for full backups.
754
+ // A full backup stores the entire contents of the database at a given
755
+ // version time.
756
+ message FullBackupSpec {}
757
+
758
+ // The specification for incremental backup chains.
759
+ // An incremental backup stores the delta of changes between a previous
760
+ // backup and the database contents at a given version time. An
761
+ // incremental backup chain consists of a full backup and zero or more
762
+ // successive incremental backups. The first backup created for an
763
+ // incremental backup chain is always a full backup.
764
+ message IncrementalBackupSpec {}
765
+
766
+ // Instance partition information for the backup.
767
+ message BackupInstancePartition {
768
+ // A unique identifier for the instance partition. Values are of the form
769
+ // `projects/<project>/instances/<instance>/instancePartitions/<instance_partition_id>`
770
+ string instance_partition = 1 [(google.api.resource_reference) = {
771
+ type: "spanner.googleapis.com/InstancePartition"
772
+ }];
773
+ }