@google-cloud/spanner-api 0.1.0

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