@google-cloud/spanner 7.17.1 → 7.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.json +1 -1
  3. package/build/protos/google/spanner/admin/database/v1/backup.proto +0 -757
  4. package/build/protos/google/spanner/admin/database/v1/backup_schedule.proto +0 -230
  5. package/build/protos/google/spanner/admin/database/v1/common.proto +0 -132
  6. package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +0 -1209
  7. package/build/protos/google/spanner/admin/instance/v1/common.proto +0 -63
  8. package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +0 -1983
  9. package/build/protos/google/spanner/executor/v1/cloud_executor.proto +0 -1520
  10. package/build/protos/google/spanner/v1/commit_response.proto +0 -59
  11. package/build/protos/google/spanner/v1/keys.proto +0 -163
  12. package/build/protos/google/spanner/v1/mutation.proto +0 -107
  13. package/build/protos/google/spanner/v1/query_plan.proto +0 -128
  14. package/build/protos/google/spanner/v1/result_set.proto +0 -237
  15. package/build/protos/google/spanner/v1/spanner.proto +0 -1389
  16. package/build/protos/google/spanner/v1/transaction.proto +0 -575
  17. package/build/protos/google/spanner/v1/type.proto +0 -210
  18. package/build/protos/protos.d.ts +0 -38999
  19. package/build/protos/protos.js +0 -99538
  20. package/build/protos/protos.json +0 -10182
  21. package/build/src/backup.d.ts +0 -349
  22. package/build/src/backup.js +0 -246
  23. package/build/src/batch-transaction.d.ts +0 -247
  24. package/build/src/batch-transaction.js +0 -384
  25. package/build/src/codec.d.ts +0 -362
  26. package/build/src/codec.js +0 -791
  27. package/build/src/common-grpc/service-object.d.ts +0 -80
  28. package/build/src/common-grpc/service-object.js +0 -101
  29. package/build/src/common-grpc/service.d.ts +0 -445
  30. package/build/src/common-grpc/service.js +0 -826
  31. package/build/src/common.d.ts +0 -66
  32. package/build/src/common.js +0 -54
  33. package/build/src/database.d.ts +0 -2104
  34. package/build/src/database.js +0 -1655
  35. package/build/src/extra_proto_list.json +0 -1
  36. package/build/src/helper.d.ts +0 -45
  37. package/build/src/helper.js +0 -71
  38. package/build/src/index.d.ts +0 -1195
  39. package/build/src/index.js +0 -1059
  40. package/build/src/instance-config.d.ts +0 -295
  41. package/build/src/instance-config.js +0 -216
  42. package/build/src/instance.d.ts +0 -833
  43. package/build/src/instance.js +0 -781
  44. package/build/src/instrument.d.ts +0 -85
  45. package/build/src/instrument.js +0 -212
  46. package/build/src/multiplexed-session.d.ts +0 -136
  47. package/build/src/multiplexed-session.js +0 -197
  48. package/build/src/partial-result-stream.d.ts +0 -253
  49. package/build/src/partial-result-stream.js +0 -400
  50. package/build/src/session-factory.d.ts +0 -101
  51. package/build/src/session-factory.js +0 -93
  52. package/build/src/session-pool.d.ts +0 -471
  53. package/build/src/session-pool.js +0 -754
  54. package/build/src/session.d.ts +0 -259
  55. package/build/src/session.js +0 -348
  56. package/build/src/spanner_grpc_config.json +0 -92
  57. package/build/src/table.d.ts +0 -831
  58. package/build/src/table.js +0 -277
  59. package/build/src/transaction-runner.d.ts +0 -185
  60. package/build/src/transaction-runner.js +0 -282
  61. package/build/src/transaction.d.ts +0 -1691
  62. package/build/src/transaction.js +0 -2004
  63. package/build/src/v1/database_admin_client.d.ts +0 -2301
  64. package/build/src/v1/database_admin_client.js +0 -2286
  65. package/build/src/v1/database_admin_client_config.json +0 -160
  66. package/build/src/v1/database_admin_proto_list.json +0 -6
  67. package/build/src/v1/gapic_metadata.json +0 -27
  68. package/build/src/v1/index.d.ts +0 -4
  69. package/build/src/v1/index.js +0 -29
  70. package/build/src/v1/instance_admin_client.d.ts +0 -1982
  71. package/build/src/v1/instance_admin_client.js +0 -1766
  72. package/build/src/v1/instance_admin_client_config.json +0 -129
  73. package/build/src/v1/instance_admin_proto_list.json +0 -4
  74. package/build/src/v1/spanner_client.d.ts +0 -1250
  75. package/build/src/v1/spanner_client.js +0 -1086
  76. package/build/src/v1/spanner_client_config.json +0 -119
  77. package/build/src/v1/spanner_executor_proxy_client.d.ts +0 -418
  78. package/build/src/v1/spanner_executor_proxy_client.js +0 -706
  79. package/build/src/v1/spanner_executor_proxy_client_config.json +0 -30
  80. package/build/src/v1/spanner_executor_proxy_proto_list.json +0 -14
  81. package/build/src/v1/spanner_proto_list.json +0 -10
