Skip to content

Commit 1f80a39

Browse files
chore: add support for commit stats and PITR (via synth) (#204)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/3b4457c8-4080-407a-9a6d-4a48ddcea154/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 354996675 Source-Link: googleapis/googleapis@20712b8 PiperOrigin-RevId: 352816749 Source-Link: googleapis/googleapis@ceaaf31 PiperOrigin-RevId: 350246057 Source-Link: googleapis/googleapis@5206824
1 parent 05c3ad9 commit 1f80a39

File tree

34 files changed

+1881
-1437
lines changed

34 files changed

+1881
-1437
lines changed

google/cloud/spanner_admin_database_v1/proto/backup.proto

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ message Backup {
6161
type: "spanner.googleapis.com/Database"
6262
}];
6363

64+
// The backup will contain an externally consistent copy of the database at
65+
// the timestamp specified by `version_time`. If `version_time` is not
66+
// specified, the system will set `version_time` to the `create_time` of the
67+
// backup.
68+
google.protobuf.Timestamp version_time = 9;
69+
6470
// Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
6571
// operation. The expiration time of the backup, with microseconds
6672
// granularity that must be at least 6 hours and at most 366 days
@@ -84,10 +90,9 @@ message Backup {
8490
// `projects/<project>/instances/<instance>`.
8591
string name = 1;
8692

87-
// Output only. The backup will contain an externally consistent
88-
// copy of the database at the timestamp specified by
89-
// `create_time`. `create_time` is approximately the time the
90-
// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request is received.
93+
// Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
94+
// request is received. If the request does not specify `version_time`, the
95+
// `version_time` of the backup will be equivalent to the `create_time`.
9196
google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
9297

9398
// Output only. Size of the backup in bytes.
@@ -134,10 +139,14 @@ message CreateBackupRequest {
134139
// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
135140
message CreateBackupMetadata {
136141
// The name of the backup being created.
137-
string name = 1;
142+
string name = 1 [(google.api.resource_reference) = {
143+
type: "spanner.googleapis.com/Backup"
144+
}];
138145

139146
// The name of the database the backup is created from.
140-
string database = 2;
147+
string database = 2 [(google.api.resource_reference) = {
148+
type: "spanner.googleapis.com/Database"
149+
}];
141150

142151
// The progress of the
143152
// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
@@ -311,9 +320,9 @@ message ListBackupOperationsRequest {
311320
// * `done:true` - The operation is complete.
312321
// * `metadata.database:prod` - The database the backup was taken from has
313322
// a name containing the string "prod".
314-
// * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` <br/>
315-
// `(metadata.name:howl) AND` <br/>
316-
// `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
323+
// * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
324+
// `(metadata.name:howl) AND` \
325+
// `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
317326
// `(error:*)` - Returns operations where:
318327
// * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
319328
// * The backup name contains the string "howl".
@@ -355,12 +364,23 @@ message ListBackupOperationsResponse {
355364
// Information about a backup.
356365
message BackupInfo {
357366
// Name of the backup.
358-
string backup = 1;
367+
string backup = 1 [(google.api.resource_reference) = {
368+
type: "spanner.googleapis.com/Backup"
369+
}];
359370

360371
// The backup contains an externally consistent copy of `source_database` at
361-
// the timestamp specified by `create_time`.
372+
// the timestamp specified by `version_time`. If the
373+
// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
374+
// `version_time`, the `version_time` of the backup is equivalent to the
375+
// `create_time`.
376+
google.protobuf.Timestamp version_time = 4;
377+
378+
// The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
379+
// received.
362380
google.protobuf.Timestamp create_time = 2;
363381

364382
// Name of the database the backup was created from.
365-
string source_database = 3;
383+
string source_database = 3 [(google.api.resource_reference) = {
384+
type: "spanner.googleapis.com/Database"
385+
}];
366386
}

google/cloud/spanner_admin_database_v1/proto/spanner_database_admin.proto

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,17 @@ message Database {
368368
// Output only. Applicable only for restored databases. Contains information
369369
// about the restore source.
370370
RestoreInfo restore_info = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
371+
372+
// Output only. The period in which Cloud Spanner retains all versions of data
373+
// for the database. This is the same as the value of version_retention_period
374+
// database option set using
375+
// [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl]. Defaults to 1 hour,
376+
// if not set.
377+
string version_retention_period = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
378+
379+
// Output only. Earliest timestamp at which older versions of the data can be
380+
// read.
381+
google.protobuf.Timestamp earliest_version_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
371382
}
372383

373384
// The request for [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases].
@@ -535,6 +546,8 @@ message DropDatabaseRequest {
535546
// The request for [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl].
536547
message GetDatabaseDdlRequest {
537548
// Required. The database whose schema we wish to get.
549+
// Values are of the form
550+
// `projects/<project>/instances/<instance>/databases/<database>`
538551
string database = 1 [
539552
(google.api.field_behavior) = REQUIRED,
540553
(google.api.resource_reference) = {
@@ -590,11 +603,11 @@ message ListDatabaseOperationsRequest {
590603
// Here are a few examples:
591604
//
592605
// * `done:true` - The operation is complete.
593-
// * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` <br/>
594-
// `(metadata.source_type:BACKUP) AND` <br/>
595-
// `(metadata.backup_info.backup:backup_howl) AND` <br/>
596-
// `(metadata.name:restored_howl) AND` <br/>
597-
// `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` <br/>
606+
// * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \
607+
// `(metadata.source_type:BACKUP) AND` \
608+
// `(metadata.backup_info.backup:backup_howl) AND` \
609+
// `(metadata.name:restored_howl) AND` \
610+
// `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
598611
// `(error:*)` - Return operations where:
599612
// * The operation's metadata type is [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
600613
// * The database is restored from a backup.
@@ -666,7 +679,9 @@ message RestoreDatabaseRequest {
666679
// [RestoreDatabase][google.spanner.admin.database.v1.DatabaseAdmin.RestoreDatabase].
667680
message RestoreDatabaseMetadata {
668681
// Name of the database being created and restored to.
669-
string name = 1;
682+
string name = 1 [(google.api.resource_reference) = {
683+
type: "spanner.googleapis.com/Database"
684+
}];
670685

671686
// The type of the restore source.
672687
RestoreSourceType source_type = 2;
@@ -716,7 +731,9 @@ message RestoreDatabaseMetadata {
716731
// completion of a database restore, and cannot be cancelled.
717732
message OptimizeRestoredDatabaseMetadata {
718733
// Name of the restored database being optimized.
719-
string name = 1;
734+
string name = 1 [(google.api.resource_reference) = {
735+
type: "spanner.googleapis.com/Database"
736+
}];
720737

721738
// The progress of the post-restore optimizations.
722739
OperationProgress progress = 2;

0 commit comments

Comments
 (0)