backup_plan.proto 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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.cloud.gkebackup.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/gkebackup/v1/common.proto";
  19. import "google/protobuf/timestamp.proto";
  20. option csharp_namespace = "Google.Cloud.GkeBackup.V1";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/gkebackup/v1;gkebackup";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "BackupPlanProto";
  24. option java_package = "com.google.cloud.gkebackup.v1";
  25. option php_namespace = "Google\\Cloud\\GkeBackup\\V1";
  26. option ruby_package = "Google::Cloud::GkeBackup::V1";
  27. // Defines the configuration and scheduling for a "line" of Backups.
  28. message BackupPlan {
  29. option (google.api.resource) = {
  30. type: "gkebackup.googleapis.com/BackupPlan"
  31. pattern: "projects/{project}/locations/{location}/backupPlans/{backup_plan}"
  32. };
  33. // RetentionPolicy defines a Backup retention policy for a BackupPlan.
  34. message RetentionPolicy {
  35. // Minimum age for Backups created via this BackupPlan (in days).
  36. // This field MUST be an integer value between 0-90 (inclusive).
  37. // A Backup created under this BackupPlan will NOT be deletable until it
  38. // reaches Backup's (create_time + backup_delete_lock_days).
  39. // Updating this field of a BackupPlan does NOT affect existing Backups
  40. // under it. Backups created AFTER a successful update will inherit
  41. // the new value.
  42. //
  43. // Default: 0 (no delete blocking)
  44. int32 backup_delete_lock_days = 1;
  45. // The default maximum age of a Backup created via this BackupPlan.
  46. // This field MUST be an integer value >= 0.
  47. // If specified, a Backup created under this BackupPlan will be
  48. // automatically deleted after its age reaches (create_time +
  49. // backup_retain_days).
  50. // If not specified, Backups created under this BackupPlan will NOT be
  51. // subject to automatic deletion.
  52. // Updating this field does NOT affect existing Backups under it. Backups
  53. // created AFTER a successful update will automatically pick up the new
  54. // value.
  55. // NOTE: backup_retain_days must be >= [backup_delete_lock_days][google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.backup_delete_lock_days].
  56. //
  57. // Default: 0 (no automatic deletion)
  58. int32 backup_retain_days = 2;
  59. // This flag denotes whether the retention policy of this BackupPlan is
  60. // locked. If set to True, no further update is allowed on this policy,
  61. // including the `locked` field itself.
  62. //
  63. // Default: False
  64. bool locked = 3;
  65. }
  66. // Schedule defines scheduling parameters for automatically creating Backups
  67. // via this BackupPlan.
  68. message Schedule {
  69. // A standard [cron](https://wikipedia.com/wiki/cron) string that defines a
  70. // repeating schedule for creating Backups via this BackupPlan.
  71. //
  72. // Default (empty): no automatic backup creation will occur.
  73. string cron_schedule = 1;
  74. // This flag denotes whether automatic Backup creation is paused for this
  75. // BackupPlan.
  76. //
  77. // Default: False
  78. bool paused = 2;
  79. }
  80. // BackupConfig defines the configuration of Backups created via this
  81. // BackupPlan.
  82. message BackupConfig {
  83. // This defines the "scope" of the Backup - which namespaced
  84. // resources in the cluster will be included in a Backup.
  85. // Exactly one of the fields of backup_scope MUST be specified.
  86. oneof backup_scope {
  87. // If True, include all namespaced resources
  88. bool all_namespaces = 1;
  89. // If set, include just the resources in the listed namespaces.
  90. Namespaces selected_namespaces = 2;
  91. // If set, include just the resources referenced by the listed
  92. // ProtectedApplications.
  93. NamespacedNames selected_applications = 3;
  94. }
  95. // This flag specifies whether volume data should be backed up when
  96. // PVCs are included in the scope of a Backup.
  97. //
  98. // Default: False
  99. bool include_volume_data = 4;
  100. // This flag specifies whether Kubernetes Secret resources should be
  101. // included when they fall into the scope of Backups.
  102. //
  103. // Default: False
  104. bool include_secrets = 5;
  105. // This defines a customer managed encryption key that will be used to
  106. // encrypt the "config" portion (the Kubernetes resources) of Backups
  107. // created via this plan.
  108. //
  109. // Default (empty): Config backup artifacts will not be encrypted.
  110. EncryptionKey encryption_key = 6;
  111. }
  112. // Output only. The full name of the BackupPlan resource.
  113. // Format: projects/*/locations/*/backupPlans/*
  114. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  115. // Output only. Server generated global unique identifier of
  116. // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) format.
  117. string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  118. // Output only. The timestamp when this BackupPlan resource was created.
  119. google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  120. // Output only. The timestamp when this BackupPlan resource was last
  121. // updated.
  122. google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  123. // User specified descriptive string for this BackupPlan.
  124. string description = 5;
  125. // Required. Immutable. The source cluster from which Backups will be created via
  126. // this BackupPlan.
  127. // Valid formats:
  128. //
  129. // - projects/*/locations/*/clusters/*
  130. // - projects/*/zones/*/clusters/*
  131. string cluster = 6 [
  132. (google.api.field_behavior) = IMMUTABLE,
  133. (google.api.field_behavior) = REQUIRED,
  134. (google.api.resource_reference) = {
  135. type: "container.googleapis.com/Cluster"
  136. }
  137. ];
  138. // RetentionPolicy governs lifecycle of Backups created under this plan.
  139. RetentionPolicy retention_policy = 7;
  140. // A set of custom labels supplied by user.
  141. map<string, string> labels = 8;
  142. // Defines a schedule for automatic Backup creation via this BackupPlan.
  143. Schedule backup_schedule = 9;
  144. // Output only. `etag` is used for optimistic concurrency control as a way to help
  145. // prevent simultaneous updates of a backup plan from overwriting each other.
  146. // It is strongly suggested that systems make use of the 'etag' in the
  147. // read-modify-write cycle to perform BackupPlan updates in order to avoid
  148. // race conditions: An `etag` is returned in the response to `GetBackupPlan`,
  149. // and systems are expected to put that etag in the request to
  150. // `UpdateBackupPlan` or `DeleteBackupPlan` to ensure that their change
  151. // will be applied to the same version of the resource.
  152. string etag = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  153. // This flag indicates whether this BackupPlan has been deactivated.
  154. // Setting this field to True locks the BackupPlan such that no further
  155. // updates will be allowed (except deletes), including the deactivated field
  156. // itself. It also prevents any new Backups from being created via this
  157. // BackupPlan (including scheduled Backups).
  158. //
  159. // Default: False
  160. bool deactivated = 11;
  161. // Defines the configuration of Backups created via this BackupPlan.
  162. BackupConfig backup_config = 12;
  163. // Output only. The number of Kubernetes Pods backed up in the
  164. // last successful Backup created via this BackupPlan.
  165. int32 protected_pod_count = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  166. }