Skip to content

Commit 8a3ddf0

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add BackupChannel field in BackupPlan
feat: Add RestoreChannel field in RestorePlan feat: Add BackupConfig of Backups in BackupPlanBinding feat: Add support for Project ID in BackupChannel and RestoreChannel docs: minor documentation fixes PiperOrigin-RevId: 758503180
1 parent e6c5fab commit 8a3ddf0

File tree

5 files changed

+102
-6
lines changed

5 files changed

+102
-6
lines changed

google/cloud/gkebackup/v1/backup_channel.proto

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ message BackupChannel {
4646
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
4747

4848
// 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.
49+
// The format is `projects/{projectId}` or `projects/{projectNumber}`.
5250
string destination_project = 2 [
5351
(google.api.field_behavior) = IMMUTABLE,
5452
(google.api.field_behavior) = REQUIRED

google/cloud/gkebackup/v1/backup_plan.proto

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,17 @@ message BackupPlan {
279279
// current rpo_risk_level and action items if any.
280280
string rpo_risk_reason = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
281281

282+
// Output only. The fully qualified name of the BackupChannel to be used to
283+
// create a backup. This field is set only if the cluster being backed up is
284+
// in a different project.
285+
// `projects/*/locations/*/backupChannels/*`
286+
string backup_channel = 18 [
287+
(google.api.field_behavior) = OUTPUT_ONLY,
288+
(google.api.resource_reference) = {
289+
type: "gkebackup.googleapis.com/BackupChannel"
290+
}
291+
];
292+
282293
// Output only. Completion time of the last successful Backup. This is sourced
283294
// from a successful Backup's complete_time field. This field is added to
284295
// maintain consistency with BackupPlanBinding to display last successful

google/cloud/gkebackup/v1/backup_plan_binding.proto

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package google.cloud.gkebackup.v1;
1919
import "google/api/field_behavior.proto";
2020
import "google/api/field_info.proto";
2121
import "google/api/resource.proto";
22+
import "google/cloud/gkebackup/v1/common.proto";
2223
import "google/protobuf/timestamp.proto";
2324

2425
option csharp_namespace = "Google.Cloud.GkeBackup.V1";
@@ -67,6 +68,73 @@ message BackupPlanBinding {
6768
DELETING = 6;
6869
}
6970

71+
// BackupConfigDetails defines the configuration of Backups created via this
72+
// BackupPlan.
73+
message BackupConfigDetails {
74+
// This defines the "scope" of the Backup - which namespaced
75+
// resources in the cluster will be included in a Backup.
76+
// Exactly one of the fields of backup_scope MUST be specified.
77+
oneof backup_scope {
78+
// Output only. If True, include all namespaced resources
79+
bool all_namespaces = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
80+
81+
// Output only. If set, include just the resources in the listed
82+
// namespaces.
83+
Namespaces selected_namespaces = 2
84+
[(google.api.field_behavior) = OUTPUT_ONLY];
85+
86+
// Output only. If set, include just the resources referenced by the
87+
// listed ProtectedApplications.
88+
NamespacedNames selected_applications = 3
89+
[(google.api.field_behavior) = OUTPUT_ONLY];
90+
}
91+
92+
// Output only. This flag specifies whether volume data should be backed
93+
// up when PVCs are included in the scope of a Backup.
94+
//
95+
// Default: False
96+
bool include_volume_data = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
97+
98+
// Output only. This flag specifies whether Kubernetes Secret resources
99+
// should be included when they fall into the scope of Backups.
100+
//
101+
// Default: False
102+
bool include_secrets = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
103+
104+
// Output only. This defines a customer managed encryption key that will
105+
// be used to encrypt the "config" portion (the Kubernetes resources) of
106+
// Backups created via this plan.
107+
//
108+
// Default (empty): Config backup artifacts will not be encrypted.
109+
EncryptionKey encryption_key = 7
110+
[(google.api.field_behavior) = OUTPUT_ONLY];
111+
}
112+
113+
// RetentionPolicyDetails defines a Backup retention policy for a
114+
// BackupPlan.
115+
message RetentionPolicyDetails {
116+
// Optional. Minimum age for Backups created via this BackupPlan (in
117+
// days). This field MUST be an integer value between 0-90 (inclusive). A
118+
// Backup created under this BackupPlan will NOT be deletable until it
119+
// reaches Backup's (create_time + backup_delete_lock_days).
120+
// Updating this field of a BackupPlan does NOT affect existing Backups
121+
// under it. Backups created AFTER a successful update will inherit
122+
// the new value.
123+
//
124+
// Default: 0 (no delete blocking)
125+
int32 backup_delete_lock_days = 1
126+
[(google.api.field_behavior) = OPTIONAL];
127+
128+
// Optional. The default maximum age of a Backup created via this
129+
// BackupPlan. This field MUST be an integer value >= 0 and <= 365. If
130+
// specified, a Backup created under this BackupPlan will be automatically
131+
// deleted after its age reaches (create_time + backup_retain_days). If
132+
// not specified, Backups created under this BackupPlan will NOT be
133+
// subject to automatic deletion.
134+
// Default: 0 (no automatic deletion)
135+
int32 backup_retain_days = 2 [(google.api.field_behavior) = OPTIONAL];
136+
}
137+
70138
// Output only. The number of Kubernetes Pods backed up in the
71139
// last successful Backup created via this BackupPlan.
72140
int32 protected_pod_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
@@ -94,6 +162,16 @@ message BackupPlanBinding {
94162
// `projects/*/locations/*/backupPlans/*/backups/*`
95163
string last_successful_backup = 6
96164
[(google.api.field_behavior) = OUTPUT_ONLY];
165+
166+
// Output only. Contains details about the BackupConfig of Backups created
167+
// via this BackupPlan.
168+
BackupConfigDetails backup_config_details = 7
169+
[(google.api.field_behavior) = OUTPUT_ONLY];
170+
171+
// Output only. Contains details about the RetentionPolicy of Backups
172+
// created via this BackupPlan.
173+
RetentionPolicyDetails retention_policy_details = 8
174+
[(google.api.field_behavior) = OUTPUT_ONLY];
97175
}
98176

99177
// Identifier. The fully qualified name of the BackupPlanBinding.

google/cloud/gkebackup/v1/restore_channel.proto

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ message RestoreChannel {
4646
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
4747

4848
// Required. Immutable. The project into which the backups will be restored.
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.
49+
// The format is `projects/{projectId}` or `projects/{projectNumber}`.
5250
string destination_project = 2 [
5351
(google.api.field_behavior) = IMMUTABLE,
5452
(google.api.field_behavior) = REQUIRED

google/cloud/gkebackup/v1/restore_plan.proto

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,15 @@ message RestorePlan {
128128
// not be used programmatically as this field is not guaranteed to be
129129
// consistent.
130130
string state_reason = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
131+
132+
// Output only. The fully qualified name of the RestoreChannel to be used to
133+
// create a RestorePlan. This field is set only if the `backup_plan` is in a
134+
// different project than the RestorePlan. Format:
135+
// `projects/*/locations/*/restoreChannels/*`
136+
string restore_channel = 13 [
137+
(google.api.field_behavior) = OUTPUT_ONLY,
138+
(google.api.resource_reference) = {
139+
type: "gkebackup.googleapis.com/RestoreChannel"
140+
}
141+
];
131142
}

0 commit comments

Comments
 (0)