xref: /aosp_15_r20/external/googleapis/google/cloud/gkebackup/v1/restore_plan.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/restore.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 = "RestorePlanProto";
28option java_package = "com.google.cloud.gkebackup.v1";
29option php_namespace = "Google\\Cloud\\GkeBackup\\V1";
30option ruby_package = "Google::Cloud::GkeBackup::V1";
31
32// The configuration of a potential series of Restore operations to be performed
33// against Backups belong to a particular BackupPlan.
34message RestorePlan {
35  option (google.api.resource) = {
36    type: "gkebackup.googleapis.com/RestorePlan"
37    pattern: "projects/{project}/locations/{location}/restorePlans/{restore_plan}"
38  };
39
40  // State
41  enum State {
42    // Default first value for Enums.
43    STATE_UNSPECIFIED = 0;
44
45    // Waiting for cluster state to be RUNNING.
46    CLUSTER_PENDING = 1;
47
48    // The RestorePlan has successfully been created and is ready for Restores.
49    READY = 2;
50
51    // RestorePlan creation has failed.
52    FAILED = 3;
53
54    // The RestorePlan is in the process of being deleted.
55    DELETING = 4;
56  }
57
58  // Output only. The full name of the RestorePlan resource.
59  // Format: `projects/*/locations/*/restorePlans/*`.
60  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
61
62  // Output only. Server generated global unique identifier of
63  // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) format.
64  string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
65
66  // Output only. The timestamp when this RestorePlan resource was
67  // created.
68  google.protobuf.Timestamp create_time = 3
69      [(google.api.field_behavior) = OUTPUT_ONLY];
70
71  // Output only. The timestamp when this RestorePlan resource was last
72  // updated.
73  google.protobuf.Timestamp update_time = 4
74      [(google.api.field_behavior) = OUTPUT_ONLY];
75
76  // Optional. User specified descriptive string for this RestorePlan.
77  string description = 5 [(google.api.field_behavior) = OPTIONAL];
78
79  // Required. Immutable. A reference to the
80  // [BackupPlan][google.cloud.gkebackup.v1.BackupPlan] from which Backups may
81  // be used as the source for Restores created via this RestorePlan. Format:
82  // `projects/*/locations/*/backupPlans/*`.
83  string backup_plan = 6 [
84    (google.api.field_behavior) = IMMUTABLE,
85    (google.api.field_behavior) = REQUIRED,
86    (google.api.resource_reference) = {
87      type: "gkebackup.googleapis.com/BackupPlan"
88    }
89  ];
90
91  // Required. Immutable. The target cluster into which Restores created via
92  // this RestorePlan will restore data. NOTE: the cluster's region must be the
93  // same as the RestorePlan. Valid formats:
94  //
95  //   - `projects/*/locations/*/clusters/*`
96  //   - `projects/*/zones/*/clusters/*`
97  string cluster = 7 [
98    (google.api.field_behavior) = IMMUTABLE,
99    (google.api.field_behavior) = REQUIRED,
100    (google.api.resource_reference) = {
101      type: "container.googleapis.com/Cluster"
102    }
103  ];
104
105  // Required. Configuration of Restores created via this RestorePlan.
106  RestoreConfig restore_config = 8 [(google.api.field_behavior) = REQUIRED];
107
108  // Optional. A set of custom labels supplied by user.
109  map<string, string> labels = 9 [(google.api.field_behavior) = OPTIONAL];
110
111  // Output only. `etag` is used for optimistic concurrency control as a way to
112  // help prevent simultaneous updates of a restore from overwriting each other.
113  // It is strongly suggested that systems make use of the `etag` in the
114  // read-modify-write cycle to perform restore updates in order to avoid
115  // race conditions: An `etag` is returned in the response to `GetRestorePlan`,
116  // and systems are expected to put that etag in the request to
117  // `UpdateRestorePlan` or `DeleteRestorePlan` to ensure that their change
118  // will be applied to the same version of the resource.
119  string etag = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
120
121  // Output only. State of the RestorePlan. This State field reflects the
122  // various stages a RestorePlan can be in
123  // during the Create operation.
124  State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
125
126  // Output only. Human-readable description of why RestorePlan is in the
127  // current `state`
128  string state_reason = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
129}
130