@@ -1,1209 +0,0 @@
1
- // Copyright 2024 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/annotations.proto";
20
- import "google/api/client.proto";
21
- import "google/api/field_behavior.proto";
22
- import "google/api/resource.proto";
23
- import "google/iam/v1/iam_policy.proto";
24
- import "google/iam/v1/policy.proto";
25
- import "google/longrunning/operations.proto";
26
- import "google/protobuf/empty.proto";
27
- import "google/protobuf/field_mask.proto";
28
- import "google/protobuf/timestamp.proto";
29
- import "google/spanner/admin/database/v1/backup.proto";
30
- import "google/spanner/admin/database/v1/backup_schedule.proto";
31
- import "google/spanner/admin/database/v1/common.proto";
32
-
33
- option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1";
34
- option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb";
35
- option java_multiple_files = true;
36
- option java_outer_classname = "SpannerDatabaseAdminProto";
37
- option java_package = "com.google.spanner.admin.database.v1";
38
- option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1";
39
- option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1";
40
- option (google.api.resource_definition) = {
41
- type: "spanner.googleapis.com/Instance"
42
- pattern: "projects/{project}/instances/{instance}"
43
- };
44
-
45
- // Cloud Spanner Database Admin API
46
- //
47
- // The Cloud Spanner Database Admin API can be used to:
48
- // * create, drop, and list databases
49
- // * update the schema of pre-existing databases
50
- // * create, delete, copy and list backups for a database
51
- // * restore a database from an existing backup
52
- service DatabaseAdmin {
53
- option (google.api.default_host) = "spanner.googleapis.com";
54
- option (google.api.oauth_scopes) =
55
- "https://www.googleapis.com/auth/cloud-platform,"
56
- "https://www.googleapis.com/auth/spanner.admin";
57
-
58
- // Lists Cloud Spanner databases.
59
- rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse) {
60
- option (google.api.http) = {
61
- get: "/v1/{parent=projects/*/instances/*}/databases"
62
- };
63
- option (google.api.method_signature) = "parent";
64
- }
65
-
66
- // Creates a new Cloud Spanner database and starts to prepare it for serving.
67
- // The returned [long-running operation][google.longrunning.Operation] will
68
- // have a name of the format `<database_name>/operations/<operation_id>` and
69
- // can be used to track preparation of the database. The
70
- // [metadata][google.longrunning.Operation.metadata] field type is
71
- // [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata].
72
- // The [response][google.longrunning.Operation.response] field type is
73
- // [Database][google.spanner.admin.database.v1.Database], if successful.
74
- rpc CreateDatabase(CreateDatabaseRequest)
75
- returns (google.longrunning.Operation) {
76
- option (google.api.http) = {
77
- post: "/v1/{parent=projects/*/instances/*}/databases"
78
- body: "*"
79
- };
80
- option (google.api.method_signature) = "parent,create_statement";
81
- option (google.longrunning.operation_info) = {
82
- response_type: "google.spanner.admin.database.v1.Database"
83
- metadata_type: "google.spanner.admin.database.v1.CreateDatabaseMetadata"
84
- };
85
- }
86
-
87
- // Gets the state of a Cloud Spanner database.
88
- rpc GetDatabase(GetDatabaseRequest) returns (Database) {
89
- option (google.api.http) = {
90
- get: "/v1/{name=projects/*/instances/*/databases/*}"
91
- };
92
- option (google.api.method_signature) = "name";
93
- }
94
-
95
- // Updates a Cloud Spanner database. The returned
96
- // [long-running operation][google.longrunning.Operation] can be used to track
97
- // the progress of updating the database. If the named database does not
98
- // exist, returns `NOT_FOUND`.
99
- //
100
- // While the operation is pending:
101
- //
102
- // * The database's
103
- // [reconciling][google.spanner.admin.database.v1.Database.reconciling]
104
- // field is set to true.
105
- // * Cancelling the operation is best-effort. If the cancellation succeeds,
106
- // the operation metadata's
107
- // [cancel_time][google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time]
108
- // is set, the updates are reverted, and the operation terminates with a
109
- // `CANCELLED` status.
110
- // * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error
111
- // until the pending operation is done (returns successfully or with
112
- // error).
113
- // * Reading the database via the API continues to give the pre-request
114
- // values.
115
- //
116
- // Upon completion of the returned operation:
117
- //
118
- // * The new values are in effect and readable via the API.
119
- // * The database's
120
- // [reconciling][google.spanner.admin.database.v1.Database.reconciling]
121
- // field becomes false.
122
- //
123
- // The returned [long-running operation][google.longrunning.Operation] will
124
- // have a name of the format
125
- // `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`
126
- // and can be used to track the database modification. The
127
- // [metadata][google.longrunning.Operation.metadata] field type is
128
- // [UpdateDatabaseMetadata][google.spanner.admin.database.v1.UpdateDatabaseMetadata].
129
- // The [response][google.longrunning.Operation.response] field type is
130
- // [Database][google.spanner.admin.database.v1.Database], if successful.
131
- rpc UpdateDatabase(UpdateDatabaseRequest)
132
- returns (google.longrunning.Operation) {
133
- option (google.api.http) = {
134
- patch: "/v1/{database.name=projects/*/instances/*/databases/*}"
135
- body: "database"
136
- };
137
- option (google.api.method_signature) = "database,update_mask";
138
- option (google.longrunning.operation_info) = {
139
- response_type: "Database"
140
- metadata_type: "UpdateDatabaseMetadata"
141
- };
142
- }
143
-
144
- // Updates the schema of a Cloud Spanner database by
145
- // creating/altering/dropping tables, columns, indexes, etc. The returned
146
- // [long-running operation][google.longrunning.Operation] will have a name of
147
- // the format `<database_name>/operations/<operation_id>` and can be used to
148
- // track execution of the schema change(s). The
149
- // [metadata][google.longrunning.Operation.metadata] field type is
150
- // [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata].
151
- // The operation has no response.
152
- rpc UpdateDatabaseDdl(UpdateDatabaseDdlRequest)
153
- returns (google.longrunning.Operation) {
154
- option (google.api.http) = {
155
- patch: "/v1/{database=projects/*/instances/*/databases/*}/ddl"
156
- body: "*"
157
- };
158
- option (google.api.method_signature) = "database,statements";
159
- option (google.longrunning.operation_info) = {
160
- response_type: "google.protobuf.Empty"
161
- metadata_type: "google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata"
162
- };
163
- }
164
-
165
- // Drops (aka deletes) a Cloud Spanner database.
166
- // Completed backups for the database will be retained according to their
167
- // `expire_time`.
168
- // Note: Cloud Spanner might continue to accept requests for a few seconds
169
- // after the database has been deleted.
170
- rpc DropDatabase(DropDatabaseRequest) returns (google.protobuf.Empty) {
171
- option (google.api.http) = {
172
- delete: "/v1/{database=projects/*/instances/*/databases/*}"
173
- };
174
- option (google.api.method_signature) = "database";
175
- }
176
-
177
- // Returns the schema of a Cloud Spanner database as a list of formatted
178
- // DDL statements. This method does not show pending schema updates, those may
179
- // be queried using the [Operations][google.longrunning.Operations] API.
180
- rpc GetDatabaseDdl(GetDatabaseDdlRequest) returns (GetDatabaseDdlResponse) {
181
- option (google.api.http) = {
182
- get: "/v1/{database=projects/*/instances/*/databases/*}/ddl"
183
- };
184
- option (google.api.method_signature) = "database";
185
- }
186
-
187
- // Sets the access control policy on a database or backup resource.
188
- // Replaces any existing policy.
189
- //
190
- // Authorization requires `spanner.databases.setIamPolicy`
191
- // permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
192
- // For backups, authorization requires `spanner.backups.setIamPolicy`
193
- // permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
194
- rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest)
195
- returns (google.iam.v1.Policy) {
196
- option (google.api.http) = {
197
- post: "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy"
198
- body: "*"
199
- additional_bindings {
200
- post: "/v1/{resource=projects/*/instances/*/backups/*}:setIamPolicy"
201
- body: "*"
202
- }
203
- additional_bindings {
204
- post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:setIamPolicy"
205
- body: "*"
206
- }
207
- };
208
- option (google.api.method_signature) = "resource,policy";
209
- }
210
-
211
- // Gets the access control policy for a database or backup resource.
212
- // Returns an empty policy if a database or backup exists but does not have a
213
- // policy set.
214
- //
215
- // Authorization requires `spanner.databases.getIamPolicy` permission on
216
- // [resource][google.iam.v1.GetIamPolicyRequest.resource].
217
- // For backups, authorization requires `spanner.backups.getIamPolicy`
218
- // permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
219
- rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest)
220
- returns (google.iam.v1.Policy) {
221
- option (google.api.http) = {
222
- post: "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy"
223
- body: "*"
224
- additional_bindings {
225
- post: "/v1/{resource=projects/*/instances/*/backups/*}:getIamPolicy"
226
- body: "*"
227
- }
228
- additional_bindings {
229
- post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:getIamPolicy"
230
- body: "*"
231
- }
232
- };
233
- option (google.api.method_signature) = "resource";
234
- }
235
-
236
- // Returns permissions that the caller has on the specified database or backup
237
- // resource.
238
- //
239
- // Attempting this RPC on a non-existent Cloud Spanner database will
240
- // result in a NOT_FOUND error if the user has
241
- // `spanner.databases.list` permission on the containing Cloud
242
- // Spanner instance. Otherwise returns an empty set of permissions.
243
- // Calling this method on a backup that does not exist will
244
- // result in a NOT_FOUND error if the user has
245
- // `spanner.backups.list` permission on the containing instance.
246
- rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest)
247
- returns (google.iam.v1.TestIamPermissionsResponse) {
248
- option (google.api.http) = {
249
- post: "/v1/{resource=projects/*/instances/*/databases/*}:testIamPermissions"
250
- body: "*"
251
- additional_bindings {
252
- post: "/v1/{resource=projects/*/instances/*/backups/*}:testIamPermissions"
253
- body: "*"
254
- }
255
- additional_bindings {
256
- post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:testIamPermissions"
257
- body: "*"
258
- }
259
- additional_bindings {
260
- post: "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions"
261
- body: "*"
262
- }
263
- };
264
- option (google.api.method_signature) = "resource,permissions";
265
- }
266
-
267
- // Starts creating a new Cloud Spanner Backup.
268
- // The returned backup [long-running operation][google.longrunning.Operation]
269
- // will have a name of the format
270
- // `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
271
- // and can be used to track creation of the backup. The
272
- // [metadata][google.longrunning.Operation.metadata] field type is
273
- // [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
274
- // The [response][google.longrunning.Operation.response] field type is
275
- // [Backup][google.spanner.admin.database.v1.Backup], if successful.
276
- // Cancelling the returned operation will stop the creation and delete the
277
- // backup. There can be only one pending backup creation per database. Backup
278
- // creation of different databases can run concurrently.
279
- rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) {
280
- option (google.api.http) = {
281
- post: "/v1/{parent=projects/*/instances/*}/backups"
282
- body: "backup"
283
- };
284
- option (google.api.method_signature) = "parent,backup,backup_id";
285
- option (google.longrunning.operation_info) = {
286
- response_type: "google.spanner.admin.database.v1.Backup"
287
- metadata_type: "google.spanner.admin.database.v1.CreateBackupMetadata"
288
- };
289
- }
290
-
291
- // Starts copying a Cloud Spanner Backup.
292
- // The returned backup [long-running operation][google.longrunning.Operation]
293
- // will have a name of the format
294
- // `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
295
- // and can be used to track copying of the backup. The operation is associated
296
- // with the destination backup.
297
- // The [metadata][google.longrunning.Operation.metadata] field type is
298
- // [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
299
- // The [response][google.longrunning.Operation.response] field type is
300
- // [Backup][google.spanner.admin.database.v1.Backup], if successful.
301
- // Cancelling the returned operation will stop the copying and delete the
302
- // destination backup. Concurrent CopyBackup requests can run on the same
303
- // source backup.
304
- rpc CopyBackup(CopyBackupRequest) returns (google.longrunning.Operation) {
305
- option (google.api.http) = {
306
- post: "/v1/{parent=projects/*/instances/*}/backups:copy"
307
- body: "*"
308
- };
309
- option (google.api.method_signature) =
310
- "parent,backup_id,source_backup,expire_time";
311
- option (google.longrunning.operation_info) = {
312
- response_type: "google.spanner.admin.database.v1.Backup"
313
- metadata_type: "google.spanner.admin.database.v1.CopyBackupMetadata"
314
- };
315
- }
316
-
317
- // Gets metadata on a pending or completed
318
- // [Backup][google.spanner.admin.database.v1.Backup].
319
- rpc GetBackup(GetBackupRequest) returns (Backup) {
320
- option (google.api.http) = {
321
- get: "/v1/{name=projects/*/instances/*/backups/*}"
322
- };
323
- option (google.api.method_signature) = "name";
324
- }
325
-
326
- // Updates a pending or completed
327
- // [Backup][google.spanner.admin.database.v1.Backup].
328
- rpc UpdateBackup(UpdateBackupRequest) returns (Backup) {
329
- option (google.api.http) = {
330
- patch: "/v1/{backup.name=projects/*/instances/*/backups/*}"
331
- body: "backup"
332
- };
333
- option (google.api.method_signature) = "backup,update_mask";
334
- }
335
-
336
- // Deletes a pending or completed
337
- // [Backup][google.spanner.admin.database.v1.Backup].
338
- rpc DeleteBackup(DeleteBackupRequest) returns (google.protobuf.Empty) {
339
- option (google.api.http) = {
340
- delete: "/v1/{name=projects/*/instances/*/backups/*}"
341
- };
342
- option (google.api.method_signature) = "name";
343
- }
344
-
345
- // Lists completed and pending backups.
346
- // Backups returned are ordered by `create_time` in descending order,
347
- // starting from the most recent `create_time`.
348
- rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) {
349
- option (google.api.http) = {
350
- get: "/v1/{parent=projects/*/instances/*}/backups"
351
- };
352
- option (google.api.method_signature) = "parent";
353
- }
354
-
355
- // Create a new database by restoring from a completed backup. The new
356
- // database must be in the same project and in an instance with the same
357
- // instance configuration as the instance containing
358
- // the backup. The returned database [long-running
359
- // operation][google.longrunning.Operation] has a name of the format
360
- // `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`,
361
- // and can be used to track the progress of the operation, and to cancel it.
362
- // The [metadata][google.longrunning.Operation.metadata] field type is
363
- // [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
364
- // The [response][google.longrunning.Operation.response] type
365
- // is [Database][google.spanner.admin.database.v1.Database], if
366
- // successful. Cancelling the returned operation will stop the restore and
367
- // delete the database.
368
- // There can be only one database being restored into an instance at a time.
369
- // Once the restore operation completes, a new restore operation can be
370
- // initiated, without waiting for the optimize operation associated with the
371
- // first restore to complete.
372
- rpc RestoreDatabase(RestoreDatabaseRequest)
373
- returns (google.longrunning.Operation) {
374
- option (google.api.http) = {
375
- post: "/v1/{parent=projects/*/instances/*}/databases:restore"
376
- body: "*"
377
- };
378
- option (google.api.method_signature) = "parent,database_id,backup";
379
- option (google.longrunning.operation_info) = {
380
- response_type: "google.spanner.admin.database.v1.Database"
381
- metadata_type: "google.spanner.admin.database.v1.RestoreDatabaseMetadata"
382
- };
383
- }
384
-
385
- // Lists database [longrunning-operations][google.longrunning.Operation].
386
- // A database operation has a name of the form
387
- // `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`.
388
- // The long-running operation
389
- // [metadata][google.longrunning.Operation.metadata] field type
390
- // `metadata.type_url` describes the type of the metadata. Operations returned
391
- // include those that have completed/failed/canceled within the last 7 days,
392
- // and pending operations.
393
- rpc ListDatabaseOperations(ListDatabaseOperationsRequest)
394
- returns (ListDatabaseOperationsResponse) {
395
- option (google.api.http) = {
396
- get: "/v1/{parent=projects/*/instances/*}/databaseOperations"
397
- };
398
- option (google.api.method_signature) = "parent";
399
- }
400
-
401
- // Lists the backup [long-running operations][google.longrunning.Operation] in
402
- // the given instance. A backup operation has a name of the form
403
- // `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>`.
404
- // The long-running operation
405
- // [metadata][google.longrunning.Operation.metadata] field type
406
- // `metadata.type_url` describes the type of the metadata. Operations returned
407
- // include those that have completed/failed/canceled within the last 7 days,
408
- // and pending operations. Operations returned are ordered by
409
- // `operation.metadata.value.progress.start_time` in descending order starting
410
- // from the most recently started operation.
411
- rpc ListBackupOperations(ListBackupOperationsRequest)
412
- returns (ListBackupOperationsResponse) {
413
- option (google.api.http) = {
414
- get: "/v1/{parent=projects/*/instances/*}/backupOperations"
415
- };
416
- option (google.api.method_signature) = "parent";
417
- }
418
-
419
- // Lists Cloud Spanner database roles.
420
- rpc ListDatabaseRoles(ListDatabaseRolesRequest)
421
- returns (ListDatabaseRolesResponse) {
422
- option (google.api.http) = {
423
- get: "/v1/{parent=projects/*/instances/*/databases/*}/databaseRoles"
424
- };
425
- option (google.api.method_signature) = "parent";
426
- }
427
-
428
- // Creates a new backup schedule.
429
- rpc CreateBackupSchedule(CreateBackupScheduleRequest)
430
- returns (BackupSchedule) {
431
- option (google.api.http) = {
432
- post: "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules"
433
- body: "backup_schedule"
434
- };
435
- option (google.api.method_signature) =
436
- "parent,backup_schedule,backup_schedule_id";
437
- }
438
-
439
- // Gets backup schedule for the input schedule name.
440
- rpc GetBackupSchedule(GetBackupScheduleRequest) returns (BackupSchedule) {
441
- option (google.api.http) = {
442
- get: "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}"
443
- };
444
- option (google.api.method_signature) = "name";
445
- }
446
-
447
- // Updates a backup schedule.
448
- rpc UpdateBackupSchedule(UpdateBackupScheduleRequest)
449
- returns (BackupSchedule) {
450
- option (google.api.http) = {
451
- patch: "/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}"
452
- body: "backup_schedule"
453
- };
454
- option (google.api.method_signature) = "backup_schedule,update_mask";
455
- }
456
-
457
- // Deletes a backup schedule.
458
- rpc DeleteBackupSchedule(DeleteBackupScheduleRequest)
459
- returns (google.protobuf.Empty) {
460
- option (google.api.http) = {
461
- delete: "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}"
462
- };
463
- option (google.api.method_signature) = "name";
464
- }
465
-
466
- // Lists all the backup schedules for the database.
467
- rpc ListBackupSchedules(ListBackupSchedulesRequest)
468
- returns (ListBackupSchedulesResponse) {
469
- option (google.api.http) = {
470
- get: "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules"
471
- };
472
- option (google.api.method_signature) = "parent";
473
- }
474
- }
475
-
476
- // Information about the database restore.
477
- message RestoreInfo {
478
- // The type of the restore source.
479
- RestoreSourceType source_type = 1;
480
-
481
- // Information about the source used to restore the database.
482
- oneof source_info {
483
- // Information about the backup used to restore the database. The backup
484
- // may no longer exist.
485
- BackupInfo backup_info = 2;
486
- }
487
- }
488
-
489
- // A Cloud Spanner database.
490
- message Database {
491
- option (google.api.resource) = {
492
- type: "spanner.googleapis.com/Database"
493
- pattern: "projects/{project}/instances/{instance}/databases/{database}"
494
- };
495
-
496
- // Indicates the current state of the database.
497
- enum State {
498
- // Not specified.
499
- STATE_UNSPECIFIED = 0;
500
-
501
- // The database is still being created. Operations on the database may fail
502
- // with `FAILED_PRECONDITION` in this state.
503
- CREATING = 1;
504
-
505
- // The database is fully created and ready for use.
506
- READY = 2;
507
-
508
- // The database is fully created and ready for use, but is still
509
- // being optimized for performance and cannot handle full load.
510
- //
511
- // In this state, the database still references the backup
512
- // it was restore from, preventing the backup
513
- // from being deleted. When optimizations are complete, the full performance
514
- // of the database will be restored, and the database will transition to
515
- // `READY` state.
516
- READY_OPTIMIZING = 3;
517
- }
518
-
519
- // Required. The name of the database. Values are of the form
520
- // `projects/<project>/instances/<instance>/databases/<database>`,
521
- // where `<database>` is as specified in the `CREATE DATABASE`
522
- // statement. This name can be passed to other API methods to
523
- // identify the database.
524
- string name = 1 [(google.api.field_behavior) = REQUIRED];
525
-
526
- // Output only. The current database state.
527
- State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
528
-
529
- // Output only. If exists, the time at which the database creation started.
530
- google.protobuf.Timestamp create_time = 3
531
- [(google.api.field_behavior) = OUTPUT_ONLY];
532
-
533
- // Output only. Applicable only for restored databases. Contains information
534
- // about the restore source.
535
- RestoreInfo restore_info = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
536
-
537
- // Output only. For databases that are using customer managed encryption, this
538
- // field contains the encryption configuration for the database.
539
- // For databases that are using Google default or other types of encryption,
540
- // this field is empty.
541
- EncryptionConfig encryption_config = 5
542
- [(google.api.field_behavior) = OUTPUT_ONLY];
543
-
544
- // Output only. For databases that are using customer managed encryption, this
545
- // field contains the encryption information for the database, such as
546
- // all Cloud KMS key versions that are in use. The `encryption_status' field
547
- // inside of each `EncryptionInfo` is not populated.
548
- //
549
- // For databases that are using Google default or other types of encryption,
550
- // this field is empty.
551
- //
552
- // This field is propagated lazily from the backend. There might be a delay
553
- // from when a key version is being used and when it appears in this field.
554
- repeated EncryptionInfo encryption_info = 8
555
- [(google.api.field_behavior) = OUTPUT_ONLY];
556
-
557
- // Output only. The period in which Cloud Spanner retains all versions of data
558
- // for the database. This is the same as the value of version_retention_period
559
- // database option set using
560
- // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl].
561
- // Defaults to 1 hour, if not set.
562
- string version_retention_period = 6
563
- [(google.api.field_behavior) = OUTPUT_ONLY];
564
-
565
- // Output only. Earliest timestamp at which older versions of the data can be
566
- // read. This value is continuously updated by Cloud Spanner and becomes stale
567
- // the moment it is queried. If you are using this value to recover data, make
568
- // sure to account for the time from the moment when the value is queried to
569
- // the moment when you initiate the recovery.
570
- google.protobuf.Timestamp earliest_version_time = 7
571
- [(google.api.field_behavior) = OUTPUT_ONLY];
572
-
573
- // Output only. The read-write region which contains the database's leader
574
- // replicas.
575
- //
576
- // This is the same as the value of default_leader
577
- // database option set using DatabaseAdmin.CreateDatabase or
578
- // DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty.
579
- string default_leader = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
580
-
581
- // Output only. The dialect of the Cloud Spanner Database.
582
- DatabaseDialect database_dialect = 10
583
- [(google.api.field_behavior) = OUTPUT_ONLY];
584
-
585
- // Whether drop protection is enabled for this database. Defaults to false,
586
- // if not set. For more details, please see how to [prevent accidental
587
- // database
588
- // deletion](https://cloud.google.com/spanner/docs/prevent-database-deletion).
589
- bool enable_drop_protection = 11;
590
-
591
- // Output only. If true, the database is being updated. If false, there are no
592
- // ongoing update operations for the database.
593
- bool reconciling = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
594
- }
595
-
596
- // The request for
597
- // [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases].
598
- message ListDatabasesRequest {
599
- // Required. The instance whose databases should be listed.
600
- // Values are of the form `projects/<project>/instances/<instance>`.
601
- string parent = 1 [
602
- (google.api.field_behavior) = REQUIRED,
603
- (google.api.resource_reference) = {
604
- type: "spanner.googleapis.com/Instance"
605
- }
606
- ];
607
-
608
- // Number of databases to be returned in the response. If 0 or less,
609
- // defaults to the server's maximum allowed page size.
610
- int32 page_size = 3;
611
-
612
- // If non-empty, `page_token` should contain a
613
- // [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token]
614
- // from a previous
615
- // [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse].
616
- string page_token = 4;
617
- }
618
-
619
- // The response for
620
- // [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases].
621
- message ListDatabasesResponse {
622
- // Databases that matched the request.
623
- repeated Database databases = 1;
624
-
625
- // `next_page_token` can be sent in a subsequent
626
- // [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]
627
- // call to fetch more of the matching databases.
628
- string next_page_token = 2;
629
- }
630
-
631
- // The request for
632
- // [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase].
633
- message CreateDatabaseRequest {
634
- // Required. The name of the instance that will serve the new database.
635
- // Values are of the form `projects/<project>/instances/<instance>`.
636
- string parent = 1 [
637
- (google.api.field_behavior) = REQUIRED,
638
- (google.api.resource_reference) = {
639
- type: "spanner.googleapis.com/Instance"
640
- }
641
- ];
642
-
643
- // Required. A `CREATE DATABASE` statement, which specifies the ID of the
644
- // new database. The database ID must conform to the regular expression
645
- // `[a-z][a-z0-9_\-]*[a-z0-9]` and be between 2 and 30 characters in length.
646
- // If the database ID is a reserved word or if it contains a hyphen, the
647
- // database ID must be enclosed in backticks (`` ` ``).
648
- string create_statement = 2 [(google.api.field_behavior) = REQUIRED];
649
-
650
- // Optional. A list of DDL statements to run inside the newly created
651
- // database. Statements can create tables, indexes, etc. These
652
- // statements execute atomically with the creation of the database:
653
- // if there is an error in any statement, the database is not created.
654
- repeated string extra_statements = 3 [(google.api.field_behavior) = OPTIONAL];
655
-
656
- // Optional. The encryption configuration for the database. If this field is
657
- // not specified, Cloud Spanner will encrypt/decrypt all data at rest using
658
- // Google default encryption.
659
- EncryptionConfig encryption_config = 4
660
- [(google.api.field_behavior) = OPTIONAL];
661
-
662
- // Optional. The dialect of the Cloud Spanner Database.
663
- DatabaseDialect database_dialect = 5 [(google.api.field_behavior) = OPTIONAL];
664
-
665
- // Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in
666
- // 'extra_statements' above.
667
- // Contains a protobuf-serialized
668
- // [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto).
669
- // To generate it, [install](https://grpc.io/docs/protoc-installation/) and
670
- // run `protoc` with --include_imports and --descriptor_set_out. For example,
671
- // to generate for moon/shot/app.proto, run
672
- // ```
673
- // $protoc --proto_path=/app_path --proto_path=/lib_path \
674
- // --include_imports \
675
- // --descriptor_set_out=descriptors.data \
676
- // moon/shot/app.proto
677
- // ```
678
- // For more details, see protobuffer [self
679
- // description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
680
- bytes proto_descriptors = 6 [(google.api.field_behavior) = OPTIONAL];
681
- }
682
-
683
- // Metadata type for the operation returned by
684
- // [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase].
685
- message CreateDatabaseMetadata {
686
- // The database being created.
687
- string database = 1 [(google.api.resource_reference) = {
688
- type: "spanner.googleapis.com/Database"
689
- }];
690
- }
691
-
692
- // The request for
693
- // [GetDatabase][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase].
694
- message GetDatabaseRequest {
695
- // Required. The name of the requested database. Values are of the form
696
- // `projects/<project>/instances/<instance>/databases/<database>`.
697
- string name = 1 [
698
- (google.api.field_behavior) = REQUIRED,
699
- (google.api.resource_reference) = {
700
- type: "spanner.googleapis.com/Database"
701
- }
702
- ];
703
- }
704
-
705
- // The request for
706
- // [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase].
707
- message UpdateDatabaseRequest {
708
- // Required. The database to update.
709
- // The `name` field of the database is of the form
710
- // `projects/<project>/instances/<instance>/databases/<database>`.
711
- Database database = 1 [(google.api.field_behavior) = REQUIRED];
712
-
713
- // Required. The list of fields to update. Currently, only
714
- // `enable_drop_protection` field can be updated.
715
- google.protobuf.FieldMask update_mask = 2
716
- [(google.api.field_behavior) = REQUIRED];
717
- }
718
-
719
- // Metadata type for the operation returned by
720
- // [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase].
721
- message UpdateDatabaseMetadata {
722
- // The request for
723
- // [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase].
724
- UpdateDatabaseRequest request = 1;
725
-
726
- // The progress of the
727
- // [UpdateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabase]
728
- // operation.
729
- OperationProgress progress = 2;
730
-
731
- // The time at which this operation was cancelled. If set, this operation is
732
- // in the process of undoing itself (which is best-effort).
733
- google.protobuf.Timestamp cancel_time = 3;
734
- }
735
-
736
- // Enqueues the given DDL statements to be applied, in order but not
737
- // necessarily all at once, to the database schema at some point (or
738
- // points) in the future. The server checks that the statements
739
- // are executable (syntactically valid, name tables that exist, etc.)
740
- // before enqueueing them, but they may still fail upon
741
- // later execution (e.g., if a statement from another batch of
742
- // statements is applied first and it conflicts in some way, or if
743
- // there is some data-related problem like a `NULL` value in a column to
744
- // which `NOT NULL` would be added). If a statement fails, all
745
- // subsequent statements in the batch are automatically cancelled.
746
- //
747
- // Each batch of statements is assigned a name which can be used with
748
- // the [Operations][google.longrunning.Operations] API to monitor
749
- // progress. See the
750
- // [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id]
751
- // field for more details.
752
- message UpdateDatabaseDdlRequest {
753
- // Required. The database to update.
754
- string database = 1 [
755
- (google.api.field_behavior) = REQUIRED,
756
- (google.api.resource_reference) = {
757
- type: "spanner.googleapis.com/Database"
758
- }
759
- ];
760
-
761
- // Required. DDL statements to be applied to the database.
762
- repeated string statements = 2 [(google.api.field_behavior) = REQUIRED];
763
-
764
- // If empty, the new update request is assigned an
765
- // automatically-generated operation ID. Otherwise, `operation_id`
766
- // is used to construct the name of the resulting
767
- // [Operation][google.longrunning.Operation].
768
- //
769
- // Specifying an explicit operation ID simplifies determining
770
- // whether the statements were executed in the event that the
771
- // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]
772
- // call is replayed, or the return value is otherwise lost: the
773
- // [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database]
774
- // and `operation_id` fields can be combined to form the
775
- // [name][google.longrunning.Operation.name] of the resulting
776
- // [longrunning.Operation][google.longrunning.Operation]:
777
- // `<database>/operations/<operation_id>`.
778
- //
779
- // `operation_id` should be unique within the database, and must be
780
- // a valid identifier: `[a-z][a-z0-9_]*`. Note that
781
- // automatically-generated operation IDs always begin with an
782
- // underscore. If the named operation already exists,
783
- // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]
784
- // returns `ALREADY_EXISTS`.
785
- string operation_id = 3;
786
-
787
- // Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements.
788
- // Contains a protobuf-serialized
789
- // [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto).
790
- // To generate it, [install](https://grpc.io/docs/protoc-installation/) and
791
- // run `protoc` with --include_imports and --descriptor_set_out. For example,
792
- // to generate for moon/shot/app.proto, run
793
- // ```
794
- // $protoc --proto_path=/app_path --proto_path=/lib_path \
795
- // --include_imports \
796
- // --descriptor_set_out=descriptors.data \
797
- // moon/shot/app.proto
798
- // ```
799
- // For more details, see protobuffer [self
800
- // description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
801
- bytes proto_descriptors = 4 [(google.api.field_behavior) = OPTIONAL];
802
- }
803
-
804
- // Action information extracted from a DDL statement. This proto is used to
805
- // display the brief info of the DDL statement for the operation
806
- // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl].
807
- message DdlStatementActionInfo {
808
- // The action for the DDL statement, e.g. CREATE, ALTER, DROP, GRANT, etc.
809
- // This field is a non-empty string.
810
- string action = 1;
811
-
812
- // The entity type for the DDL statement, e.g. TABLE, INDEX, VIEW, etc.
813
- // This field can be empty string for some DDL statement,
814
- // e.g. for statement "ANALYZE", `entity_type` = "".
815
- string entity_type = 2;
816
-
817
- // The entity name(s) being operated on the DDL statement.
818
- // E.g.
819
- // 1. For statement "CREATE TABLE t1(...)", `entity_names` = ["t1"].
820
- // 2. For statement "GRANT ROLE r1, r2 ...", `entity_names` = ["r1", "r2"].
821
- // 3. For statement "ANALYZE", `entity_names` = [].
822
- repeated string entity_names = 3;
823
- }
824
-
825
- // Metadata type for the operation returned by
826
- // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl].
827
- message UpdateDatabaseDdlMetadata {
828
- // The database being modified.
829
- string database = 1 [(google.api.resource_reference) = {
830
- type: "spanner.googleapis.com/Database"
831
- }];
832
-
833
- // For an update this list contains all the statements. For an
834
- // individual statement, this list contains only that statement.
835
- repeated string statements = 2;
836
-
837
- // Reports the commit timestamps of all statements that have
838
- // succeeded so far, where `commit_timestamps[i]` is the commit
839
- // timestamp for the statement `statements[i]`.
840
- repeated google.protobuf.Timestamp commit_timestamps = 3;
841
-
842
- // Output only. When true, indicates that the operation is throttled e.g.
843
- // due to resource constraints. When resources become available the operation
844
- // will resume and this field will be false again.
845
- bool throttled = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
846
-
847
- // The progress of the
848
- // [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]
849
- // operations. All DDL statements will have continuously updating progress,
850
- // and `progress[i]` is the operation progress for `statements[i]`. Also,
851
- // `progress[i]` will have start time and end time populated with commit
852
- // timestamp of operation, as well as a progress of 100% once the operation
853
- // has completed.
854
- repeated OperationProgress progress = 5;
855
-
856
- // The brief action info for the DDL statements.
857
- // `actions[i]` is the brief info for `statements[i]`.
858
- repeated DdlStatementActionInfo actions = 6;
859
- }
860
-
861
- // The request for
862
- // [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase].
863
- message DropDatabaseRequest {
864
- // Required. The database to be dropped.
865
- string database = 1 [
866
- (google.api.field_behavior) = REQUIRED,
867
- (google.api.resource_reference) = {
868
- type: "spanner.googleapis.com/Database"
869
- }
870
- ];
871
- }
872
-
873
- // The request for
874
- // [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl].
875
- message GetDatabaseDdlRequest {
876
- // Required. The database whose schema we wish to get.
877
- // Values are of the form
878
- // `projects/<project>/instances/<instance>/databases/<database>`
879
- string database = 1 [
880
- (google.api.field_behavior) = REQUIRED,
881
- (google.api.resource_reference) = {
882
- type: "spanner.googleapis.com/Database"
883
- }
884
- ];
885
- }
886
-
887
- // The response for
888
- // [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl].
889
- message GetDatabaseDdlResponse {
890
- // A list of formatted DDL statements defining the schema of the database
891
- // specified in the request.
892
- repeated string statements = 1;
893
-
894
- // Proto descriptors stored in the database.
895
- // Contains a protobuf-serialized
896
- // [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto).
897
- // For more details, see protobuffer [self
898
- // description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
899
- bytes proto_descriptors = 2;
900
- }
901
-
902
- // The request for
903
- // [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations].
904
- message ListDatabaseOperationsRequest {
905
- // Required. The instance of the database operations.
906
- // Values are of the form `projects/<project>/instances/<instance>`.
907
- string parent = 1 [
908
- (google.api.field_behavior) = REQUIRED,
909
- (google.api.resource_reference) = {
910
- type: "spanner.googleapis.com/Instance"
911
- }
912
- ];
913
-
914
- // An expression that filters the list of returned operations.
915
- //
916
- // A filter expression consists of a field name, a
917
- // comparison operator, and a value for filtering.
918
- // The value must be a string, a number, or a boolean. The comparison operator
919
- // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
920
- // Colon `:` is the contains operator. Filter rules are not case sensitive.
921
- //
922
- // The following fields in the [Operation][google.longrunning.Operation]
923
- // are eligible for filtering:
924
- //
925
- // * `name` - The name of the long-running operation
926
- // * `done` - False if the operation is in progress, else true.
927
- // * `metadata.@type` - the type of metadata. For example, the type string
928
- // for
929
- // [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]
930
- // is
931
- // `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
932
- // * `metadata.<field_name>` - any field in metadata.value.
933
- // `metadata.@type` must be specified first, if filtering on metadata
934
- // fields.
935
- // * `error` - Error associated with the long-running operation.
936
- // * `response.@type` - the type of response.
937
- // * `response.<field_name>` - any field in response.value.
938
- //
939
- // You can combine multiple expressions by enclosing each expression in
940
- // parentheses. By default, expressions are combined with AND logic. However,
941
- // you can specify AND, OR, and NOT logic explicitly.
942
- //
943
- // Here are a few examples:
944
- //
945
- // * `done:true` - The operation is complete.
946
- // * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \
947
- // `(metadata.source_type:BACKUP) AND` \
948
- // `(metadata.backup_info.backup:backup_howl) AND` \
949
- // `(metadata.name:restored_howl) AND` \
950
- // `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
951
- // `(error:*)` - Return operations where:
952
- // * The operation's metadata type is
953
- // [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
954
- // * The database is restored from a backup.
955
- // * The backup name contains "backup_howl".
956
- // * The restored database's name contains "restored_howl".
957
- // * The operation started before 2018-03-28T14:50:00Z.
958
- // * The operation resulted in an error.
959
- string filter = 2;
960
-
961
- // Number of operations to be returned in the response. If 0 or
962
- // less, defaults to the server's maximum allowed page size.
963
- int32 page_size = 3;
964
-
965
- // If non-empty, `page_token` should contain a
966
- // [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token]
967
- // from a previous
968
- // [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse]
969
- // to the same `parent` and with the same `filter`.
970
- string page_token = 4;
971
- }
972
-
973
- // The response for
974
- // [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations].
975
- message ListDatabaseOperationsResponse {
976
- // The list of matching database [long-running
977
- // operations][google.longrunning.Operation]. Each operation's name will be
978
- // prefixed by the database's name. The operation's
979
- // [metadata][google.longrunning.Operation.metadata] field type
980
- // `metadata.type_url` describes the type of the metadata.
981
- repeated google.longrunning.Operation operations = 1;
982
-
983
- // `next_page_token` can be sent in a subsequent
984
- // [ListDatabaseOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseOperations]
985
- // call to fetch more of the matching metadata.
986
- string next_page_token = 2;
987
- }
988
-
989
- // The request for
990
- // [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase].
991
- message RestoreDatabaseRequest {
992
- // Required. The name of the instance in which to create the
993
- // restored database. This instance must be in the same project and
994
- // have the same instance configuration as the instance containing
995
- // the source backup. Values are of the form
996
- // `projects/<project>/instances/<instance>`.
997
- string parent = 1 [
998
- (google.api.field_behavior) = REQUIRED,
999
- (google.api.resource_reference) = {
1000
- type: "spanner.googleapis.com/Instance"
1001
- }
1002
- ];
1003
-
1004
- // Required. The id of the database to create and restore to. This
1005
- // database must not already exist. The `database_id` appended to
1006
- // `parent` forms the full database name of the form
1007
- // `projects/<project>/instances/<instance>/databases/<database_id>`.
1008
- string database_id = 2 [(google.api.field_behavior) = REQUIRED];
1009
-
1010
- // Required. The source from which to restore.
1011
- oneof source {
1012
- // Name of the backup from which to restore. Values are of the form
1013
- // `projects/<project>/instances/<instance>/backups/<backup>`.
1014
- string backup = 3 [(google.api.resource_reference) = {
1015
- type: "spanner.googleapis.com/Backup"
1016
- }];
1017
- }
1018
-
1019
- // Optional. An encryption configuration describing the encryption type and
1020
- // key resources in Cloud KMS used to encrypt/decrypt the database to restore
1021
- // to. If this field is not specified, the restored database will use the same
1022
- // encryption configuration as the backup by default, namely
1023
- // [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type]
1024
- // = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
1025
- RestoreDatabaseEncryptionConfig encryption_config = 4
1026
- [(google.api.field_behavior) = OPTIONAL];
1027
- }
1028
-
1029
- // Encryption configuration for the restored database.
1030
- message RestoreDatabaseEncryptionConfig {
1031
- // Encryption types for the database to be restored.
1032
- enum EncryptionType {
1033
- // Unspecified. Do not use.
1034
- ENCRYPTION_TYPE_UNSPECIFIED = 0;
1035
-
1036
- // This is the default option when
1037
- // [encryption_config][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig]
1038
- // is not specified.
1039
- USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1;
1040
-
1041
- // Use Google default encryption.
1042
- GOOGLE_DEFAULT_ENCRYPTION = 2;
1043
-
1044
- // Use customer managed encryption. If specified, `kms_key_name` must
1045
- // must contain a valid Cloud KMS key.
1046
- CUSTOMER_MANAGED_ENCRYPTION = 3;
1047
- }
1048
-
1049
- // Required. The encryption type of the restored database.
1050
- EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED];
1051
-
1052
- // Optional. The Cloud KMS key that will be used to encrypt/decrypt the
1053
- // restored database. This field should be set only when
1054
- // [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type]
1055
- // is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
1056
- // `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
1057
- string kms_key_name = 2 [
1058
- (google.api.field_behavior) = OPTIONAL,
1059
- (google.api.resource_reference) = {
1060
- type: "cloudkms.googleapis.com/CryptoKey"
1061
- }
1062
- ];
1063
-
1064
- // Optional. Specifies the KMS configuration for the one or more keys used to
1065
- // encrypt the database. Values are of the form
1066
- // `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
1067
- //
1068
- // The keys referenced by kms_key_names must fully cover all
1069
- // regions of the database instance configuration. Some examples:
1070
- // * For single region database instance configs, specify a single regional
1071
- // location KMS key.
1072
- // * For multi-regional database instance configs of type GOOGLE_MANAGED,
1073
- // either specify a multi-regional location KMS key or multiple regional
1074
- // location KMS keys that cover all regions in the instance config.
1075
- // * For a database instance config of type USER_MANAGED, please specify only
1076
- // regional location KMS keys to cover each region in the instance config.
1077
- // Multi-regional location KMS keys are not supported for USER_MANAGED
1078
- // instance configs.
1079
- repeated string kms_key_names = 3 [
1080
- (google.api.field_behavior) = OPTIONAL,
1081
- (google.api.resource_reference) = {
1082
- type: "cloudkms.googleapis.com/CryptoKey"
1083
- }
1084
- ];
1085
- }
1086
-
1087
- // Metadata type for the long-running operation returned by
1088
- // [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase].
1089
- message RestoreDatabaseMetadata {
1090
- // Name of the database being created and restored to.
1091
- string name = 1 [(google.api.resource_reference) = {
1092
- type: "spanner.googleapis.com/Database"
1093
- }];
1094
-
1095
- // The type of the restore source.
1096
- RestoreSourceType source_type = 2;
1097
-
1098
- // Information about the source used to restore the database, as specified by
1099
- // `source` in
1100
- // [RestoreDatabaseRequest][google.spanner.admin.database.v1.RestoreDatabaseRequest].
1101
- oneof source_info {
1102
- // Information about the backup used to restore the database.
1103
- BackupInfo backup_info = 3;
1104
- }
1105
-
1106
- // The progress of the
1107
- // [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase]
1108
- // operation.
1109
- OperationProgress progress = 4;
1110
-
1111
- // The time at which cancellation of this operation was received.
1112
- // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
1113
- // starts asynchronous cancellation on a long-running operation. The server
1114
- // makes a best effort to cancel the operation, but success is not guaranteed.
1115
- // Clients can use
1116
- // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
1117
- // other methods to check whether the cancellation succeeded or whether the
1118
- // operation completed despite cancellation. On successful cancellation,
1119
- // the operation is not deleted; instead, it becomes an operation with
1120
- // an [Operation.error][google.longrunning.Operation.error] value with a
1121
- // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
1122
- // `Code.CANCELLED`.
1123
- google.protobuf.Timestamp cancel_time = 5;
1124
-
1125
- // If exists, the name of the long-running operation that will be used to
1126
- // track the post-restore optimization process to optimize the performance of
1127
- // the restored database, and remove the dependency on the restore source.
1128
- // The name is of the form
1129
- // `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`
1130
- // where the <database> is the name of database being created and restored to.
1131
- // The metadata type of the long-running operation is
1132
- // [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata].
1133
- // This long-running operation will be automatically created by the system
1134
- // after the RestoreDatabase long-running operation completes successfully.
1135
- // This operation will not be created if the restore was not successful.
1136
- string optimize_database_operation_name = 6;
1137
- }
1138
-
1139
- // Metadata type for the long-running operation used to track the progress
1140
- // of optimizations performed on a newly restored database. This long-running
1141
- // operation is automatically created by the system after the successful
1142
- // completion of a database restore, and cannot be cancelled.
1143
- message OptimizeRestoredDatabaseMetadata {
1144
- // Name of the restored database being optimized.
1145
- string name = 1 [(google.api.resource_reference) = {
1146
- type: "spanner.googleapis.com/Database"
1147
- }];
1148
-
1149
- // The progress of the post-restore optimizations.
1150
- OperationProgress progress = 2;
1151
- }
1152
-
1153
- // Indicates the type of the restore source.
1154
- enum RestoreSourceType {
1155
- // No restore associated.
1156
- TYPE_UNSPECIFIED = 0;
1157
-
1158
- // A backup was used as the source of the restore.
1159
- BACKUP = 1;
1160
- }
1161
-
1162
- // A Cloud Spanner database role.
1163
- message DatabaseRole {
1164
- option (google.api.resource) = {
1165
- type: "spanner.googleapis.com/DatabaseRole"
1166
- pattern: "projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}"
1167
- };
1168
-
1169
- // Required. The name of the database role. Values are of the form
1170
- // `projects/<project>/instances/<instance>/databases/<database>/databaseRoles/<role>`
1171
- // where `<role>` is as specified in the `CREATE ROLE` DDL statement.
1172
- string name = 1 [(google.api.field_behavior) = REQUIRED];
1173
- }
1174
-
1175
- // The request for
1176
- // [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles].
1177
- message ListDatabaseRolesRequest {
1178
- // Required. The database whose roles should be listed.
1179
- // Values are of the form
1180
- // `projects/<project>/instances/<instance>/databases/<database>`.
1181
- string parent = 1 [
1182
- (google.api.field_behavior) = REQUIRED,
1183
- (google.api.resource_reference) = {
1184
- type: "spanner.googleapis.com/Database"
1185
- }
1186
- ];
1187
-
1188
- // Number of database roles to be returned in the response. If 0 or less,
1189
- // defaults to the server's maximum allowed page size.
1190
- int32 page_size = 2;
1191
-
1192
- // If non-empty, `page_token` should contain a
1193
- // [next_page_token][google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token]
1194
- // from a previous
1195
- // [ListDatabaseRolesResponse][google.spanner.admin.database.v1.ListDatabaseRolesResponse].
1196
- string page_token = 3;
1197
- }
1198
-
1199
- // The response for
1200
- // [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles].
1201
- message ListDatabaseRolesResponse {
1202
- // Database roles that matched the request.
1203
- repeated DatabaseRole database_roles = 1;
1204
-
1205
- // `next_page_token` can be sent in a subsequent
1206
- // [ListDatabaseRoles][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabaseRoles]
1207
- // call to fetch more of the matching roles.
1208
- string next_page_token = 2;
1209
- }