|
|
|
@ -1,4 +1,4 @@ |
|
|
|
|
// Copyright 2020 Google LLC |
|
|
|
|
// Copyright 2021 Google LLC |
|
|
|
|
// |
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
|
// you may not use this file except in compliance with the License. |
|
|
|
@ -65,10 +65,11 @@ service DatabaseAdmin { |
|
|
|
|
// have a name of the format `<database_name>/operations/<operation_id>` and |
|
|
|
|
// can be used to track preparation of the database. The |
|
|
|
|
// [metadata][google.longrunning.Operation.metadata] field type is |
|
|
|
|
// [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The |
|
|
|
|
// [response][google.longrunning.Operation.response] field type is |
|
|
|
|
// [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. |
|
|
|
|
// The [response][google.longrunning.Operation.response] field type is |
|
|
|
|
// [Database][google.spanner.admin.database.v1.Database], if successful. |
|
|
|
|
rpc CreateDatabase(CreateDatabaseRequest) returns (google.longrunning.Operation) { |
|
|
|
|
rpc CreateDatabase(CreateDatabaseRequest) |
|
|
|
|
returns (google.longrunning.Operation) { |
|
|
|
|
option (google.api.http) = { |
|
|
|
|
post: "/v1/{parent=projects/*/instances/*}/databases" |
|
|
|
|
body: "*" |
|
|
|
@ -94,8 +95,10 @@ service DatabaseAdmin { |
|
|
|
|
// the format `<database_name>/operations/<operation_id>` and can be used to |
|
|
|
|
// track execution of the schema change(s). The |
|
|
|
|
// [metadata][google.longrunning.Operation.metadata] field type is |
|
|
|
|
// [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response. |
|
|
|
|
rpc UpdateDatabaseDdl(UpdateDatabaseDdlRequest) returns (google.longrunning.Operation) { |
|
|
|
|
// [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. |
|
|
|
|
// The operation has no response. |
|
|
|
|
rpc UpdateDatabaseDdl(UpdateDatabaseDdlRequest) |
|
|
|
|
returns (google.longrunning.Operation) { |
|
|
|
|
option (google.api.http) = { |
|
|
|
|
patch: "/v1/{database=projects/*/instances/*/databases/*}/ddl" |
|
|
|
|
body: "*" |
|
|
|
@ -134,7 +137,8 @@ service DatabaseAdmin { |
|
|
|
|
// permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. |
|
|
|
|
// For backups, authorization requires `spanner.backups.setIamPolicy` |
|
|
|
|
// permission on [resource][google.iam.v1.SetIamPolicyRequest.resource]. |
|
|
|
|
rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { |
|
|
|
|
rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) |
|
|
|
|
returns (google.iam.v1.Policy) { |
|
|
|
|
option (google.api.http) = { |
|
|
|
|
post: "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy" |
|
|
|
|
body: "*" |
|
|
|
@ -154,7 +158,8 @@ service DatabaseAdmin { |
|
|
|
|
// [resource][google.iam.v1.GetIamPolicyRequest.resource]. |
|
|
|
|
// For backups, authorization requires `spanner.backups.getIamPolicy` |
|
|
|
|
// permission on [resource][google.iam.v1.GetIamPolicyRequest.resource]. |
|
|
|
|
rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { |
|
|
|
|
rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) |
|
|
|
|
returns (google.iam.v1.Policy) { |
|
|
|
|
option (google.api.http) = { |
|
|
|
|
post: "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy" |
|
|
|
|
body: "*" |
|
|
|
@ -176,7 +181,8 @@ service DatabaseAdmin { |
|
|
|
|
// Calling this method on a backup that does not exist will |
|
|
|
|
// result in a NOT_FOUND error if the user has |
|
|
|
|
// `spanner.backups.list` permission on the containing instance. |
|
|
|
|
rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { |
|
|
|
|
rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) |
|
|
|
|
returns (google.iam.v1.TestIamPermissionsResponse) { |
|
|
|
|
option (google.api.http) = { |
|
|
|
|
post: "/v1/{resource=projects/*/instances/*/databases/*}:testIamPermissions" |
|
|
|
|
body: "*" |
|
|
|
@ -194,12 +200,12 @@ service DatabaseAdmin { |
|
|
|
|
// `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>` |
|
|
|
|
// and can be used to track creation of the backup. The |
|
|
|
|
// [metadata][google.longrunning.Operation.metadata] field type is |
|
|
|
|
// [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The |
|
|
|
|
// [response][google.longrunning.Operation.response] field type is |
|
|
|
|
// [Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the |
|
|
|
|
// creation and delete the backup. |
|
|
|
|
// There can be only one pending backup creation per database. Backup creation |
|
|
|
|
// of different databases can run concurrently. |
|
|
|
|
// [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. |
|
|
|
|
// The [response][google.longrunning.Operation.response] field type is |
|
|
|
|
// [Backup][google.spanner.admin.database.v1.Backup], if successful. |
|
|
|
|
// Cancelling the returned operation will stop the creation and delete the |
|
|
|
|
// backup. There can be only one pending backup creation per database. Backup |
|
|
|
|
// creation of different databases can run concurrently. |
|
|
|
|
rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { |
|
|
|
|
option (google.api.http) = { |
|
|
|
|
post: "/v1/{parent=projects/*/instances/*}/backups" |
|
|
|
@ -212,7 +218,8 @@ service DatabaseAdmin { |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. |
|
|
|
|
// Gets metadata on a pending or completed |
|
|
|
|
// [Backup][google.spanner.admin.database.v1.Backup]. |
|
|
|
|
rpc GetBackup(GetBackupRequest) returns (Backup) { |
|
|
|
|
option (google.api.http) = { |
|
|
|
|
get: "/v1/{name=projects/*/instances/*/backups/*}" |
|
|
|
@ -220,7 +227,8 @@ service DatabaseAdmin { |
|
|
|
|
option (google.api.method_signature) = "name"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. |
|
|
|
|
// Updates a pending or completed |
|
|
|
|
// [Backup][google.spanner.admin.database.v1.Backup]. |
|
|
|
|
rpc UpdateBackup(UpdateBackupRequest) returns (Backup) { |
|
|
|
|
option (google.api.http) = { |
|
|
|
|
patch: "/v1/{backup.name=projects/*/instances/*/backups/*}" |
|
|
|
@ -229,7 +237,8 @@ service DatabaseAdmin { |
|
|
|
|
option (google.api.method_signature) = "backup,update_mask"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup]. |
|
|
|
|
// Deletes a pending or completed |
|
|
|
|
// [Backup][google.spanner.admin.database.v1.Backup]. |
|
|
|
|
rpc DeleteBackup(DeleteBackupRequest) returns (google.protobuf.Empty) { |
|
|
|
|
option (google.api.http) = { |
|
|
|
|
delete: "/v1/{name=projects/*/instances/*/backups/*}" |
|
|
|
@ -264,7 +273,8 @@ service DatabaseAdmin { |
|
|
|
|
// Once the restore operation completes, a new restore operation can be |
|
|
|
|
// initiated, without waiting for the optimize operation associated with the |
|
|
|
|
// first restore to complete. |
|
|
|
|
rpc RestoreDatabase(RestoreDatabaseRequest) returns (google.longrunning.Operation) { |
|
|
|
|
rpc RestoreDatabase(RestoreDatabaseRequest) |
|
|
|
|
returns (google.longrunning.Operation) { |
|
|
|
|
option (google.api.http) = { |
|
|
|
|
post: "/v1/{parent=projects/*/instances/*}/databases:restore" |
|
|
|
|
body: "*" |
|
|
|
@ -284,7 +294,8 @@ service DatabaseAdmin { |
|
|
|
|
// `metadata.type_url` describes the type of the metadata. Operations returned |
|
|
|
|
// include those that have completed/failed/canceled within the last 7 days, |
|
|
|
|
// and pending operations. |
|
|
|
|
rpc ListDatabaseOperations(ListDatabaseOperationsRequest) returns (ListDatabaseOperationsResponse) { |
|
|
|
|
rpc ListDatabaseOperations(ListDatabaseOperationsRequest) |
|
|
|
|
returns (ListDatabaseOperationsResponse) { |
|
|
|
|
option (google.api.http) = { |
|
|
|
|
get: "/v1/{parent=projects/*/instances/*}/databaseOperations" |
|
|
|
|
}; |
|
|
|
@ -301,7 +312,8 @@ service DatabaseAdmin { |
|
|
|
|
// and pending operations. Operations returned are ordered by |
|
|
|
|
// `operation.metadata.value.progress.start_time` in descending order starting |
|
|
|
|
// from the most recently started operation. |
|
|
|
|
rpc ListBackupOperations(ListBackupOperationsRequest) returns (ListBackupOperationsResponse) { |
|
|
|
|
rpc ListBackupOperations(ListBackupOperationsRequest) |
|
|
|
|
returns (ListBackupOperationsResponse) { |
|
|
|
|
option (google.api.http) = { |
|
|
|
|
get: "/v1/{parent=projects/*/instances/*}/backupOperations" |
|
|
|
|
}; |
|
|
|
@ -363,25 +375,51 @@ message Database { |
|
|
|
|
State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; |
|
|
|
|
|
|
|
|
|
// Output only. If exists, the time at which the database creation started. |
|
|
|
|
google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; |
|
|
|
|
google.protobuf.Timestamp create_time = 3 |
|
|
|
|
[(google.api.field_behavior) = OUTPUT_ONLY]; |
|
|
|
|
|
|
|
|
|
// Output only. Applicable only for restored databases. Contains information |
|
|
|
|
// about the restore source. |
|
|
|
|
RestoreInfo restore_info = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; |
|
|
|
|
|
|
|
|
|
// Output only. For databases that are using customer managed encryption, this |
|
|
|
|
// field contains the encryption configuration for the database. |
|
|
|
|
// For databases that are using Google default or other types of encryption, |
|
|
|
|
// this field is empty. |
|
|
|
|
EncryptionConfig encryption_config = 5 |
|
|
|
|
[(google.api.field_behavior) = OUTPUT_ONLY]; |
|
|
|
|
|
|
|
|
|
// Output only. For databases that are using customer managed encryption, this |
|
|
|
|
// field contains the encryption information for the database, such as |
|
|
|
|
// encryption state and the Cloud KMS key versions that are in use. |
|
|
|
|
// |
|
|
|
|
// For databases that are using Google default or other types of encryption, |
|
|
|
|
// this field is empty. |
|
|
|
|
// |
|
|
|
|
// This field is propagated lazily from the backend. There might be a delay |
|
|
|
|
// from when a key version is being used and when it appears in this field. |
|
|
|
|
repeated EncryptionInfo encryption_info = 8 |
|
|
|
|
[(google.api.field_behavior) = OUTPUT_ONLY]; |
|
|
|
|
|
|
|
|
|
// Output only. The period in which Cloud Spanner retains all versions of data |
|
|
|
|
// for the database. This is the same as the value of version_retention_period |
|
|
|
|
// database option set using |
|
|
|
|
// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. Defaults to 1 hour, |
|
|
|
|
// if not set. |
|
|
|
|
string version_retention_period = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; |
|
|
|
|
// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. |
|
|
|
|
// Defaults to 1 hour, if not set. |
|
|
|
|
string version_retention_period = 6 |
|
|
|
|
[(google.api.field_behavior) = OUTPUT_ONLY]; |
|
|
|
|
|
|
|
|
|
// Output only. Earliest timestamp at which older versions of the data can be |
|
|
|
|
// read. |
|
|
|
|
google.protobuf.Timestamp earliest_version_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; |
|
|
|
|
// read. This value is continuously updated by Cloud Spanner and becomes stale |
|
|
|
|
// the moment it is queried. If you are using this value to recover data, make |
|
|
|
|
// sure to account for the time from the moment when the value is queried to |
|
|
|
|
// the moment when you initiate the recovery. |
|
|
|
|
google.protobuf.Timestamp earliest_version_time = 7 |
|
|
|
|
[(google.api.field_behavior) = OUTPUT_ONLY]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// The request for [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. |
|
|
|
|
// The request for |
|
|
|
|
// [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. |
|
|
|
|
message ListDatabasesRequest { |
|
|
|
|
// Required. The instance whose databases should be listed. |
|
|
|
|
// Values are of the form `projects/<project>/instances/<instance>`. |
|
|
|
@ -397,23 +435,26 @@ message ListDatabasesRequest { |
|
|
|
|
int32 page_size = 3; |
|
|
|
|
|
|
|
|
|
// If non-empty, `page_token` should contain a |
|
|
|
|
// [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] from a |
|
|
|
|
// previous [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. |
|
|
|
|
// [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] |
|
|
|
|
// from a previous |
|
|
|
|
// [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. |
|
|
|
|
string page_token = 4; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// The response for [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. |
|
|
|
|
// The response for |
|
|
|
|
// [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. |
|
|
|
|
message ListDatabasesResponse { |
|
|
|
|
// Databases that matched the request. |
|
|
|
|
repeated Database databases = 1; |
|
|
|
|
|
|
|
|
|
// `next_page_token` can be sent in a subsequent |
|
|
|
|
// [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] call to fetch more |
|
|
|
|
// of the matching databases. |
|
|
|
|
// [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] |
|
|
|
|
// call to fetch more of the matching databases. |
|
|
|
|
string next_page_token = 2; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// The request for [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase]. |
|
|
|
|
// The request for |
|
|
|
|
// [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase]. |
|
|
|
|
message CreateDatabaseRequest { |
|
|
|
|
// Required. The name of the instance that will serve the new database. |
|
|
|
|
// Values are of the form `projects/<project>/instances/<instance>`. |
|
|
|
@ -436,6 +477,12 @@ message CreateDatabaseRequest { |
|
|
|
|
// statements execute atomically with the creation of the database: |
|
|
|
|
// if there is an error in any statement, the database is not created. |
|
|
|
|
repeated string extra_statements = 3 [(google.api.field_behavior) = OPTIONAL]; |
|
|
|
|
|
|
|
|
|
// Optional. The encryption configuration for the database. If this field is |
|
|
|
|
// not specified, Cloud Spanner will encrypt/decrypt all data at rest using |
|
|
|
|
// Google default encryption. |
|
|
|
|
EncryptionConfig encryption_config = 4 |
|
|
|
|
[(google.api.field_behavior) = OPTIONAL]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Metadata type for the operation returned by |
|
|
|
@ -443,11 +490,12 @@ message CreateDatabaseRequest { |
|
|
|
|
message CreateDatabaseMetadata { |
|
|
|
|
// The database being created. |
|
|
|
|
string database = 1 [(google.api.resource_reference) = { |
|
|
|
|
type: "spanner.googleapis.com/Database" |
|
|
|
|
}]; |
|
|
|
|
type: "spanner.googleapis.com/Database" |
|
|
|
|
}]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// The request for [GetDatabase][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase]. |
|
|
|
|
// The request for |
|
|
|
|
// [GetDatabase][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase]. |
|
|
|
|
message GetDatabaseRequest { |
|
|
|
|
// Required. The name of the requested database. Values are of the form |
|
|
|
|
// `projects/<project>/instances/<instance>/databases/<database>`. |
|
|
|
@ -473,8 +521,8 @@ message GetDatabaseRequest { |
|
|
|
|
// Each batch of statements is assigned a name which can be used with |
|
|
|
|
// the [Operations][google.longrunning.Operations] API to monitor |
|
|
|
|
// progress. See the |
|
|
|
|
// [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id] field for more |
|
|
|
|
// details. |
|
|
|
|
// [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id] |
|
|
|
|
// field for more details. |
|
|
|
|
message UpdateDatabaseDdlRequest { |
|
|
|
|
// Required. The database to update. |
|
|
|
|
string database = 1 [ |
|
|
|
@ -494,18 +542,20 @@ message UpdateDatabaseDdlRequest { |
|
|
|
|
// |
|
|
|
|
// Specifying an explicit operation ID simplifies determining |
|
|
|
|
// whether the statements were executed in the event that the |
|
|
|
|
// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed, |
|
|
|
|
// or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and |
|
|
|
|
// `operation_id` fields can be combined to form the |
|
|
|
|
// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] |
|
|
|
|
// call is replayed, or the return value is otherwise lost: the |
|
|
|
|
// [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] |
|
|
|
|
// and `operation_id` fields can be combined to form the |
|
|
|
|
// [name][google.longrunning.Operation.name] of the resulting |
|
|
|
|
// [longrunning.Operation][google.longrunning.Operation]: `<database>/operations/<operation_id>`. |
|
|
|
|
// [longrunning.Operation][google.longrunning.Operation]: |
|
|
|
|
// `<database>/operations/<operation_id>`. |
|
|
|
|
// |
|
|
|
|
// `operation_id` should be unique within the database, and must be |
|
|
|
|
// a valid identifier: `[a-z][a-z0-9_]*`. Note that |
|
|
|
|
// automatically-generated operation IDs always begin with an |
|
|
|
|
// underscore. If the named operation already exists, |
|
|
|
|
// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns |
|
|
|
|
// `ALREADY_EXISTS`. |
|
|
|
|
// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] |
|
|
|
|
// returns `ALREADY_EXISTS`. |
|
|
|
|
string operation_id = 3; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -514,8 +564,8 @@ message UpdateDatabaseDdlRequest { |
|
|
|
|
message UpdateDatabaseDdlMetadata { |
|
|
|
|
// The database being modified. |
|
|
|
|
string database = 1 [(google.api.resource_reference) = { |
|
|
|
|
type: "spanner.googleapis.com/Database" |
|
|
|
|
}]; |
|
|
|
|
type: "spanner.googleapis.com/Database" |
|
|
|
|
}]; |
|
|
|
|
|
|
|
|
|
// For an update this list contains all the statements. For an |
|
|
|
|
// individual statement, this list contains only that statement. |
|
|
|
@ -532,7 +582,8 @@ message UpdateDatabaseDdlMetadata { |
|
|
|
|
bool throttled = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// The request for [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase]. |
|
|
|
|
// The request for |
|
|
|
|
// [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase]. |
|
|
|
|
message DropDatabaseRequest { |
|
|
|
|
// Required. The database to be dropped. |
|
|
|
|
string database = 1 [ |
|
|
|
@ -543,7 +594,8 @@ message DropDatabaseRequest { |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// The request for [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. |
|
|
|
|
// The request for |
|
|
|
|
// [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. |
|
|
|
|
message GetDatabaseDdlRequest { |
|
|
|
|
// Required. The database whose schema we wish to get. |
|
|
|
|
// Values are of the form |
|
|
|
@ -556,7 +608,8 @@ message GetDatabaseDdlRequest { |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// The response for [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. |
|
|
|
|
// The response for |
|
|
|
|
// [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. |
|
|
|
|
message GetDatabaseDdlResponse { |
|
|
|
|
// A list of formatted DDL statements defining the schema of the database |
|
|
|
|
// specified in the request. |
|
|
|
@ -589,7 +642,9 @@ message ListDatabaseOperationsRequest { |
|
|
|
|
// * `name` - The name of the long-running operation |
|
|
|
|
// * `done` - False if the operation is in progress, else true. |
|
|
|
|
// * `metadata.@type` - the type of metadata. For example, the type string |
|
|
|
|
// for [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] is |
|
|
|
|
// for |
|
|
|
|
// [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] |
|
|
|
|
// is |
|
|
|
|
// `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. |
|
|
|
|
// * `metadata.<field_name>` - any field in metadata.value. |
|
|
|
|
// * `error` - Error associated with the long-running operation. |
|
|
|
@ -609,7 +664,8 @@ message ListDatabaseOperationsRequest { |
|
|
|
|
// `(metadata.name:restored_howl) AND` \ |
|
|
|
|
// `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \ |
|
|
|
|
// `(error:*)` - Return operations where: |
|
|
|
|
// * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. |
|
|
|
|
// * The operation's metadata type is |
|
|
|
|
// [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. |
|
|
|
|
// * The database is restored from a backup. |
|
|
|
|
// * The backup name contains "backup_howl". |
|
|
|
|
// * The restored database's name contains "restored_howl". |
|
|
|
@ -623,8 +679,9 @@ message ListDatabaseOperationsRequest { |
|
|
|
|
|
|
|
|
|
// If non-empty, `page_token` should contain a |
|
|
|
|
// [next_page_token][google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token] |
|
|
|
|
// from a previous [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] to the |
|
|
|
|
// same `parent` and with the same `filter`. |
|
|
|
|
// from a previous |
|
|
|
|
// [ListDatabaseOperationsResponse][google.spanner.admin.database.v1.ListDatabaseOperationsResponse] |
|
|
|
|
// to the same `parent` and with the same `filter`. |
|
|
|
|
string page_token = 4; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -670,9 +727,54 @@ message RestoreDatabaseRequest { |
|
|
|
|
// Name of the backup from which to restore. Values are of the form |
|
|
|
|
// `projects/<project>/instances/<instance>/backups/<backup>`. |
|
|
|
|
string backup = 3 [(google.api.resource_reference) = { |
|
|
|
|
type: "spanner.googleapis.com/Backup" |
|
|
|
|
}]; |
|
|
|
|
type: "spanner.googleapis.com/Backup" |
|
|
|
|
}]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Optional. An encryption configuration describing the encryption type and |
|
|
|
|
// key resources in Cloud KMS used to encrypt/decrypt the database to restore |
|
|
|
|
// to. If this field is not specified, the restored database will use the same |
|
|
|
|
// encryption configuration as the backup by default, namely |
|
|
|
|
// [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] |
|
|
|
|
// = `USE_CONFIG_DEFAULT_OR_DATABASE_ENCRYPTION`. |
|
|
|
|
RestoreDatabaseEncryptionConfig encryption_config = 4 |
|
|
|
|
[(google.api.field_behavior) = OPTIONAL]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Encryption configuration for the restored database. |
|
|
|
|
message RestoreDatabaseEncryptionConfig { |
|
|
|
|
// Encryption types for the database to be restored. |
|
|
|
|
enum EncryptionType { |
|
|
|
|
// Unspecified. Do not use. |
|
|
|
|
ENCRYPTION_TYPE_UNSPECIFIED = 0; |
|
|
|
|
|
|
|
|
|
// This is the default option when |
|
|
|
|
// [encryption_config][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig] |
|
|
|
|
// is not specified. |
|
|
|
|
USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1; |
|
|
|
|
|
|
|
|
|
// Use Google default encryption. |
|
|
|
|
GOOGLE_DEFAULT_ENCRYPTION = 2; |
|
|
|
|
|
|
|
|
|
// Use customer managed encryption. If specified, `kms_key_name` must |
|
|
|
|
// must contain a valid Cloud KMS key. |
|
|
|
|
CUSTOMER_MANAGED_ENCRYPTION = 3; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Required. The encryption type of the restored database. |
|
|
|
|
EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED]; |
|
|
|
|
|
|
|
|
|
// Optional. The Cloud KMS key that will be used to encrypt/decrypt the |
|
|
|
|
// restored database. This field should be set only when |
|
|
|
|
// [encryption_type][google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type] |
|
|
|
|
// is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form |
|
|
|
|
// `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`. |
|
|
|
|
string kms_key_name = 2 [ |
|
|
|
|
(google.api.field_behavior) = OPTIONAL, |
|
|
|
|
(google.api.resource_reference) = { |
|
|
|
|
type: "cloudkms.googleapis.com/CryptoKey" |
|
|
|
|
} |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Metadata type for the long-running operation returned by |
|
|
|
@ -680,14 +782,15 @@ message RestoreDatabaseRequest { |
|
|
|
|
message RestoreDatabaseMetadata { |
|
|
|
|
// Name of the database being created and restored to. |
|
|
|
|
string name = 1 [(google.api.resource_reference) = { |
|
|
|
|
type: "spanner.googleapis.com/Database" |
|
|
|
|
}]; |
|
|
|
|
type: "spanner.googleapis.com/Database" |
|
|
|
|
}]; |
|
|
|
|
|
|
|
|
|
// The type of the restore source. |
|
|
|
|
RestoreSourceType source_type = 2; |
|
|
|
|
|
|
|
|
|
// Information about the source used to restore the database, as specified by |
|
|
|
|
// `source` in [RestoreDatabaseRequest][google.spanner.admin.database.v1.RestoreDatabaseRequest]. |
|
|
|
|
// `source` in |
|
|
|
|
// [RestoreDatabaseRequest][google.spanner.admin.database.v1.RestoreDatabaseRequest]. |
|
|
|
|
oneof source_info { |
|
|
|
|
// Information about the backup used to restore the database. |
|
|
|
|
BackupInfo backup_info = 3; |
|
|
|
@ -708,7 +811,8 @@ message RestoreDatabaseMetadata { |
|
|
|
|
// operation completed despite cancellation. On successful cancellation, |
|
|
|
|
// the operation is not deleted; instead, it becomes an operation with |
|
|
|
|
// an [Operation.error][google.longrunning.Operation.error] value with a |
|
|
|
|
// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. |
|
|
|
|
// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to |
|
|
|
|
// `Code.CANCELLED`. |
|
|
|
|
google.protobuf.Timestamp cancel_time = 5; |
|
|
|
|
|
|
|
|
|
// If exists, the name of the long-running operation that will be used to |
|
|
|
@ -718,10 +822,10 @@ message RestoreDatabaseMetadata { |
|
|
|
|
// `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>` |
|
|
|
|
// where the <database> is the name of database being created and restored to. |
|
|
|
|
// The metadata type of the long-running operation is |
|
|
|
|
// [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. This long-running operation will be |
|
|
|
|
// automatically created by the system after the RestoreDatabase long-running |
|
|
|
|
// operation completes successfully. This operation will not be created if the |
|
|
|
|
// restore was not successful. |
|
|
|
|
// [OptimizeRestoredDatabaseMetadata][google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata]. |
|
|
|
|
// This long-running operation will be automatically created by the system |
|
|
|
|
// after the RestoreDatabase long-running operation completes successfully. |
|
|
|
|
// This operation will not be created if the restore was not successful. |
|
|
|
|
string optimize_database_operation_name = 6; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -732,8 +836,8 @@ message RestoreDatabaseMetadata { |
|
|
|
|
message OptimizeRestoredDatabaseMetadata { |
|
|
|
|
// Name of the restored database being optimized. |
|
|
|
|
string name = 1 [(google.api.resource_reference) = { |
|
|
|
|
type: "spanner.googleapis.com/Database" |
|
|
|
|
}]; |
|
|
|
|
type: "spanner.googleapis.com/Database" |
|
|
|
|
}]; |
|
|
|
|
|
|
|
|
|
// The progress of the post-restore optimizations. |
|
|
|
|
OperationProgress progress = 2; |
|
|
|
|