backup.proto 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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 = "BackupProto";
  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. // Represents a request to perform a single point-in-time capture of
  28. // some portion of the state of a GKE cluster, the record of the backup
  29. // operation itself, and an anchor for the underlying artifacts that
  30. // comprise the Backup (the config backup and VolumeBackups).
  31. // Next id: 28
  32. message Backup {
  33. option (google.api.resource) = {
  34. type: "gkebackup.googleapis.com/Backup"
  35. pattern: "projects/{project}/locations/{location}/backupPlans/{backup_plan}/backups/{backup}"
  36. };
  37. // Information about the GKE cluster from which this Backup was created.
  38. message ClusterMetadata {
  39. // The source cluster from which this Backup was created.
  40. // Valid formats:
  41. //
  42. // - projects/*/locations/*/clusters/*
  43. // - projects/*/zones/*/clusters/*
  44. //
  45. // This is inherited from the parent BackupPlan's
  46. // [cluster][google.cloud.gkebackup.v1.BackupPlan.cluster] field.
  47. string cluster = 1;
  48. // The Kubernetes server version of the source cluster.
  49. string k8s_version = 2;
  50. // A list of the Backup for GKE CRD versions found in the cluster.
  51. map<string, string> backup_crd_versions = 3;
  52. // Platform-specific version
  53. oneof platform_version {
  54. // GKE version
  55. string gke_version = 4;
  56. // Anthos version
  57. string anthos_version = 5;
  58. }
  59. }
  60. // State
  61. enum State {
  62. // The Backup resource is in the process of being created.
  63. STATE_UNSPECIFIED = 0;
  64. // The Backup resource has been created and the associated BackupJob
  65. // Kubernetes resource has been injected into the source cluster.
  66. CREATING = 1;
  67. // The gkebackup agent in the cluster has begun executing the backup
  68. // operation.
  69. IN_PROGRESS = 2;
  70. // The backup operation has completed successfully.
  71. SUCCEEDED = 3;
  72. // The backup operation has failed.
  73. FAILED = 4;
  74. // This Backup resource (and its associated artifacts) is in the process
  75. // of being deleted.
  76. DELETING = 5;
  77. }
  78. // Output only. The fully qualified name of the Backup.
  79. // projects/*/locations/*/backupPlans/*/backups/*
  80. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  81. // Output only. Server generated global unique identifier of
  82. // [UUID4](https://en.wikipedia.org/wiki/Universally_unique_identifier)
  83. string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  84. // Output only. The timestamp when this Backup resource was created.
  85. google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  86. // Output only. The timestamp when this Backup resource was last updated.
  87. google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  88. // Output only. This flag indicates whether this Backup resource was created manually
  89. // by a user or via a schedule in the BackupPlan. A value of True means that
  90. // the Backup was created manually.
  91. bool manual = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  92. // A set of custom labels supplied by user.
  93. map<string, string> labels = 6;
  94. // Minimum age for this Backup (in days). If this field is set to a non-zero
  95. // value, the Backup will be "locked" against deletion (either manual or
  96. // automatic deletion) for the number of days provided (measured from the
  97. // creation time of the Backup). MUST be an integer value between 0-90
  98. // (inclusive).
  99. //
  100. // Defaults to parent BackupPlan's
  101. // [backup_delete_lock_days][google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.backup_delete_lock_days]
  102. // setting and may only be increased
  103. // (either at creation time or in a subsequent update).
  104. int32 delete_lock_days = 7;
  105. // Output only. The time at which an existing delete lock will expire for this backup
  106. // (calculated from create_time + [delete_lock_days][google.cloud.gkebackup.v1.Backup.delete_lock_days]).
  107. google.protobuf.Timestamp delete_lock_expire_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  108. // The age (in days) after which this Backup will be automatically deleted.
  109. // Must be an integer value >= 0:
  110. //
  111. // - If 0, no automatic deletion will occur for this Backup.
  112. // - If not 0, this must be >= [delete_lock_days][google.cloud.gkebackup.v1.Backup.delete_lock_days].
  113. //
  114. // Once a Backup is created, this value may only be increased.
  115. //
  116. // Defaults to the parent BackupPlan's
  117. // [backup_retain_days][google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.backup_retain_days] value.
  118. int32 retain_days = 9;
  119. // Output only. The time at which this Backup will be automatically deleted (calculated
  120. // from create_time + [retain_days][google.cloud.gkebackup.v1.Backup.retain_days]).
  121. google.protobuf.Timestamp retain_expire_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  122. // Output only. The customer managed encryption key that was used to encrypt the Backup's
  123. // artifacts. Inherited from the parent BackupPlan's
  124. // [encryption_key][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.encryption_key] value.
  125. EncryptionKey encryption_key = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
  126. // Defines the "scope" of the Backup - which namespaced resources in the
  127. // cluster were included in the Backup. Inherited from the parent
  128. // BackupPlan's [backup_scope][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.backup_scope] value.
  129. oneof backup_scope {
  130. // Output only. If True, all namespaces were included in the Backup.
  131. bool all_namespaces = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  132. // Output only. If set, the list of namespaces that were included in the Backup.
  133. Namespaces selected_namespaces = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  134. // Output only. If set, the list of ProtectedApplications whose resources were included
  135. // in the Backup.
  136. NamespacedNames selected_applications = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
  137. }
  138. // Output only. Whether or not the Backup contains volume data. Controlled by the parent
  139. // BackupPlan's
  140. // [include_volume_data][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.include_volume_data] value.
  141. bool contains_volume_data = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
  142. // Output only. Whether or not the Backup contains Kubernetes Secrets. Controlled by the
  143. // parent BackupPlan's
  144. // [include_secrets][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.include_secrets] value.
  145. bool contains_secrets = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
  146. // Output only. Information about the GKE cluster from which this Backup was created.
  147. ClusterMetadata cluster_metadata = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
  148. // Output only. Current state of the Backup
  149. State state = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
  150. // Output only. Human-readable description of why the backup is in the current `state`.
  151. string state_reason = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
  152. // Output only. Completion time of the Backup
  153. google.protobuf.Timestamp complete_time = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
  154. // Output only. The total number of Kubernetes resources included in the Backup.
  155. int32 resource_count = 21 [(google.api.field_behavior) = OUTPUT_ONLY];
  156. // Output only. The total number of volume backups contained in the Backup.
  157. int32 volume_count = 22 [(google.api.field_behavior) = OUTPUT_ONLY];
  158. // Output only. The total size of the Backup in bytes = config backup size + sum(volume
  159. // backup sizes)
  160. int64 size_bytes = 23 [(google.api.field_behavior) = OUTPUT_ONLY];
  161. // Output only. `etag` is used for optimistic concurrency control as a way to help
  162. // prevent simultaneous updates of a backup from overwriting each other.
  163. // It is strongly suggested that systems make use of the `etag` in the
  164. // read-modify-write cycle to perform backup updates in order to avoid
  165. // race conditions: An `etag` is returned in the response to `GetBackup`,
  166. // and systems are expected to put that etag in the request to
  167. // `UpdateBackup` or `DeleteBackup` to ensure that their change will be
  168. // applied to the same version of the resource.
  169. string etag = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
  170. // User specified descriptive string for this Backup.
  171. string description = 25;
  172. // Output only. The total number of Kubernetes Pods contained in the Backup.
  173. int32 pod_count = 26 [(google.api.field_behavior) = OUTPUT_ONLY];
  174. // Output only. The size of the config backup in bytes.
  175. int64 config_backup_size_bytes = 27 [(google.api.field_behavior) = OUTPUT_ONLY];
  176. }