Skip to content

Commit 3b236df

Browse files
Google APIscopybara-github
authored andcommitted
feat(spanner): add progress field to UpdateDatabaseDdlMetadata
PiperOrigin-RevId: 368426665
1 parent 48cb02d commit 3b236df

6 files changed

Lines changed: 228 additions & 242 deletions

File tree

google/spanner/admin/database/v1/backup.proto

Lines changed: 68 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import "google/longrunning/operations.proto";
2222
import "google/protobuf/field_mask.proto";
2323
import "google/protobuf/timestamp.proto";
2424
import "google/spanner/admin/database/v1/common.proto";
25+
import "google/api/annotations.proto";
2526

2627
option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1";
2728
option go_package = "google.golang.org/genproto/googleapis/spanner/admin/database/v1;database";
@@ -51,35 +52,31 @@ message Backup {
5152
READY = 2;
5253
}
5354

54-
// Required for the
55-
// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
56-
// operation. Name of the database from which this backup was created. This
57-
// needs to be in the same instance as the backup. Values are of the form
55+
// Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
56+
// Name of the database from which this backup was
57+
// created. This needs to be in the same instance as the backup.
58+
// Values are of the form
5859
// `projects/<project>/instances/<instance>/databases/<database>`.
5960
string database = 2 [(google.api.resource_reference) = {
60-
type: "spanner.googleapis.com/Database"
61-
}];
61+
type: "spanner.googleapis.com/Database"
62+
}];
6263

6364
// The backup will contain an externally consistent copy of the database at
6465
// the timestamp specified by `version_time`. If `version_time` is not
6566
// specified, the system will set `version_time` to the `create_time` of the
6667
// backup.
6768
google.protobuf.Timestamp version_time = 9;
6869

69-
// Required for the
70-
// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
70+
// Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
7171
// operation. The expiration time of the backup, with microseconds
7272
// granularity that must be at least 6 hours and at most 366 days
7373
// from the time the CreateBackup request is processed. Once the `expire_time`
7474
// has passed, the backup is eligible to be automatically deleted by Cloud
7575
// Spanner to free the resources used by the backup.
7676
google.protobuf.Timestamp expire_time = 3;
7777

78-
// Output only for the
79-
// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
80-
// operation. Required for the
81-
// [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup]
82-
// operation.
78+
// Output only for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
79+
// Required for the [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] operation.
8380
//
8481
// A globally unique identifier for the backup which cannot be
8582
// changed. Values are of the form
@@ -93,12 +90,10 @@ message Backup {
9390
// `projects/<project>/instances/<instance>`.
9491
string name = 1;
9592

96-
// Output only. The time the
97-
// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
93+
// Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
9894
// request is received. If the request does not specify `version_time`, the
9995
// `version_time` of the backup will be equivalent to the `create_time`.
100-
google.protobuf.Timestamp create_time = 4
101-
[(google.api.field_behavior) = OUTPUT_ONLY];
96+
google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
10297

10398
// Output only. Size of the backup in bytes.
10499
int64 size_bytes = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
@@ -121,12 +116,10 @@ message Backup {
121116
];
122117

123118
// Output only. The encryption information for the backup.
124-
EncryptionInfo encryption_info = 8
125-
[(google.api.field_behavior) = OUTPUT_ONLY];
119+
EncryptionInfo encryption_info = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
126120
}
127121

