Skip to content

Commit 2e88182

Browse files
Google APIscopybara-github
authored andcommitted
feat: Adding new BackupChannel, RestoreChannel, BackupPlanBinding and RestorePlanBinding
feat: generation of new cross project APIs feat: Adding `last_successful_backup_time` field in BackupPlan feat: Adding `VALIDATING` enum in state field of restore.proto feat: Adding `CLEANED_UP` enum in state field of volume.proto docs: minor documentation fixes PiperOrigin-RevId: 750471828
1 parent 7c6f112 commit 2e88182

13 files changed

Lines changed: 1063 additions & 19 deletions

google/cloud/gkebackup/v1/BUILD.bazel

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,22 @@ proto_library(
2525
name = "gkebackup_proto",
2626
srcs = [
2727
"backup.proto",
28+
"backup_channel.proto",
2829
"backup_plan.proto",
30+
"backup_plan_binding.proto",
2931
"common.proto",
3032
"gkebackup.proto",
3133
"restore.proto",
34+
"restore_channel.proto",
3235
"restore_plan.proto",
36+
"restore_plan_binding.proto",
3337
"volume.proto",
3438
],
3539
deps = [
3640
"//google/api:annotations_proto",
3741
"//google/api:client_proto",
3842
"//google/api:field_behavior_proto",
43+
"//google/api:field_info_proto",
3944
"//google/api:resource_proto",
4045
"//google/longrunning:operations_proto",
4146
"//google/type:date_proto",
@@ -366,7 +371,6 @@ load(
366371

367372
csharp_proto_library(
368373
name = "gkebackup_csharp_proto",
369-
extra_opts = [],
370374
deps = [":gkebackup_proto"],
371375
)
372376

google/cloud/gkebackup/v1/backup.proto

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ message Backup {
203203
State state = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
204204

205205
// Output only. Human-readable description of why the backup is in the current
206-
// `state`.
206+
// `state`. This field is only meant for human readability and should not be
207+
// used programmatically as this field is not guaranteed to be consistent.
207208
string state_reason = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
208209

209210
// Output only. Completion time of the Backup
@@ -249,4 +250,10 @@ message Backup {
249250
// [permissive_mode][google.cloud.gkebackup.v1.BackupPlan.BackupConfig.permissive_mode]
250251
// value.
251252
bool permissive_mode = 28 [(google.api.field_behavior) = OUTPUT_ONLY];
253+
254+
// Output only. [Output Only] Reserved for future use.
255+
bool satisfies_pzs = 29 [(google.api.field_behavior) = OUTPUT_ONLY];
256+
257+
// Output only. [Output Only] Reserved for future use.
258+
bool satisfies_pzi = 30 [(google.api.field_behavior) = OUTPUT_ONLY];
252259
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// Copyright 2025 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+
15+
syntax = "proto3";
16+
17+
package google.cloud.gkebackup.v1;
18+
19+
import "google/api/field_behavior.proto";
20+
import "google/api/field_info.proto";
21+
import "google/api/resource.proto";
22+
import "google/protobuf/timestamp.proto";
23+
24+
option csharp_namespace = "Google.Cloud.GkeBackup.V1";
25+
option go_package = "cloud.google.com/go/gkebackup/apiv1/gkebackuppb;gkebackuppb";
26+
option java_multiple_files = true;
27+
option java_outer_classname = "BackupChannelProto";
28+
option java_package = "com.google.cloud.gkebackup.v1";
29+
option php_namespace = "Google\\Cloud\\GkeBackup\\V1";
30+
option ruby_package = "Google::Cloud::GkeBackup::V1";
31+
32+
// A BackupChannel imposes constraints on where clusters can be backed up.
33+
// The BackupChannel should be in the same project and region
34+
// as the cluster being backed up.
35+
// The backup can be created only in destination_project.
36+
message BackupChannel {
37+
option (google.api.resource) = {
38+
type: "gkebackup.googleapis.com/BackupChannel"
39+
pattern: "projects/{project}/locations/{location}/backupChannels/{backup_channel}"
40+
plural: "backupChannels"
41+
singular: "backupChannel"
42+
};
43+
44+
// Identifier. The fully qualified name of the BackupChannel.
45+
// `projects/*/locations/*/backupChannels/*`
46+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
47+
48+
// Required. Immutable. The project where Backups are allowed to be stored.
49+
// The format is `projects/{project}`.
50+
// Currently, {project} can only be the project number. Support for project
51+
// IDs will be added in the future.
52+
string destination_project = 2 [
53+
(google.api.field_behavior) = IMMUTABLE,
54+
(google.api.field_behavior) = REQUIRED
55+
];
56+
57+
// Output only. Server generated global unique identifier of
58+
// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) format.
59+
string uid = 3 [
60+
(google.api.field_info).format = UUID4,
61+
(google.api.field_behavior) = OUTPUT_ONLY
62+
];
63+
64+
// Output only. The timestamp when this BackupChannel resource was created.
65+
google.protobuf.Timestamp create_time = 4
66+
[(google.api.field_behavior) = OUTPUT_ONLY];
67+
68+
// Output only. The timestamp when this BackupChannel resource was last
69+
// updated.
70+
google.protobuf.Timestamp update_time = 5
71+
[(google.api.field_behavior) = OUTPUT_ONLY];
72+
73+
// Optional. A set of custom labels supplied by user.
74+
map<string, string> labels = 6 [(google.api.field_behavior) = OPTIONAL];
75+
76+
// Optional. User specified descriptive string for this BackupChannel.
77+
string description = 7 [(google.api.field_behavior) = OPTIONAL];
78+
79+
// Output only. `etag` is used for optimistic concurrency control as a way to
80+
// help prevent simultaneous updates of a BackupChannel from overwriting each
81+
// other. It is strongly suggested that systems make use of the 'etag' in the
82+
// read-modify-write cycle to perform BackupChannel updates in order to
83+
// avoid race conditions: An `etag` is returned in the response to
84+
// `GetBackupChannel`, and systems are expected to put that etag in the
85+
// request to `UpdateBackupChannel` or `DeleteBackupChannel` to
86+
// ensure that their change will be applied to the same version of the
87+
// resource.
88+
string etag = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
89+
90+
// Output only. The project_id where Backups are allowed to be stored.
91+
// Example Project ID: "my-project-id".
92+
// This will be an OUTPUT_ONLY field to return the project_id of the
93+
// destination project.
94+
string destination_project_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
95+
}

google/cloud/gkebackup/v1/backup_plan.proto

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ message BackupPlan {
266266
State state = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
267267

268268
// Output only. Human-readable description of why BackupPlan is in the current
269-
// `state`
269+
// `state`. This field is only meant for human readability and should not be
270+
// used programmatically as this field is not guaranteed to be consistent.
270271
string state_reason = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
271272

272273
// Output only. A number that represents the current risk level of this
@@ -277,6 +278,13 @@ message BackupPlan {
277278
// Output only. Human-readable description of why the BackupPlan is in the
278279
// current rpo_risk_level and action items if any.
279280
string rpo_risk_reason = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
281+
282+
// Output only. Completion time of the last successful Backup. This is sourced
283+
// from a successful Backup's complete_time field. This field is added to
284+
// maintain consistency with BackupPlanBinding to display last successful
285+
// backup time.
286+
google.protobuf.Timestamp last_successful_backup_time = 19
287+
[(google.api.field_behavior) = OUTPUT_ONLY];
280288
}
281289

282290
// Defines RPO scheduling configuration for automatically creating
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
// Copyright 2025 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+
15+
syntax = "proto3";
16+
17+
package google.cloud.gkebackup.v1;
18+
19+
import "google/api/field_behavior.proto";
20+
import "google/api/field_info.proto";
21+
import "google/api/resource.proto";
22+
import "google/protobuf/timestamp.proto";
23+
24+
option csharp_namespace = "Google.Cloud.GkeBackup.V1";
25+
option go_package = "cloud.google.com/go/gkebackup/apiv1/gkebackuppb;gkebackuppb";
26+
option java_multiple_files = true;
27+
option java_outer_classname = "BackupPlanBindingProto";
28+
option java_package = "com.google.cloud.gkebackup.v1";
29+
option php_namespace = "Google\\Cloud\\GkeBackup\\V1";
30+
option ruby_package = "Google::Cloud::GkeBackup::V1";
31+
32+
// A BackupPlanBinding binds a BackupPlan with a BackupChannel.
33+
// This resource is created automatically when a BackupPlan is created using a
34+
// BackupChannel. This also serves as a holder for cross-project fields
35+
// that need to be displayed in the current project.
36+
message BackupPlanBinding {
37+
option (google.api.resource) = {
38+
type: "gkebackup.googleapis.com/BackupPlanBinding"
39+
pattern: "projects/{project}/locations/{location}/backupChannels/{backup_channel}/backupPlanBindings/{backup_plan_binding}"
40+
plural: "backupPlanBindings"
41+
singular: "backupPlanBinding"
42+
};
43+
44+
// Contains metadata about the backup plan/backup.
45+
message BackupPlanDetails {
46+
// State
47+
enum State {
48+
// Default first value for Enums.
49+
STATE_UNSPECIFIED = 0;
50+
51+
// Waiting for cluster state to be RUNNING.
52+
CLUSTER_PENDING = 1;
53+
54+
// The BackupPlan is in the process of being created.
55+
PROVISIONING = 2;
56+
57+
// The BackupPlan has successfully been created and is ready for Backups.
58+
READY = 3;
59+
60+
// BackupPlan creation has failed.
61+
FAILED = 4;
62+
63+
// The BackupPlan has been deactivated.
64+
DEACTIVATED = 5;
65+
66+
// The BackupPlan is in the process of being deleted.
67+
DELETING = 6;
68+
}
69+
70+
// Output only. The number of Kubernetes Pods backed up in the
71+
// last successful Backup created via this BackupPlan.
72+
int32 protected_pod_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
73+
74+
// Output only. State of the BackupPlan.
75+
State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
76+
77+
// Output only. Completion time of the last successful Backup. This is
78+
// sourced from a successful Backup's complete_time field.
79+
google.protobuf.Timestamp last_successful_backup_time = 3
80+
[(google.api.field_behavior) = OUTPUT_ONLY];
81+
82+
// Output only. Start time of next scheduled backup under this BackupPlan by
83+
// either cron_schedule or rpo config. This is sourced from BackupPlan.
84+
google.protobuf.Timestamp next_scheduled_backup_time = 4
85+
[(google.api.field_behavior) = OUTPUT_ONLY];
86+
87+
// Output only. A number that represents the current risk level of this
88+
// BackupPlan from RPO perspective with 1 being no risk and 5 being highest
89+
// risk.
90+
int32 rpo_risk_level = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
91+
92+
// Output only. The fully qualified name of the last successful Backup
93+
// created under this BackupPlan.
94+
// `projects/*/locations/*/backupPlans/*/backups/*`
95+
string last_successful_backup = 6
96+
[(google.api.field_behavior) = OUTPUT_ONLY];
97+
}
98+
99+
// Identifier. The fully qualified name of the BackupPlanBinding.
100+
// `projects/*/locations/*/backupChannels/*/backupPlanBindings/*`
101+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
102+
103+
// Output only. Server generated global unique identifier of
104+
// [UUID4](https://en.wikipedia.org/wiki/Universally_unique_identifier)
105+
string uid = 2 [
106+
(google.api.field_info).format = UUID4,
107+
(google.api.field_behavior) = OUTPUT_ONLY
108+
];
109+
110+
// Output only. The timestamp when this binding was created.
111+
google.protobuf.Timestamp create_time = 3
112+
[(google.api.field_behavior) = OUTPUT_ONLY];
113+
114+
// Output only. The timestamp when this binding was created.
115+
google.protobuf.Timestamp update_time = 4
116+
[(google.api.field_behavior) = OUTPUT_ONLY];
117+
118+
// Output only. Immutable. The fully qualified name of the BackupPlan bound
119+
// with the parent BackupChannel.
120+
// `projects/*/locations/*/backupPlans/{backup_plan}`
121+
string backup_plan = 5 [
122+
(google.api.field_behavior) = IMMUTABLE,
123+
(google.api.field_behavior) = OUTPUT_ONLY,
124+
(google.api.resource_reference) = {
125+
type: "gkebackup.googleapis.com/BackupPlan"
126+
}
127+
];
128+
129+
// Output only. Immutable. The fully qualified name of the cluster that is
130+
// being backed up Valid formats:
131+
//
132+
// - `projects/*/locations/*/clusters/*`
133+
// - `projects/*/zones/*/clusters/*`
134+
string cluster = 6 [
135+
(google.api.field_behavior) = IMMUTABLE,
136+
(google.api.field_behavior) = OUTPUT_ONLY,
137+
(google.api.resource_reference) = {
138+
type: "container.googleapis.com/Cluster"
139+
}
140+
];
141+
142+
// Output only. Contains details about the backup plan/backup.
143+
BackupPlanDetails backup_plan_details = 7
144+
[(google.api.field_behavior) = OUTPUT_ONLY];
145+
146+
// Output only. `etag` is used for optimistic concurrency control as a way to
147+
// help prevent simultaneous updates of a BackupPlanBinding from overwriting
148+
// each other. It is strongly suggested that systems make use of the 'etag' in
149+
// the read-modify-write cycle to perform BackupPlanBinding updates in
150+
// order to avoid race conditions: An `etag` is returned in the response to
151+
// `GetBackupPlanBinding`, and systems are expected to put that etag in
152+
// the request to `UpdateBackupPlanBinding` or
153+
// `DeleteBackupPlanBinding` to ensure that their change will be applied
154+
// to the same version of the resource.
155+
string etag = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
156+
}

google/cloud/gkebackup/v1/common.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ option java_package = "com.google.cloud.gkebackup.v1";
2727
option php_namespace = "Google\\Cloud\\GkeBackup\\V1";
2828
option ruby_package = "Google::Cloud::GkeBackup::V1";
2929

30-
// A list of Kubernetes Namespaces
30+
// A list of Kubernetes Namespaces.
3131
message Namespaces {
32-
// Optional. A list of Kubernetes Namespaces
32+
// Optional. A list of Kubernetes Namespaces.
3333
repeated string namespaces = 1 [(google.api.field_behavior) = OPTIONAL];
3434
}
3535

0 commit comments

Comments
 (0)