backup.proto 28 KB

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