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