xref: /aosp_15_r20/external/googleapis/google/spanner/admin/database/v1/backup.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2022 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
15syntax = "proto3";
16
17package google.spanner.admin.database.v1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/longrunning/operations.proto";
22import "google/protobuf/field_mask.proto";
23import "google/protobuf/timestamp.proto";
24import "google/spanner/admin/database/v1/common.proto";
25
26option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1";
27option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb";
28option java_multiple_files = true;
29option java_outer_classname = "BackupProto";
30option java_package = "com.google.spanner.admin.database.v1";
31option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1";
32option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1";
33
34// A backup of a Cloud Spanner database.
35message Backup {
36  option (google.api.resource) = {
37    type: "spanner.googleapis.com/Backup"
38    pattern: "projects/{project}/instances/{instance}/backups/{backup}"
39  };
40
41  // Indicates the current state of the backup.
42  enum State {
43    // Not specified.
44    STATE_UNSPECIFIED = 0;
45
46    // The pending backup is still being created. Operations on the
47    // backup may fail with `FAILED_PRECONDITION` in this state.
48    CREATING = 1;
49
50    // The backup is complete and ready for use.
51    READY = 2;
52  }
53
54  // Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
55  // Name of the database from which this backup was
56  // created. This needs to be in the same instance as the backup.
57  // Values are of the form
58  // `projects/<project>/instances/<instance>/databases/<database>`.
59  string database = 2 [(google.api.resource_reference) = {
60                         type: "spanner.googleapis.com/Database"
61                       }];
62
63  // The backup will contain an externally consistent copy of the database at
64  // the timestamp specified by `version_time`. If `version_time` is not
65  // specified, the system will set `version_time` to the `create_time` of the
66  // backup.
67  google.protobuf.Timestamp version_time = 9;
68
69  // Required for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
70  // operation. The expiration time of the backup, with microseconds
71  // granularity that must be at least 6 hours and at most 366 days
72  // from the time the CreateBackup request is processed. Once the `expire_time`
73  // has passed, the backup is eligible to be automatically deleted by Cloud
74  // Spanner to free the resources used by the backup.
75  google.protobuf.Timestamp expire_time = 3;
76
77  // Output only for the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
78  // Required for the [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup] operation.
79  //
80  // A globally unique identifier for the backup which cannot be
81  // changed. Values are of the form
82  // `projects/<project>/instances/<instance>/backups/[a-z][a-z0-9_\-]*[a-z0-9]`
83  // The final segment of the name must be between 2 and 60 characters
84  // in length.
85  //
86  // The backup is stored in the location(s) specified in the instance
87  // configuration of the instance containing the backup, identified
88  // by the prefix of the backup name of the form
89  // `projects/<project>/instances/<instance>`.
90  string name = 1;
91
92  // Output only. The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
93  // request is received. If the request does not specify `version_time`, the
94  // `version_time` of the backup will be equivalent to the `create_time`.
95  google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
96
97  // Output only. Size of the backup in bytes.
98  int64 size_bytes = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
99
100  // Output only. The current state of the backup.
101  State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
102
103  // Output only. The names of the restored databases that reference the backup.
104  // The database names are of
105  // the form `projects/<project>/instances/<instance>/databases/<database>`.
106  // Referencing databases may exist in different instances. The existence of
107  // any referencing database prevents the backup from being deleted. When a
108  // restored database from the backup enters the `READY` state, the reference
109  // to the backup is removed.
110  repeated string referencing_databases = 7 [
111    (google.api.field_behavior) = OUTPUT_ONLY,
112    (google.api.resource_reference) = {
113      type: "spanner.googleapis.com/Database"
114    }
115  ];
116
117  // Output only. The encryption information for the backup.
118  EncryptionInfo encryption_info = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
119
120  // Output only. The database dialect information for the backup.
121  DatabaseDialect database_dialect = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
122
123  // Output only. The names of the destination backups being created by copying
124  // this source backup. The backup names are of the form
125  // `projects/<project>/instances/<instance>/backups/<backup>`.
126  // Referencing backups may exist in different instances. The existence of
127  // any referencing backup prevents the backup from being deleted. When the
128  // copy operation is done (either successfully completed or cancelled or the
129  // destination backup is deleted), the reference to the backup is removed.
130  repeated string referencing_backups = 11 [
131    (google.api.field_behavior) = OUTPUT_ONLY,
132    (google.api.resource_reference) = {
133      type: "spanner.googleapis.com/Backup"
134    }
135  ];
136
137  // Output only. The max allowed expiration time of the backup, with
138  // microseconds granularity. A backup's expiration time can be configured in
139  // multiple APIs: CreateBackup, UpdateBackup, CopyBackup. When updating or
140  // copying an existing backup, the expiration time specified must be
141  // less than `Backup.max_expire_time`.
142  google.protobuf.Timestamp max_expire_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
143}
144
145// The request for [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
146message CreateBackupRequest {
147  // Required. The name of the instance in which the backup will be
148  // created. This must be the same instance that contains the database the
149  // backup will be created from. The backup will be stored in the
150  // location(s) specified in the instance configuration of this
151  // instance. Values are of the form
152  // `projects/<project>/instances/<instance>`.
153  string parent = 1 [
154    (google.api.field_behavior) = REQUIRED,
155    (google.api.resource_reference) = {
156      type: "spanner.googleapis.com/Instance"
157    }
158  ];
159
160  // Required. The id of the backup to be created. The `backup_id` appended to
161  // `parent` forms the full backup name of the form
162  // `projects/<project>/instances/<instance>/backups/<backup_id>`.
163  string backup_id = 2 [(google.api.field_behavior) = REQUIRED];
164
165  // Required. The backup to create.
166  Backup backup = 3 [(google.api.field_behavior) = REQUIRED];
167
168  // Optional. The encryption configuration used to encrypt the backup. If this field is
169  // not specified, the backup will use the same
170  // encryption configuration as the database by default, namely
171  // [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] =
172  // `USE_DATABASE_ENCRYPTION`.
173  CreateBackupEncryptionConfig encryption_config = 4 [(google.api.field_behavior) = OPTIONAL];
174}
175
176// Metadata type for the operation returned by
177// [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
178message CreateBackupMetadata {
179  // The name of the backup being created.
180  string name = 1 [(google.api.resource_reference) = {
181                     type: "spanner.googleapis.com/Backup"
182                   }];
183
184  // The name of the database the backup is created from.
185  string database = 2 [(google.api.resource_reference) = {
186                         type: "spanner.googleapis.com/Database"
187                       }];
188
189  // The progress of the
190  // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] operation.
191  OperationProgress progress = 3;
192
193  // The time at which cancellation of this operation was received.
194  // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
195  // starts asynchronous cancellation on a long-running operation. The server
196  // makes a best effort to cancel the operation, but success is not guaranteed.
197  // Clients can use
198  // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
199  // other methods to check whether the cancellation succeeded or whether the
200  // operation completed despite cancellation. On successful cancellation,
201  // the operation is not deleted; instead, it becomes an operation with
202  // an [Operation.error][google.longrunning.Operation.error] value with a
203  // [google.rpc.Status.code][google.rpc.Status.code] of 1,
204  // corresponding to `Code.CANCELLED`.
205  google.protobuf.Timestamp cancel_time = 4;
206}
207
208// The request for [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup].
209message CopyBackupRequest {
210  // Required. The name of the destination instance that will contain the backup copy.
211  // Values are of the form: `projects/<project>/instances/<instance>`.
212  string parent = 1 [
213    (google.api.field_behavior) = REQUIRED,
214    (google.api.resource_reference) = {
215      type: "spanner.googleapis.com/Instance"
216    }
217  ];
218
219  // Required. The id of the backup copy.
220  // The `backup_id` appended to `parent` forms the full backup_uri of the form
221  // `projects/<project>/instances/<instance>/backups/<backup>`.
222  string backup_id = 2 [(google.api.field_behavior) = REQUIRED];
223
224  // Required. The source backup to be copied.
225  // The source backup needs to be in READY state for it to be copied.
226  // Once CopyBackup is in progress, the source backup cannot be deleted or
227  // cleaned up on expiration until CopyBackup is finished.
228  // Values are of the form:
229  // `projects/<project>/instances/<instance>/backups/<backup>`.
230  string source_backup = 3 [
231    (google.api.field_behavior) = REQUIRED,
232    (google.api.resource_reference) = {
233      type: "spanner.googleapis.com/Backup"
234    }
235  ];
236
237  // Required. The expiration time of the backup in microsecond granularity.
238  // The expiration time must be at least 6 hours and at most 366 days
239  // from the `create_time` of the source backup. Once the `expire_time` has
240  // passed, the backup is eligible to be automatically deleted by Cloud Spanner
241  // to free the resources used by the backup.
242  google.protobuf.Timestamp expire_time = 4 [(google.api.field_behavior) = REQUIRED];
243
244  // Optional. The encryption configuration used to encrypt the backup. If this field is
245  // not specified, the backup will use the same
246  // encryption configuration as the source backup by default, namely
247  // [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] =
248  // `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
249  CopyBackupEncryptionConfig encryption_config = 5 [(google.api.field_behavior) = OPTIONAL];
250}
251
252// Metadata type for the google.longrunning.Operation returned by
253// [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup].
254message CopyBackupMetadata {
255  // The name of the backup being created through the copy operation.
256  // Values are of the form
257  // `projects/<project>/instances/<instance>/backups/<backup>`.
258  string name = 1 [(google.api.resource_reference) = {
259                     type: "spanner.googleapis.com/Backup"
260                   }];
261
262  // The name of the source backup that is being copied.
263  // Values are of the form
264  // `projects/<project>/instances/<instance>/backups/<backup>`.
265  string source_backup = 2 [(google.api.resource_reference) = {
266                              type: "spanner.googleapis.com/Backup"
267                            }];
268
269  // The progress of the
270  // [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup] operation.
271  OperationProgress progress = 3;
272
273  // The time at which cancellation of CopyBackup operation was received.
274  // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
275  // starts asynchronous cancellation on a long-running operation. The server
276  // makes a best effort to cancel the operation, but success is not guaranteed.
277  // Clients can use
278  // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
279  // other methods to check whether the cancellation succeeded or whether the
280  // operation completed despite cancellation. On successful cancellation,
281  // the operation is not deleted; instead, it becomes an operation with
282  // an [Operation.error][google.longrunning.Operation.error] value with a
283  // [google.rpc.Status.code][google.rpc.Status.code] of 1,
284  // corresponding to `Code.CANCELLED`.
285  google.protobuf.Timestamp cancel_time = 4;
286}
287
288// The request for [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup].
289message UpdateBackupRequest {
290  // Required. The backup to update. `backup.name`, and the fields to be updated
291  // as specified by `update_mask` are required. Other fields are ignored.
292  // Update is only supported for the following fields:
293  //  * `backup.expire_time`.
294  Backup backup = 1 [(google.api.field_behavior) = REQUIRED];
295
296  // Required. A mask specifying which fields (e.g. `expire_time`) in the
297  // Backup resource should be updated. This mask is relative to the Backup
298  // resource, not to the request message. The field mask must always be
299  // specified; this prevents any future fields from being erased accidentally
300  // by clients that do not know about them.
301  google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
302}
303
304// The request for [GetBackup][google.spanner.admin.database.v1.DatabaseAdmin.GetBackup].
305message GetBackupRequest {
306  // Required. Name of the backup.
307  // Values are of the form
308  // `projects/<project>/instances/<instance>/backups/<backup>`.
309  string name = 1 [
310    (google.api.field_behavior) = REQUIRED,
311    (google.api.resource_reference) = {
312      type: "spanner.googleapis.com/Backup"
313    }
314  ];
315}
316
317// The request for [DeleteBackup][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup].
318message DeleteBackupRequest {
319  // Required. Name of the backup to delete.
320  // Values are of the form
321  // `projects/<project>/instances/<instance>/backups/<backup>`.
322  string name = 1 [
323    (google.api.field_behavior) = REQUIRED,
324    (google.api.resource_reference) = {
325      type: "spanner.googleapis.com/Backup"
326    }
327  ];
328}
329
330// The request for [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
331message ListBackupsRequest {
332  // Required. The instance to list backups from.  Values are of the
333  // form `projects/<project>/instances/<instance>`.
334  string parent = 1 [
335    (google.api.field_behavior) = REQUIRED,
336    (google.api.resource_reference) = {
337      type: "spanner.googleapis.com/Instance"
338    }
339  ];
340
341  // An expression that filters the list of returned backups.
342  //
343  // A filter expression consists of a field name, a comparison operator, and a
344  // value for filtering.
345  // The value must be a string, a number, or a boolean. The comparison operator
346  // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
347  // Colon `:` is the contains operator. Filter rules are not case sensitive.
348  //
349  // The following fields in the [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering:
350  //
351  //   * `name`
352  //   * `database`
353  //   * `state`
354  //   * `create_time`  (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
355  //   * `expire_time`  (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
356  //   * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
357  //   * `size_bytes`
358  //
359  // You can combine multiple expressions by enclosing each expression in
360  // parentheses. By default, expressions are combined with AND logic, but
361  // you can specify AND, OR, and NOT logic explicitly.
362  //
363  // Here are a few examples:
364  //
365  //   * `name:Howl` - The backup's name contains the string "howl".
366  //   * `database:prod`
367  //          - The database's name contains the string "prod".
368  //   * `state:CREATING` - The backup is pending creation.
369  //   * `state:READY` - The backup is fully created and ready for use.
370  //   * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")`
371  //          - The backup name contains the string "howl" and `create_time`
372  //              of the backup is before 2018-03-28T14:50:00Z.
373  //   * `expire_time < \"2018-03-28T14:50:00Z\"`
374  //          - The backup `expire_time` is before 2018-03-28T14:50:00Z.
375  //   * `size_bytes > 10000000000` - The backup's size is greater than 10GB
376  string filter = 2;
377
378  // Number of backups to be returned in the response. If 0 or
379  // less, defaults to the server's maximum allowed page size.
380  int32 page_size = 3;
381
382  // If non-empty, `page_token` should contain a
383  // [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token] from a
384  // previous [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse] to the same `parent` and with the same
385  // `filter`.
386  string page_token = 4;
387}
388
389// The response for [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
390message ListBackupsResponse {
391  // The list of matching backups. Backups returned are ordered by `create_time`
392  // in descending order, starting from the most recent `create_time`.
393  repeated Backup backups = 1;
394
395  // `next_page_token` can be sent in a subsequent
396  // [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups] call to fetch more
397  // of the matching backups.
398  string next_page_token = 2;
399}
400
401// The request for
402// [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations].
403message ListBackupOperationsRequest {
404  // Required. The instance of the backup operations. Values are of
405  // the form `projects/<project>/instances/<instance>`.
406  string parent = 1 [
407    (google.api.field_behavior) = REQUIRED,
408    (google.api.resource_reference) = {
409      type: "spanner.googleapis.com/Instance"
410    }
411  ];
412
413  // An expression that filters the list of returned backup operations.
414  //
415  // A filter expression consists of a field name, a
416  // comparison operator, and a value for filtering.
417  // The value must be a string, a number, or a boolean. The comparison operator
418  // must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
419  // Colon `:` is the contains operator. Filter rules are not case sensitive.
420  //
421  // The following fields in the [operation][google.longrunning.Operation]
422  // are eligible for filtering:
423  //
424  //   * `name` - The name of the long-running operation
425  //   * `done` - False if the operation is in progress, else true.
426  //   * `metadata.@type` - the type of metadata. For example, the type string
427  //      for [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] is
428  //      `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
429  //   * `metadata.<field_name>` - any field in metadata.value.
430  //      `metadata.@type` must be specified first if filtering on metadata
431  //      fields.
432  //   * `error` - Error associated with the long-running operation.
433  //   * `response.@type` - the type of response.
434  //   * `response.<field_name>` - any field in response.value.
435  //
436  // You can combine multiple expressions by enclosing each expression in
437  // parentheses. By default, expressions are combined with AND logic, but
438  // you can specify AND, OR, and NOT logic explicitly.
439  //
440  // Here are a few examples:
441  //
442  //   * `done:true` - The operation is complete.
443  //   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
444  //      `metadata.database:prod` - Returns operations where:
445  //      * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
446  //      * The database the backup was taken from has a name containing the
447  //      string "prod".
448  //   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
449  //     `(metadata.name:howl) AND` \
450  //     `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
451  //     `(error:*)` - Returns operations where:
452  //     * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
453  //     * The backup name contains the string "howl".
454  //     * The operation started before 2018-03-28T14:50:00Z.
455  //     * The operation resulted in an error.
456  //   * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \
457  //     `(metadata.source_backup:test) AND` \
458  //     `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \
459  //     `(error:*)` - Returns operations where:
460  //     * The operation's metadata type is [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
461  //     * The source backup of the copied backup name contains the string
462  //     "test".
463  //     * The operation started before 2022-01-18T14:50:00Z.
464  //     * The operation resulted in an error.
465  //   * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
466  //     `(metadata.database:test_db)) OR` \
467  //     `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata)
468  //     AND` \
469  //     `(metadata.source_backup:test_bkp)) AND` \
470  //     `(error:*)` - Returns operations where:
471  //     * The operation's metadata matches either of criteria:
472  //       * The operation's metadata type is [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] AND the
473  //       database the backup was taken from has name containing string
474  //       "test_db"
475  //       * The operation's metadata type is [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] AND the
476  //       backup the backup was copied from has name containing string
477  //       "test_bkp"
478  //     * The operation resulted in an error.
479  string filter = 2;
480
481  // Number of operations to be returned in the response. If 0 or
482  // less, defaults to the server's maximum allowed page size.
483  int32 page_size = 3;
484
485  // If non-empty, `page_token` should contain a
486  // [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token]
487  // from a previous [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse] to the
488  // same `parent` and with the same `filter`.
489  string page_token = 4;
490}
491
492// The response for
493// [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations].
494message ListBackupOperationsResponse {
495  // The list of matching backup [long-running
496  // operations][google.longrunning.Operation]. Each operation's name will be
497  // prefixed by the backup's name. The operation's
498  // [metadata][google.longrunning.Operation.metadata] field type
499  // `metadata.type_url` describes the type of the metadata. Operations returned
500  // include those that are pending or have completed/failed/canceled within the
501  // last 7 days. Operations returned are ordered by
502  // `operation.metadata.value.progress.start_time` in descending order starting
503  // from the most recently started operation.
504  repeated google.longrunning.Operation operations = 1;
505
506  // `next_page_token` can be sent in a subsequent
507  // [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]
508  // call to fetch more of the matching metadata.
509  string next_page_token = 2;
510}
511
512// Information about a backup.
513message BackupInfo {
514  // Name of the backup.
515  string backup = 1 [(google.api.resource_reference) = {
516                       type: "spanner.googleapis.com/Backup"
517                     }];
518
519  // The backup contains an externally consistent copy of `source_database` at
520  // the timestamp specified by `version_time`. If the
521  // [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request did not specify
522  // `version_time`, the `version_time` of the backup is equivalent to the
523  // `create_time`.
524  google.protobuf.Timestamp version_time = 4;
525
526  // The time the [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup] request was
527  // received.
528  google.protobuf.Timestamp create_time = 2;
529
530  // Name of the database the backup was created from.
531  string source_database = 3 [(google.api.resource_reference) = {
532                                type: "spanner.googleapis.com/Database"
533                              }];
534}
535
536// Encryption configuration for the backup to create.
537message CreateBackupEncryptionConfig {
538  // Encryption types for the backup.
539  enum EncryptionType {
540    // Unspecified. Do not use.
541    ENCRYPTION_TYPE_UNSPECIFIED = 0;
542
543    // Use the same encryption configuration as the database. This is the
544    // default option when
545    // [encryption_config][google.spanner.admin.database.v1.CreateBackupEncryptionConfig] is empty.
546    // For example, if the database is using `Customer_Managed_Encryption`, the
547    // backup will be using the same Cloud KMS key as the database.
548    USE_DATABASE_ENCRYPTION = 1;
549
550    // Use Google default encryption.
551    GOOGLE_DEFAULT_ENCRYPTION = 2;
552
553    // Use customer managed encryption. If specified, `kms_key_name`
554    // must contain a valid Cloud KMS key.
555    CUSTOMER_MANAGED_ENCRYPTION = 3;
556  }
557
558  // Required. The encryption type of the backup.
559  EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED];
560
561  // Optional. The Cloud KMS key that will be used to protect the backup.
562  // This field should be set only when
563  // [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] is
564  // `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
565  // `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
566  string kms_key_name = 2 [
567    (google.api.field_behavior) = OPTIONAL,
568    (google.api.resource_reference) = {
569      type: "cloudkms.googleapis.com/CryptoKey"
570    }
571  ];
572}
573
574// Encryption configuration for the copied backup.
575message CopyBackupEncryptionConfig {
576  // Encryption types for the backup.
577  enum EncryptionType {
578    // Unspecified. Do not use.
579    ENCRYPTION_TYPE_UNSPECIFIED = 0;
580
581    // This is the default option for [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]
582    // when [encryption_config][google.spanner.admin.database.v1.CopyBackupEncryptionConfig] is not specified.
583    // For example, if the source backup is using `Customer_Managed_Encryption`,
584    // the backup will be using the same Cloud KMS key as the source backup.
585    USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1;
586
587    // Use Google default encryption.
588    GOOGLE_DEFAULT_ENCRYPTION = 2;
589
590    // Use customer managed encryption. If specified, `kms_key_name`
591    // must contain a valid Cloud KMS key.
592    CUSTOMER_MANAGED_ENCRYPTION = 3;
593  }
594
595  // Required. The encryption type of the backup.
596  EncryptionType encryption_type = 1 [(google.api.field_behavior) = REQUIRED];
597
598  // Optional. The Cloud KMS key that will be used to protect the backup.
599  // This field should be set only when
600  // [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type] is
601  // `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
602  // `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
603  string kms_key_name = 2 [
604    (google.api.field_behavior) = OPTIONAL,
605    (google.api.resource_reference) = {
606      type: "cloudkms.googleapis.com/CryptoKey"
607    }
608  ];
609}
610