128-
// The request for
129-
// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
122+
// The request for [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
130123
message CreateBackupRequest {
131124
// Required. The name of the instance in which the backup will be
132125
// created. This must be the same instance that contains the database the
@@ -149,31 +142,29 @@ message CreateBackupRequest {
149142
// Required. The backup to create.
150143
Backup backup = 3 [(google.api.field_behavior) = REQUIRED];
151144

152-
// Optional. The encryption configuration used to encrypt the backup. If this
153-
// field is not specified, the backup will use the same encryption
154-
// configuration as the database by default, namely
155-
// [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type]
156-
// = `USE_DATABASE_ENCRYPTION`.
157-
CreateBackupEncryptionConfig encryption_config = 4
158-
[(google.api.field_behavior) = OPTIONAL];
145+
// Optional. The encryption configuration used to encrypt the backup. If this field is
146+
// not specified, the backup will use the same
147+
// encryption configuration as the database by default, namely
148+
// [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] =
149+
// `USE_DATABASE_ENCRYPTION`.
150+
CreateBackupEncryptionConfig encryption_config = 4 [(google.api.field_behavior) = OPTIONAL];
159151
}
160152

161153
// Metadata type for the operation returned by
162154
// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
163155
message CreateBackupMetadata {
164156
// The name of the backup being created.
165-
string name = 1 [
166-
(google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
167-
];
157+
string name = 1 [(google.api.resource_reference) = {
158+
type: "spanner.googleapis.com/Backup"
159+
}];
168160

169161
// The name of the database the backup is created from.
170162
string database = 2 [(google.api.resource_reference) = {
171-
type: "spanner.googleapis.com/Database"
172-
}];
163+
type: "spanner.googleapis.com/Database"
164+
}];
173165

174166
// The progress of the
175-
// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
176-
// operation.
167+
// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
177168
OperationProgress progress = 3;
178169

179170
// The time at which cancellation of this operation was received.
@@ -191,8 +182,7 @@ message CreateBackupMetadata {
191182
google.protobuf.Timestamp cancel_time = 4;
192183
}
193184

194-
// The request for
195-
// [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup].
185+
// The request for [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup].
196186
message UpdateBackupRequest {
197187
// Required. The backup to update. `backup.name`, and the fields to be updated
198188
// as specified by `update_mask` are required. Other fields are ignored.
@@ -205,36 +195,36 @@ message UpdateBackupRequest {
205195
// resource, not to the request message. The field mask must always be
206196
// specified; this prevents any future fields from being erased accidentally
207197
// by clients that do not know about them.
208-
google.protobuf.FieldMask update_mask = 2
209-
[(google.api.field_behavior) = REQUIRED];
198+
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
210199
}
211200

212-
// The request for
213-
// [GetBackup][google.spanner.admin.database.v1.DatabaseAdmin.GetBackup].
201+
// The request for [GetBackup][google.spanner.admin.database.v1.DatabaseAdmin.GetBackup].
214202
message GetBackupRequest {
215203
// Required. Name of the backup.
216204
// Values are of the form
217205
// `projects/<project>/instances/<instance>/backups/<backup>`.
218206
string name = 1 [
219207
(google.api.field_behavior) = REQUIRED,
220-
(google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
208+
(google.api.resource_reference) = {
209+
type: "spanner.googleapis.com/Backup"
210+
}
221211
];
222212
}
223213

224-
// The request for
225-
// [DeleteBackup][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup].
214+
// The request for [DeleteBackup][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup].
226215
message DeleteBackupRequest {
227216
// Required. Name of the backup to delete.
228217
// Values are of the form
229218
// `projects/<project>/instances/<instance>/backups/<backup>`.
230219
string name = 1 [
231220
(google.api.field_behavior) = REQUIRED,
232-
(google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
221+
(google.api.resource_reference) = {
222+
type: "spanner.googleapis.com/Backup"
223+
}
233224
];
234225
}
235226

236-
// The request for
237-
// [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
227+
// The request for [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
238228
message ListBackupsRequest {
239229
// Required. The instance to list backups from. Values are of the
240230
// form `projects/<project>/instances/<instance>`.
@@ -253,9 +243,7 @@ message ListBackupsRequest {
253243
// must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
254244
// Colon `:` is the contains operator. Filter rules are not case sensitive.
255245
//
256-
// The following fields in the
257-
// [Backup][google.spanner.admin.database.v1.Backup] are eligible for
258-
// filtering:
246+
// The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering:
259247
//
260248
// * `name`
261249
// * `database`
@@ -289,23 +277,21 @@ message ListBackupsRequest {
289277
int32 page_size = 3;
290278

291279
// If non-empty, `page_token` should contain a
292-
// [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token]
293-
// from a previous
294-
// [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse]
295-
// to the same `parent` and with the same `filter`.
280+
// [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] from a
281+
// previous [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] to the same `parent` and with the same
282+
// `filter`.
296283
string page_token = 4;
297284
}
298285

299-
// The response for
300-
// [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
286+
// The response for [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
301287
message ListBackupsResponse {
302288
// The list of matching backups. Backups returned are ordered by `create_time`
303289
// in descending order, starting from the most recent `create_time`.
304290
repeated Backup backups = 1;
305291

306292
// `next_page_token` can be sent in a subsequent
307-
// [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups]
308-
// call to fetch more of the matching backups.
293+
// [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] call to fetch more
294+
// of the matching backups.
309295
string next_page_token = 2;
310296
}
311297

@@ -335,9 +321,7 @@ message ListBackupOperationsRequest {
335321
// * `name` - The name of the long-running operation
336322
// * `done` - False if the operation is in progress, else true.
337323
// * `metadata.@type` - the type of metadata. For example, the type string
338-
// for
339-
// [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]
340-
// is
324+
// for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is
341325
// `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
342326
// * `metadata.<field_name>` - any field in metadata.value.
343327
// * `error` - Error associated with the long-running operation.
@@ -357,8 +341,7 @@ message ListBackupOperationsRequest {
357341
// `(metadata.name:howl) AND` \
358342
// `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
359343
// `(error:*)` - Returns operations where:
360-
// * The operation's metadata type is
361-
// [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
344+
// * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
362345
// * The backup name contains the string "howl".
363346
// * The operation started before 2018-03-28T14:50:00Z.
364347
// * The operation resulted in an error.
@@ -370,9 +353,8 @@ message ListBackupOperationsRequest {
370353

371354
// If non-empty, `page_token` should contain a
372355
// [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token]
373-
// from a previous
374-
// [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse]
375-
// to the same `parent` and with the same `filter`.
356+
// from a previous [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] to the
357+
// same `parent` and with the same `filter`.
376358
string page_token = 4;
377359
}
378360

@@ -383,11 +365,11 @@ message ListBackupOperationsResponse {
383365
// operations][google.longrunning.Operation]. Each operation's name will be
384366
// prefixed by the backup's name and the operation's
385367
// [metadata][google.longrunning.Operation.metadata] will be of type
386-
// [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
387-
// Operations returned include those that are pending or have
388-
// completed/failed/canceled within the last 7 days. Operations returned are
389-
// ordered by `operation.metadata.value.progress.start_time` in descending
390-
// order starting from the most recently started operation.
368+
// [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. Operations returned include those that are
369+
// pending or have completed/failed/canceled within the last 7 days.
370+
// Operations returned are ordered by
371+
// `operation.metadata.value.progress.start_time` in descending order starting
372+
// from the most recently started operation.
391373
repeated google.longrunning.Operation operations = 1;
392374

393375
// `next_page_token` can be sent in a subsequent
@@ -399,26 +381,25 @@ message ListBackupOperationsResponse {
399381
// Information about a backup.
400382
message BackupInfo {
401383
// Name of the backup.
402-
string backup = 1 [
403-
(google.api.resource_reference) = { type: "spanner.googleapis.com/Backup" }
404-
];
384+
string backup = 1 [(google.api.resource_reference) = {
385+
type: "spanner.googleapis.com/Backup"
386+
}];
405387

406388
// The backup contains an externally consistent copy of `source_database` at
407389
// the timestamp specified by `version_time`. If the
408-
// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
409-
// request did not specify `version_time`, the `version_time` of the backup is
410-
// equivalent to the `create_time`.
390+
// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
391+
// `version_time`, the `version_time` of the backup is equivalent to the
392+
// `create_time`.
411393
google.protobuf.Timestamp version_time = 4;
412394

413-
// The time the
414-
// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
415-
// request was received.
395+
// The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
396+
// received.
416397
google.protobuf.Timestamp create_time = 2;
417398

418399
// Name of the database the backup was created from.
419400
string source_database = 3 [(google.api.resource_reference) = {
420-
type: "spanner.googleapis.com/Database"
421-
}];
401+
type: "spanner.googleapis.com/Database"
402+
}];
422403
}
423404

424405
// Encryption configuration for the backup to create.
@@ -430,10 +411,9 @@ message CreateBackupEncryptionConfig {
430411

431412
// Use the same encryption configuration as the database. This is the
432413
// default option when
433-
// [encryption_config][google.spanner.admin.database.v1.CreateBackupEncryptionConfig]
434-
// is empty. For example, if the database is using
435-
// `Customer_Managed_Encryption`, the backup will be using the same Cloud
436-
// KMS key as the database.
414+
// [encryption_config][google.spanner.admin.database.v1.CreateBackupEncryptionConfig] is empty.
415+
// For example, if the database is using `Customer_Managed_Encryption`, the
416+
// backup will be using the same Cloud KMS key as the database.
437417
USE_DATABASE_ENCRYPTION = 1;
438418

439419
// Use Google default encryption.
@@ -449,8 +429,8 @@ message CreateBackupEncryptionConfig {
449429

450430
// Optional. The Cloud KMS key that will be used to protect the backup.
451431
// This field should be set only when
452-
// [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type]
453-
// is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
432+
// [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] is
433+
// `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
454434
// `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
455435
string kms_key_name = 2 [
456436
(google.api.field_behavior) = OPTIONAL,

google/spanner/admin/database/v1/common.proto

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import "google/api/field_behavior.proto";
2020
import "google/api/resource.proto";
2121
import "google/protobuf/timestamp.proto";
2222
import "google/rpc/status.proto";
23+
import "google/api/annotations.proto";
2324

2425
option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1";
2526
option go_package = "google.golang.org/genproto/googleapis/spanner/admin/database/v1;database";
@@ -58,8 +59,8 @@ message EncryptionConfig {
5859
// the database. Values are of the form
5960
// `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
6061
string kms_key_name = 2 [(google.api.resource_reference) = {
61-
type: "cloudkms.googleapis.com/CryptoKey"
62-
}];
62+
type: "cloudkms.googleapis.com/CryptoKey"
63+
}];
6364
}
6465

6566
// Encryption information for a Cloud Spanner database or backup.
@@ -83,14 +84,13 @@ message EncryptionInfo {
8384
// Output only. The type of encryption.
8485
Type encryption_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
8586

86-
// Output only. If present, the status of a recent encrypt/decrypt call on
87-
// underlying data for this database or backup. Regardless of status, data is
88-
// always encrypted at rest.
89-
google.rpc.Status encryption_status = 4
90-
[(google.api.field_behavior) = OUTPUT_ONLY];
87+
// Output only. If present, the status of a recent encrypt/decrypt call on underlying data
88+
// for this database or backup. Regardless of status, data is always encrypted
89+
// at rest.
90+
google.rpc.Status encryption_status = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
9191

92-
// Output only. A Cloud KMS key version that is being used to protect the
93-
// database or backup.
92+
// Output only. A Cloud KMS key version that is being used to protect the database or
93+
// backup.
9494
string kms_key_version = 2 [
9595
(google.api.field_behavior) = OUTPUT_ONLY,
9696
(google.api.resource_reference) = {

0 commit comments

Comments
 (0)