@google-cloud/spanner 7.7.0 → 7.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +4 -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 +56 -1
  20. package/build/src/codec.js +109 -4
  21. package/build/src/database.d.ts +34 -4
  22. package/build/src/database.js +23 -0
  23. package/build/src/index.d.ts +50 -1
  24. package/build/src/index.js +53 -0
  25. package/build/src/partial-result-stream.d.ts +41 -0
  26. package/build/src/partial-result-stream.js +6 -1
  27. package/build/src/table.d.ts +1 -0
  28. package/build/src/table.js +36 -2
  29. package/build/src/transaction-runner.d.ts +1 -0
  30. package/build/src/transaction-runner.js +3 -0
  31. package/build/src/transaction.d.ts +55 -0
  32. package/build/src/transaction.js +28 -2
  33. package/build/src/v1/database_admin_client.d.ts +175 -126
  34. package/build/src/v1/database_admin_client.js +85 -57
  35. package/build/src/v1/spanner_client_config.json +15 -14
  36. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- // Copyright 2023 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.
@@ -46,7 +46,7 @@ option (google.api.resource_definition) = {
46
46
  // The Cloud Spanner Database Admin API can be used to:
47
47
  // * create, drop, and list databases
48
48
  // * update the schema of pre-existing databases
49
- // * create, delete and list backups for a database
49
+ // * create, delete, copy and list backups for a database
50
50
  // * restore a database from an existing backup
51
51
  service DatabaseAdmin {
52
52
  option (google.api.default_host) = "spanner.googleapis.com";
@@ -67,10 +67,11 @@ service DatabaseAdmin {
67
67
  // have a name of the format `<database_name>/operations/<operation_id>` and
68
68
  // can be used to track preparation of the database. The
69
69
  // [metadata][google.longrunning.Operation.metadata] field type is
70
- // [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The
71
- // [response][google.longrunning.Operation.response] field type is
70
+ // [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata].
71
+ // The [response][google.longrunning.Operation.response] field type is
72
72
  // [Database][google.spanner.admin.database.v1.Database], if successful.
73
- rpc CreateDatabase(CreateDatabaseRequest) returns (google.longrunning.Operation) {
73
+ rpc CreateDatabase(CreateDatabaseRequest)
74
+ returns (google.longrunning.Operation) {
74
75
  option (google.api.http) = {
75
76
  post: "/v1/{parent=projects/*/instances/*}/databases"
76
77
  body: "*"
@@ -145,8 +146,10 @@ service DatabaseAdmin {
145
146
  // the format `<database_name>/operations/<operation_id>` and can be used to
146
147
  // track execution of the schema change(s). The
147
148
  // [metadata][google.longrunning.Operation.metadata] field type is
148
- // [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response.
149
- rpc UpdateDatabaseDdl(UpdateDatabaseDdlRequest) returns (google.longrunning.Operation) {
149
+ // [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata].
150
+ // The operation has no response.
151
+ rpc UpdateDatabaseDdl(UpdateDatabaseDdlRequest)
152
+ returns (google.longrunning.Operation) {
150
153
  option (google.api.http) = {
151
154
  patch: "/v1/{database=projects/*/instances/*/databases/*}/ddl"
152
155
  body: "*"
@@ -187,7 +190,8 @@ service DatabaseAdmin {
187
190
  // permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
188
191
  // For backups, authorization requires `spanner.backups.setIamPolicy`
189
192
  // permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
190
- rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
193
+ rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest)
194
+ returns (google.iam.v1.Policy) {
191
195
  option (google.api.http) = {
192
196
  post: "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy"
193
197
  body: "*"
@@ -207,7 +211,8 @@ service DatabaseAdmin {
207
211
  // [resource][google.iam.v1.GetIamPolicyRequest.resource].
208
212
  // For backups, authorization requires `spanner.backups.getIamPolicy`
209
213
  // permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
210
- rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
214
+ rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest)
215
+ returns (google.iam.v1.Policy) {
211
216
  option (google.api.http) = {
212
217
  post: "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy"
213
218
  body: "*"
@@ -229,7 +234,8 @@ service DatabaseAdmin {
229
234
  // Calling this method on a backup that does not exist will
230
235
  // result in a NOT_FOUND error if the user has
231
236
  // `spanner.backups.list` permission on the containing instance.
232
- rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
237
+ rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest)
238
+ returns (google.iam.v1.TestIamPermissionsResponse) {
233
239
  option (google.api.http) = {
234
240
  post: "/v1/{resource=projects/*/instances/*/databases/*}:testIamPermissions"
235
241
  body: "*"
@@ -251,12 +257,12 @@ service DatabaseAdmin {
251
257
  // `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
252
258
  // and can be used to track creation of the backup. The
253
259
  // [metadata][google.longrunning.Operation.metadata] field type is
254
- // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
255
- // [response][google.longrunning.Operation.response] field type is
256
- // [Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
257
- // creation and delete the backup.
258
- // There can be only one pending backup creation per database. Backup creation
259
- // of different databases can run concurrently.
260
+ // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
261
+ // The [response][google.longrunning.Operation.response] field type is
262
+ // [Backup][google.spanner.admin.database.v1.Backup], if successful.
263
+ // Cancelling the returned operation will stop the creation and delete the
264
+ // backup. There can be only one pending backup creation per database. Backup
265
+ // creation of different databases can run concurrently.
260
266
  rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) {
261
267
  option (google.api.http) = {
262
268
  post: "/v1/{parent=projects/*/instances/*}/backups"
@@ -278,22 +284,25 @@ service DatabaseAdmin {
278
284
  // The [metadata][google.longrunning.Operation.metadata] field type is
279
285
  // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
280
286
  // The [response][google.longrunning.Operation.response] field type is
281
- // [Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
282
- // copying and delete the backup.
283
- // Concurrent CopyBackup requests can run on the same source backup.
287
+ // [Backup][google.spanner.admin.database.v1.Backup], if successful.
288
+ // Cancelling the returned operation will stop the copying and delete the
289
+ // destination backup. Concurrent CopyBackup requests can run on the same
290
+ // source backup.
284
291
  rpc CopyBackup(CopyBackupRequest) returns (google.longrunning.Operation) {
285
292
  option (google.api.http) = {
286
293
  post: "/v1/{parent=projects/*/instances/*}/backups:copy"
287
294
  body: "*"
288
295
  };
289
- option (google.api.method_signature) = "parent,backup_id,source_backup,expire_time";
296
+ option (google.api.method_signature) =
297
+ "parent,backup_id,source_backup,expire_time";
290
298
  option (google.longrunning.operation_info) = {
291
299
  response_type: "google.spanner.admin.database.v1.Backup"
292
300
  metadata_type: "google.spanner.admin.database.v1.CopyBackupMetadata"
293
301
  };
294
302
  }
295
303
 
296
- // Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
304
+ // Gets metadata on a pending or completed
305
+ // [Backup][google.spanner.admin.database.v1.Backup].
297
306
  rpc GetBackup(GetBackupRequest) returns (Backup) {
298
307
  option (google.api.http) = {
299
308
  get: "/v1/{name=projects/*/instances/*/backups/*}"
@@ -301,7 +310,8 @@ service DatabaseAdmin {
301
310
  option (google.api.method_signature) = "name";
302
311
  }
303
312
 
304
- // Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
313
+ // Updates a pending or completed
314
+ // [Backup][google.spanner.admin.database.v1.Backup].
305
315
  rpc UpdateBackup(UpdateBackupRequest) returns (Backup) {
306
316
  option (google.api.http) = {
307
317
  patch: "/v1/{backup.name=projects/*/instances/*/backups/*}"
@@ -310,7 +320,8 @@ service DatabaseAdmin {
310
320
  option (google.api.method_signature) = "backup,update_mask";
311
321
  }
312
322
 
313
- // Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
323
+ // Deletes a pending or completed
324
+ // [Backup][google.spanner.admin.database.v1.Backup].
314
325
  rpc DeleteBackup(DeleteBackupRequest) returns (google.protobuf.Empty) {
315
326
  option (google.api.http) = {
316
327
  delete: "/v1/{name=projects/*/instances/*/backups/*}"
@@ -345,7 +356,8 @@ service DatabaseAdmin {
345
356
  // Once the restore operation completes, a new restore operation can be
346
357
  // initiated, without waiting for the optimize operation associated with the
347
358
  // first restore to complete.
348
- rpc RestoreDatabase(RestoreDatabaseRequest) returns (google.longrunning.Operation) {
359
+ rpc RestoreDatabase(RestoreDatabaseRequest)
360
+ returns (google.longrunning.Operation) {
349
361
  option (google.api.http) = {
350
362
  post: "/v1/{parent=projects/*/instances/*}/databases:restore"
351
363
  body: "*"
@@ -365,7 +377,8 @@ service DatabaseAdmin {
365
377
  // `metadata.type_url` describes the type of the metadata. Operations returned
366
378
  // include those that have completed/failed/canceled within the last 7 days,
367
379
  // and pending operations.
368
- rpc ListDatabaseOperations(ListDatabaseOperationsRequest) returns (ListDatabaseOperationsResponse) {
380
+ rpc ListDatabaseOperations(ListDatabaseOperationsRequest)
381
+ returns (ListDatabaseOperationsResponse) {
369
382
  option (google.api.http) = {
370
383
  get: "/v1/{parent=projects/*/instances/*}/databaseOperations"
371
384
  };
@@ -382,7 +395,8 @@ service DatabaseAdmin {
382
395
  // and pending operations. Operations returned are ordered by
383
396
  // `operation.metadata.value.progress.start_time` in descending order starting
384
397
  // from the most recently started operation.
385
- rpc ListBackupOperations(ListBackupOperationsRequest) returns (ListBackupOperationsResponse) {
398
+ rpc ListBackupOperations(ListBackupOperationsRequest)
399
+ returns (ListBackupOperationsResponse) {
386
400
  option (google.api.http) = {
387
401
  get: "/v1/{parent=projects/*/instances/*}/backupOperations"
388
402
  };
@@ -390,7 +404,8 @@ service DatabaseAdmin {
390
404
  }
391
405
 
392
406
  // Lists Cloud Spanner database roles.
393
- rpc ListDatabaseRoles(ListDatabaseRolesRequest) returns (ListDatabaseRolesResponse) {
407
+ rpc ListDatabaseRoles(ListDatabaseRolesRequest)
408
+ returns (ListDatabaseRolesResponse) {
394
409
  option (google.api.http) = {
395
410
  get: "/v1/{parent=projects/*/instances/*/databases/*}/databaseRoles"
396
411
  };
@@ -452,7 +467,8 @@ message Database {
452
467
  State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
453
468
 
454
469
  // Output only. If exists, the time at which the database creation started.
455
- google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
470
+ google.protobuf.Timestamp create_time = 3
471
+ [(google.api.field_behavior) = OUTPUT_ONLY];
456
472
 
457
473
  // Output only. Applicable only for restored databases. Contains information
458
474
  // about the restore source.
@@ -462,32 +478,37 @@ message Database {
462
478
  // field contains the encryption configuration for the database.
463
479
  // For databases that are using Google default or other types of encryption,
464
480
  // this field is empty.
465
- EncryptionConfig encryption_config = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
481
+ EncryptionConfig encryption_config = 5
482
+ [(google.api.field_behavior) = OUTPUT_ONLY];
466
483
 
467
484
  // Output only. For databases that are using customer managed encryption, this
468
485
  // field contains the encryption information for the database, such as
469
- // encryption state and the Cloud KMS key versions that are in use.
486
+ // all Cloud KMS key versions that are in use. The `encryption_status' field
487
+ // inside of each `EncryptionInfo` is not populated.
470
488
  //
471
489
  // For databases that are using Google default or other types of encryption,
472
490
  // this field is empty.
473
491
  //
474
492
  // This field is propagated lazily from the backend. There might be a delay
475
493
  // from when a key version is being used and when it appears in this field.
476
- repeated EncryptionInfo encryption_info = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
494
+ repeated EncryptionInfo encryption_info = 8
495
+ [(google.api.field_behavior) = OUTPUT_ONLY];
477
496
 
478
497
  // Output only. The period in which Cloud Spanner retains all versions of data
479
498
  // for the database. This is the same as the value of version_retention_period
480
499
  // database option set using
481
- // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. Defaults to 1 hour,
482
- // if not set.
483
- string version_retention_period = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
500
+ // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl].
501
+ // Defaults to 1 hour, if not set.
502
+ string version_retention_period = 6
503
+ [(google.api.field_behavior) = OUTPUT_ONLY];
484
504
 
485
505
  // Output only. Earliest timestamp at which older versions of the data can be
486
506
  // read. This value is continuously updated by Cloud Spanner and becomes stale
487
507
  // the moment it is queried. If you are using this value to recover data, make
488
508
  // sure to account for the time from the moment when the value is queried to
489
509
  // the moment when you initiate the recovery.
490
- google.protobuf.Timestamp earliest_version_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
510
+ google.protobuf.Timestamp earliest_version_time = 7
511
+ [(google.api.field_behavior) = OUTPUT_ONLY];
491
512
 
492
513
  // Output only. The read-write region which contains the database's leader
493
514
  // replicas.
@@ -498,10 +519,13 @@ message Database {
498
519
  string default_leader = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
499
520
 
500
521
  // Output only. The dialect of the Cloud Spanner Database.
501
- DatabaseDialect database_dialect = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
522
+ DatabaseDialect database_dialect = 10
523
+ [(google.api.field_behavior) = OUTPUT_ONLY];
502
524
 
503
525
  // Whether drop protection is enabled for this database. Defaults to false,
504
- // if not set.
526
+ // if not set. For more details, please see how to [prevent accidental
527
+ // database
528
+ // deletion](https://cloud.google.com/spanner/docs/prevent-database-deletion).
505
529
  bool enable_drop_protection = 11;
506
530
 
507
531
  // Output only. If true, the database is being updated. If false, there are no
@@ -509,7 +533,8 @@ message Database {
509
533
  bool reconciling = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
510
534
  }
511
535
 
512
- // The request for [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases].
536
+ // The request for
537
+ // [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases].
513
538
  message ListDatabasesRequest {
514
539
  // Required. The instance whose databases should be listed.
515
540
  // Values are of the form `projects/<project>/instances/<instance>`.
@@ -525,23 +550,26 @@ message ListDatabasesRequest {
525
550
  int32 page_size = 3;
526
551
 
527
552
  // If non-empty, `page_token` should contain a
528
- // [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] from a
529
- // previous [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse].
553
+ // [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token]
554
+ // from a previous
555
+ // [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse].
530
556
  string page_token = 4;
531
557
  }
532
558
 
533
- // The response for [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases].
559
+ // The response for
560
+ // [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases].
534
561
  message ListDatabasesResponse {
535
562
  // Databases that matched the request.
536
563
  repeated Database databases = 1;
537
564
 
538
565
  // `next_page_token` can be sent in a subsequent
539
- // [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] call to fetch more
540
- // of the matching databases.
566
+ // [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]
567
+ // call to fetch more of the matching databases.
541
568
  string next_page_token = 2;
542
569
  }
543
570
 
544
- // The request for [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase].
571
+ // The request for
572
+ // [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase].
545
573
  message CreateDatabaseRequest {
546
574
  // Required. The name of the instance that will serve the new database.
547
575
  // Values are of the form `projects/<project>/instances/<instance>`.
@@ -565,10 +593,11 @@ message CreateDatabaseRequest {
565
593
  // if there is an error in any statement, the database is not created.
566
594
  repeated string extra_statements = 3 [(google.api.field_behavior) = OPTIONAL];
567
595
 
568
- // Optional. The encryption configuration for the database. If this field is not
569
- // specified, Cloud Spanner will encrypt/decrypt all data at rest using
596
+ // Optional. The encryption configuration for the database. If this field is
597
+ // not specified, Cloud Spanner will encrypt/decrypt all data at rest using
570
598
  // Google default encryption.
571
- EncryptionConfig encryption_config = 4 [(google.api.field_behavior) = OPTIONAL];
599
+ EncryptionConfig encryption_config = 4
600
+ [(google.api.field_behavior) = OPTIONAL];
572
601
 
573
602
  // Optional. The dialect of the Cloud Spanner Database.
574
603
  DatabaseDialect database_dialect = 5 [(google.api.field_behavior) = OPTIONAL];
@@ -596,11 +625,12 @@ message CreateDatabaseRequest {
596
625
  message CreateDatabaseMetadata {
597
626
  // The database being created.
598
627
  string database = 1 [(google.api.resource_reference) = {
599
- type: "spanner.googleapis.com/Database"
600
- }];
628
+ type: "spanner.googleapis.com/Database"
629
+ }];
601
630
  }
602
631
 
603
- // The request for [GetDatabase][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase].
632
+ // The request for
633
+ // [GetDatabase][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase].
604
634
  message GetDatabaseRequest {
605
635
  // Required. The name of the requested database. Values are of the form
606
636
  // `projects/<project>/instances/<instance>/databases/<database>`.
@@ -657,8 +687,8 @@ message UpdateDatabaseMetadata {
657
687
  // Each batch of statements is assigned a name which can be used with
658
688
  // the [Operations][google.longrunning.Operations] API to monitor
659
689
  // progress. See the
660
- // [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id] field for more
661
- // details.
690
+ // [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id]
691
+ // field for more details.
662
692
  message UpdateDatabaseDdlRequest {
663
693
  // Required. The database to update.
664
694
  string database = 1 [
@@ -678,18 +708,20 @@ message UpdateDatabaseDdlRequest {
678
708
  //
679
709
  // Specifying an explicit operation ID simplifies determining
680
710
  // whether the statements were executed in the event that the
681
- // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed,
682
- // or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and
683
- // `operation_id` fields can be combined to form the
711
+ // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]
712
+ // call is replayed, or the return value is otherwise lost: the
713
+ // [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database]
714
+ // and `operation_id` fields can be combined to form the
684
715
  // [name][google.longrunning.Operation.name] of the resulting
685
- // [longrunning.Operation][google.longrunning.Operation]: `<database>/operations/<operation_id>`.
716
+ // [longrunning.Operation][google.longrunning.Operation]:
717
+ // `<database>/operations/<operation_id>`.
686
718
  //
687
719
  // `operation_id` should be unique within the database, and must be
688
720
  // a valid identifier: `[a-z][a-z0-9_]*`. Note that
689
721
  // automatically-generated operation IDs always begin with an
690
722
  // underscore. If the named operation already exists,
691
- // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns
692
- // `ALREADY_EXISTS`.
723
+ // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]
724
+ // returns `ALREADY_EXISTS`.
693
725
  string operation_id = 3;
694
726
 
695
727
  // Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements.
@@ -735,8 +767,8 @@ message DdlStatementActionInfo {
735
767
  message UpdateDatabaseDdlMetadata {
736
768
  // The database being modified.
737
769
  string database = 1 [(google.api.resource_reference) = {
738
- type: "spanner.googleapis.com/Database"
739
- }];
770
+ type: "spanner.googleapis.com/Database"
771
+ }];
740
772
 
741
773
  // For an update this list contains all the statements. For an
742
774
  // individual statement, this list contains only that statement.
@@ -766,7 +798,8 @@ message UpdateDatabaseDdlMetadata {
766
798
  repeated DdlStatementActionInfo actions = 6;
767
799
  }
768
800
 
769
- // The request for [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase].
801
+ // The request for
802
+ // [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase].
770
803
  message DropDatabaseRequest {
771
804
  // Required. The database to be dropped.
772
805
  string database = 1 [
@@ -777,7 +810,8 @@ message DropDatabaseRequest {
777
810
  ];
778
811
  }
779
812
 
780
- // The request for [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl].
813
+ // The request for
814
+ // [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl].
781
815
  message GetDatabaseDdlRequest {
782
816
  // Required. The database whose schema we wish to get.
783
817
  // Values are of the form
@@ -790,7 +824,8 @@ message GetDatabaseDdlRequest {
790
824
  ];
791
825
  }
792
826
 
793
- // The response for [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl].
827
+ // The response for
828
+ // [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl].
794
829
  message GetDatabaseDdlResponse {
795
830
  // A list of formatted DDL statements defining the schema of the database
796
831
  // specified in the request.
@@ -830,7 +865,9 @@ message ListDatabaseOperationsRequest {
830
865
  // * `name` - The name of the long-running operation
831
866
  // * `done` - False if the operation is in progress, else true.
832
867
  // * `metadata.@type` - the type of metadata. For example, the type string
833
- // for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] is
868
+ // for
869
+ // [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]
870
+ // is
834
871
  // `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
835
872
  // * `metadata.<field_name>` - any field in metadata.value.
836
873
  // `metadata.@type` must be specified first, if filtering on metadata
@@ -852,7 +889,8 @@ message ListDatabaseOperationsRequest {
852
889
  // `(metadata.name:restored_howl) AND` \
853
890
  // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
854
891
  // `(error:*)` - Return operations where:
855
- // * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
892
+ // * The operation's metadata type is
893
+ // [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
856
894
  // * The database is restored from a backup.
857
895
  // * The backup name contains "backup_howl".
858
896
  // * The restored database's name contains "restored_howl".
@@ -866,8 +904,9 @@ message ListDatabaseOperationsRequest {
866
904
 
867
905
  // If non-empty, `page_token` should contain a
868
906
  // [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token]
869
- // from a previous [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] to the
870
- // same `parent` and with the same `filter`.
907
+ // from a previous
908
+ // [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse]
909
+ // to the same `parent` and with the same `filter`.
871
910
  string page_token = 4;
872
911
  }
873
912
 
@@ -913,17 +952,18 @@ message RestoreDatabaseRequest {
913
952
  // Name of the backup from which to restore. Values are of the form
914
953
  // `projects/<project>/instances/<instance>/backups/<backup>`.
915
954
  string backup = 3 [(google.api.resource_reference) = {
916
- type: "spanner.googleapis.com/Backup"
917
- }];
955
+ type: "spanner.googleapis.com/Backup"
956
+ }];
918
957
  }
919
958
 
920
- // Optional. An encryption configuration describing the encryption type and key
921
- // resources in Cloud KMS used to encrypt/decrypt the database to restore to.
922
- // If this field is not specified, the restored database will use
923
- // the same encryption configuration as the backup by default, namely
924
- // [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] =
925
- // `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
926
- RestoreDatabaseEncryptionConfig encryption_config = 4 [(google.api.field_behavior) = OPTIONAL];
959
+ // Optional. An encryption configuration describing the encryption type and
960
+ // key resources in Cloud KMS used to encrypt/decrypt the database to restore
961
+ // to. If this field is not specified, the restored database will use the same
962
+ // encryption configuration as the backup by default, namely
963
+ // [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type]
964
+ // = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
965
+ RestoreDatabaseEncryptionConfig encryption_config = 4
966
+ [(google.api.field_behavior) = OPTIONAL];
927
967
  }
928
968
 
929
969
  // Encryption configuration for the restored database.
@@ -934,7 +974,8 @@ message RestoreDatabaseEncryptionConfig {
934
974
  ENCRYPTION_TYPE_UNSPECIFIED = 0;
935
975
 
936
976
  // This is the default option when
937
- // [encryption_config][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig] is not specified.
977
+ // [encryption_config][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig]
978
+ // is not specified.
938
979
  USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1;
939
980
 
940
981
  // Use Google default encryption.
@@ -948,10 +989,10 @@ message RestoreDatabaseEncryptionConfig {
948
989
  // Required. The encryption type of the restored database.
949
990
  EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED];
950
991
 
951
- // Optional. The Cloud KMS key that will be used to encrypt/decrypt the restored
952
- // database. This field should be set only when
953
- // [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] is
954
- // `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
992
+ // Optional. The Cloud KMS key that will be used to encrypt/decrypt the
993
+ // restored database. This field should be set only when
994
+ // [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type]
995
+ // is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
955
996
  // `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
956
997
  string kms_key_name = 2 [
957
998
  (google.api.field_behavior) = OPTIONAL,
@@ -959,6 +1000,28 @@ message RestoreDatabaseEncryptionConfig {
959
1000
  type: "cloudkms.googleapis.com/CryptoKey"
960
1001
  }
961
1002
  ];
1003
+
1004
+ // Optional. Specifies the KMS configuration for the one or more keys used to
1005
+ // encrypt the database. Values are of the form
1006
+ // `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
1007
+ //
1008
+ // The keys referenced by kms_key_names must fully cover all
1009
+ // regions of the database instance configuration. Some examples:
1010
+ // * For single region database instance configs, specify a single regional
1011
+ // location KMS key.
1012
+ // * For multi-regional database instance configs of type GOOGLE_MANAGED,
1013
+ // either specify a multi-regional location KMS key or multiple regional
1014
+ // location KMS keys that cover all regions in the instance config.
1015
+ // * For a database instance config of type USER_MANAGED, please specify only
1016
+ // regional location KMS keys to cover each region in the instance config.
1017
+ // Multi-regional location KMS keys are not supported for USER_MANAGED
1018
+ // instance configs.
1019
+ repeated string kms_key_names = 3 [
1020
+ (google.api.field_behavior) = OPTIONAL,
1021
+ (google.api.resource_reference) = {
1022
+ type: "cloudkms.googleapis.com/CryptoKey"
1023
+ }
1024
+ ];
962
1025
  }
963
1026
 
964
1027
  // Metadata type for the long-running operation returned by
@@ -966,14 +1029,15 @@ message RestoreDatabaseEncryptionConfig {
966
1029
  message RestoreDatabaseMetadata {
967
1030
  // Name of the database being created and restored to.
968
1031
  string name = 1 [(google.api.resource_reference) = {
969
- type: "spanner.googleapis.com/Database"
970
- }];
1032
+ type: "spanner.googleapis.com/Database"
1033
+ }];
971
1034
 
972
1035
  // The type of the restore source.
973
1036
  RestoreSourceType source_type = 2;
974
1037
 
975
1038
  // Information about the source used to restore the database, as specified by
976
- // `source` in [RestoreDatabaseRequest][google.spanner.admin.database.v1.RestoreDatabaseRequest].
1039
+ // `source` in
1040
+ // [RestoreDatabaseRequest][google.spanner.admin.database.v1.RestoreDatabaseRequest].
977
1041
  oneof source_info {
978
1042
  // Information about the backup used to restore the database.
979
1043
  BackupInfo backup_info = 3;
@@ -994,7 +1058,8 @@ message RestoreDatabaseMetadata {
994
1058
  // operation completed despite cancellation. On successful cancellation,
995
1059
  // the operation is not deleted; instead, it becomes an operation with
996
1060
  // an [Operation.error][google.longrunning.Operation.error] value with a
997
- // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`.
1061
+ // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
1062
+ // `Code.CANCELLED`.
998
1063
  google.protobuf.Timestamp cancel_time = 5;
999
1064
 
1000
1065
  // If exists, the name of the long-running operation that will be used to
@@ -1004,10 +1069,10 @@ message RestoreDatabaseMetadata {
1004
1069
  // `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`
1005
1070
  // where the <database> is the name of database being created and restored to.
1006
1071
  // The metadata type of the long-running operation is
1007
- // [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. This long-running operation will be
1008
- // automatically created by the system after the RestoreDatabase long-running
1009
- // operation completes successfully. This operation will not be created if the
1010
- // restore was not successful.
1072
+ // [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata].
1073
+ // This long-running operation will be automatically created by the system
1074
+ // after the RestoreDatabase long-running operation completes successfully.
1075
+ // This operation will not be created if the restore was not successful.
1011
1076
  string optimize_database_operation_name = 6;
1012
1077
  }
1013
1078
 
@@ -1018,8 +1083,8 @@ message RestoreDatabaseMetadata {
1018
1083
  message OptimizeRestoredDatabaseMetadata {
1019
1084
  // Name of the restored database being optimized.
1020
1085
  string name = 1 [(google.api.resource_reference) = {
1021
- type: "spanner.googleapis.com/Database"
1022
- }];
1086
+ type: "spanner.googleapis.com/Database"
1087
+ }];
1023
1088
 
1024
1089
  // The progress of the post-restore optimizations.
1025
1090
  OperationProgress progress = 2;
@@ -1042,18 +1107,17 @@ message DatabaseRole {
1042
1107
  };
1043
1108
 
1044
1109
  // Required. The name of the database role. Values are of the form
1045
- // `projects/<project>/instances/<instance>/databases/<database>/databaseRoles/
1046
- // {role}`, where `<role>` is as specified in the `CREATE ROLE`
1047
- // DDL statement. This name can be passed to Get/Set IAMPolicy methods to
1048
- // identify the database role.
1110
+ // `projects/<project>/instances/<instance>/databases/<database>/databaseRoles/<role>`
1111
+ // where `<role>` is as specified in the `CREATE ROLE` DDL statement.
1049
1112
  string name = 1 [(google.api.field_behavior) = REQUIRED];
1050
1113
  }
1051
1114
 
1052
- // The request for [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles].
1115
+ // The request for
1116
+ // [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles].
1053
1117
  message ListDatabaseRolesRequest {
1054
1118
  // Required. The database whose roles should be listed.
1055
1119
  // Values are of the form
1056
- // `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
1120
+ // `projects/<project>/instances/<instance>/databases/<database>`.
1057
1121
  string parent = 1 [
1058
1122
  (google.api.field_behavior) = REQUIRED,
1059
1123
  (google.api.resource_reference) = {
@@ -1066,12 +1130,14 @@ message ListDatabaseRolesRequest {
1066
1130
  int32 page_size = 2;
1067
1131
 
1068
1132
  // If non-empty, `page_token` should contain a
1069
- // [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token] from a
1070
- // previous [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse].
1133
+ // [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token]
1134
+ // from a previous
1135
+ // [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse].
1071
1136
  string page_token = 3;
1072
1137
  }
1073
1138
 
1074
- // The response for [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles].
1139
+ // The response for
1140
+ // [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles].
1075
1141
  message ListDatabaseRolesResponse {
1076
1142
  // Database roles that matched the request.
1077
1143
  repeated DatabaseRole database_roles = 1;
@@ -1,4 +1,4 @@
1
- // Copyright 2023 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.
@@ -1,4 +1,4 @@
1
- // Copyright 2023 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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.