xref: /aosp_15_r20/external/googleapis/google/cloud/gkebackup/v1/volume.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 = "VolumeProto";
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 the backup of a specific persistent volume as a component of a
33// Backup - both the record of the operation and a pointer to the underlying
34// storage-specific artifacts.
35message VolumeBackup {
36  option (google.api.resource) = {
37    type: "gkebackup.googleapis.com/VolumeBackup"
38    pattern: "projects/{project}/locations/{location}/backupPlans/{backup_plan}/backups/{backup}/volumeBackups/{volume_backup}"
39  };
40
41  // Identifies the format used for the volume backup.
42  enum VolumeBackupFormat {
43    // Default value, not specified.
44    VOLUME_BACKUP_FORMAT_UNSPECIFIED = 0;
45
46    // Compute Engine Persistent Disk snapshot based volume backup.
47    GCE_PERSISTENT_DISK = 1;
48  }
49
50  // The current state of a VolumeBackup
51  enum State {
52    // This is an illegal state and should not be encountered.
53    STATE_UNSPECIFIED = 0;
54
55    // A volume for the backup was identified and backup process is about to
56    // start.
57    CREATING = 1;
58
59    // The volume backup operation has begun and is in the initial "snapshot"
60    // phase of the process. Any defined ProtectedApplication "pre" hooks will
61    // be executed before entering this state and "post" hooks will be executed
62    // upon leaving this state.
63    SNAPSHOTTING = 2;
64
65    // The snapshot phase of the volume backup operation has completed and
66    // the snapshot is now being uploaded to backup storage.
67    UPLOADING = 3;
68
69    // The volume backup operation has completed successfully.
70    SUCCEEDED = 4;
71
72    // The volume backup operation has failed.
73    FAILED = 5;
74
75    // This VolumeBackup resource (and its associated artifacts) is in the
76    // process of being deleted.
77    DELETING = 6;
78  }
79
80  // Output only. The full name of the VolumeBackup resource.
81  // Format: `projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*`.
82  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
83
84  // Output only. Server generated global unique identifier of
85  // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) format.
86  string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
87
88  // Output only. The timestamp when this VolumeBackup resource was
89  // created.
90  google.protobuf.Timestamp create_time = 3
91      [(google.api.field_behavior) = OUTPUT_ONLY];
92
93  // Output only. The timestamp when this VolumeBackup resource was last
94  // updated.
95  google.protobuf.Timestamp update_time = 4
96      [(google.api.field_behavior) = OUTPUT_ONLY];
97
98  // Output only. A reference to the source Kubernetes PVC from which this
99  // VolumeBackup was created.
100  NamespacedName source_pvc = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
101
102  // Output only. A storage system-specific opaque handle to the underlying
103  // volume backup.
104  string volume_backup_handle = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
105
106  // Output only. The format used for the volume backup.
107  VolumeBackupFormat format = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
108
109  // Output only. The aggregate size of the underlying artifacts associated with
110  // this VolumeBackup in the backup storage. This may change over time when
111  // multiple backups of the same volume share the same backup storage
112  // location. In particular, this is likely to increase in size when
113  // the immediately preceding backup of the same volume is deleted.
114  int64 storage_bytes = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
115
116  // Output only. The minimum size of the disk to which this VolumeBackup can be
117  // restored.
118  int64 disk_size_bytes = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
119
120  // Output only. The timestamp when the associated underlying volume backup
121  // operation completed.
122  google.protobuf.Timestamp complete_time = 10
123      [(google.api.field_behavior) = OUTPUT_ONLY];
124
125  // Output only. The current state of this VolumeBackup.
126  State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
127
128  // Output only. A human readable message explaining why the VolumeBackup is in
129  // its current state.
130  string state_message = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
131
132  // Output only. `etag` is used for optimistic concurrency control as a way to
133  // help prevent simultaneous updates of a volume backup from overwriting each
134  // other. It is strongly suggested that systems make use of the `etag` in the
135  // read-modify-write cycle to perform volume backup updates in order to avoid
136  // race conditions.
137  string etag = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
138}
139
140// Represents the operation of restoring a volume from a VolumeBackup.
141message VolumeRestore {
142  option (google.api.resource) = {
143    type: "gkebackup.googleapis.com/VolumeRestore"
144    pattern: "projects/{project}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}/volumeRestores/{volume_restore}"
145  };
146
147  // Supported volume types.
148  enum VolumeType {
149    // Default
150    VOLUME_TYPE_UNSPECIFIED = 0;
151
152    // Compute Engine Persistent Disk volume
153    GCE_PERSISTENT_DISK = 1;
154  }
155
156  // The current state of a VolumeRestore
157  enum State {
158    // This is an illegal state and should not be encountered.
159    STATE_UNSPECIFIED = 0;
160
161    // A volume for the restore was identified and restore process is about to
162    // start.
163    CREATING = 1;
164
165    // The volume is currently being restored.
166    RESTORING = 2;
167
168    // The volume has been successfully restored.
169    SUCCEEDED = 3;
170
171    // The volume restoration process failed.
172    FAILED = 4;
173
174    // This VolumeRestore resource is in the process of being deleted.
175    DELETING = 5;
176  }
177
178  // Output only. Full name of the VolumeRestore resource.
179  // Format: `projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/*`
180  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
181
182  // Output only. Server generated global unique identifier of
183  // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) format.
184  string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
185
186  // Output only. The timestamp when this VolumeRestore resource was
187  // created.
188  google.protobuf.Timestamp create_time = 3
189      [(google.api.field_behavior) = OUTPUT_ONLY];
190
191  // Output only. The timestamp when this VolumeRestore resource was last
192  // updated.
193  google.protobuf.Timestamp update_time = 4
194      [(google.api.field_behavior) = OUTPUT_ONLY];
195
196  // Output only. The full name of the VolumeBackup from which the volume will
197  // be restored. Format:
198  // `projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*`.
199  string volume_backup = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
200
201  // Output only. The reference to the target Kubernetes PVC to be restored.
202  NamespacedName target_pvc = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
203
204  // Output only. A storage system-specific opaque handler to the underlying
205  // volume created for the target PVC from the volume backup.
206  string volume_handle = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
207
208  // Output only. The type of volume provisioned
209  VolumeType volume_type = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
210
211  // Output only. The timestamp when the associated underlying volume
212  // restoration completed.
213  google.protobuf.Timestamp complete_time = 9
214      [(google.api.field_behavior) = OUTPUT_ONLY];
215
216  // Output only. The current state of this VolumeRestore.
217  State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
218
219  // Output only. A human readable message explaining why the VolumeRestore is
220  // in its current state.
221  string state_message = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
222
223  // Output only. `etag` is used for optimistic concurrency control as a way to
224  // help prevent simultaneous updates of a volume restore from overwriting each
225  // other. It is strongly suggested that systems make use of the `etag` in the
226  // read-modify-write cycle to perform volume restore updates in order to avoid
227  // race conditions.
228  string etag = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
229}
230