Skip to content

Commit b8691ed

Browse files
Google APIscopybara-github
authored andcommitted
feat: add smart scheduling
feat: add backup indexing docs: remove the next id annotation docs: add output only and optional api field behavior label docs: update retention policy and cron schedule comment to include new constraints from smart scheduling PiperOrigin-RevId: 618989341
1 parent c9a5050 commit b8691ed

10 files changed

Lines changed: 426 additions & 278 deletions

google/cloud/gkebackup/v1/BUILD.bazel

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@
99
# * extra_protoc_file_parameters
1010
# The complete list of preserved parameters can be found in the source code.
1111

12+
# buildifier: disable=load-on-top
13+
1214
# This is an API workspace, having public visibility by default makes perfect sense.
1315
package(default_visibility = ["//visibility:public"])
1416

1517
##############################################################################
1618
# Common
1719
##############################################################################
18-
load("@rules_proto//proto:defs.bzl", "proto_library")
20+
# buildifier: disable=same-origin-load
1921
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
22+
load("@rules_proto//proto:defs.bzl", "proto_library")
2023

2124
proto_library(
2225
name = "gkebackup_proto",
@@ -35,6 +38,10 @@ proto_library(
3538
"//google/api:field_behavior_proto",
3639
"//google/api:resource_proto",
3740
"//google/longrunning:operations_proto",
41+
"//google/type:date_proto",
42+
"//google/type:dayofweek_proto",
43+
"//google/type:timeofday_proto",
44+
"@com_google_protobuf//:duration_proto",
3845
"@com_google_protobuf//:empty_proto",
3946
"@com_google_protobuf//:field_mask_proto",
4047
"@com_google_protobuf//:timestamp_proto",
@@ -54,6 +61,7 @@ proto_library_with_info(
5461
##############################################################################
5562
# Java
5663
##############################################################################
64+
# buildifier: disable=same-origin-load
5765
load(
5866
"@com_google_googleapis_imports//:imports.bzl",
5967
"java_gapic_assembly_gradle_pkg",
@@ -82,9 +90,9 @@ java_gapic_library(
8290
rest_numeric_enums = True,
8391
service_yaml = "gkebackup_v1.yaml",
8492
test_deps = [
93+
":gkebackup_java_grpc",
8594
"//google/cloud/location:location_java_grpc",
8695
"//google/iam/v1:iam_java_grpc",
87-
":gkebackup_java_grpc",
8896
],
8997
transport = "grpc+rest",
9098
deps = [
@@ -120,6 +128,7 @@ java_gapic_assembly_gradle_pkg(
120128
##############################################################################
121129
# Go
122130
##############################################################################
131+
# buildifier: disable=same-origin-load
123132
load(
124133
"@com_google_googleapis_imports//:imports.bzl",
125134
"go_gapic_assembly_pkg",
@@ -135,6 +144,9 @@ go_proto_library(
135144
deps = [
136145
"//google/api:annotations_go_proto",
137146
"//google/longrunning:longrunning_go_proto",
147+
"//google/type:date_go_proto",
148+
"//google/type:dayofweek_go_proto",
149+
"//google/type:timeofday_go_proto",
138150
],
139151
)
140152

@@ -155,6 +167,7 @@ go_gapic_library(
155167
"//google/longrunning:longrunning_go_proto",
156168
"@com_google_cloud_go_longrunning//:go_default_library",
157169
"@com_google_cloud_go_longrunning//autogen:go_default_library",
170+
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
158171
],
159172
)
160173

@@ -173,6 +186,7 @@ go_gapic_assembly_pkg(
173186
##############################################################################
174187
# Python
175188
##############################################################################
189+
# buildifier: disable=same-origin-load
176190
load(
177191
"@com_google_googleapis_imports//:imports.bzl",
178192
"py_gapic_assembly_pkg",
@@ -218,6 +232,7 @@ py_gapic_assembly_pkg(
218232
##############################################################################
219233
# PHP
220234
##############################################################################
235+
# buildifier: disable=same-origin-load
221236
load(
222237
"@com_google_googleapis_imports//:imports.bzl",
223238
"php_gapic_assembly_pkg",
@@ -255,6 +270,7 @@ php_gapic_assembly_pkg(
255270
##############################################################################
256271
# Node.js
257272
##############################################################################
273+
# buildifier: disable=same-origin-load
258274
load(
259275
"@com_google_googleapis_imports//:imports.bzl",
260276
"nodejs_gapic_assembly_pkg",
@@ -285,6 +301,7 @@ nodejs_gapic_assembly_pkg(
285301
##############################################################################
286302
# Ruby
287303
##############################################################################
304+
# buildifier: disable=same-origin-load
288305
load(
289306
"@com_google_googleapis_imports//:imports.bzl",
290307
"ruby_cloud_gapic_library",
@@ -338,6 +355,7 @@ ruby_gapic_assembly_pkg(
338355
##############################################################################
339356
# C#
340357
##############################################################################
358+
# buildifier: disable=same-origin-load
341359
load(
342360
"@com_google_googleapis_imports//:imports.bzl",
343361
"csharp_gapic_assembly_pkg",
@@ -348,7 +366,6 @@ load(
348366

349367
csharp_proto_library(
350368
name = "gkebackup_csharp_proto",
351-
extra_opts = [""],
352369
deps = [":gkebackup_proto"],
353370
)
354371

@@ -385,6 +402,7 @@ csharp_gapic_assembly_pkg(
385402
##############################################################################
386403
# C++
387404
##############################################################################
405+
# buildifier: disable=same-origin-load
388406
load(
389407
"@com_google_googleapis_imports//:imports.bzl",
390408
"cc_grpc_library",

google/cloud/gkebackup/v1/backup.proto

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ option ruby_package = "Google::Cloud::GkeBackup::V1";
3333
// some portion of the state of a GKE cluster, the record of the backup
3434
// operation itself, and an anchor for the underlying artifacts that
3535
// comprise the Backup (the config backup and VolumeBackups).
36-
// Next id: 28
3736
message Backup {
3837
option (google.api.resource) = {
3938
type: "gkebackup.googleapis.com/Backup"
@@ -42,29 +41,31 @@ message Backup {
4241

4342
// Information about the GKE cluster from which this Backup was created.
4443
message ClusterMetadata {
45-
// The source cluster from which this Backup was created.
44+
// Output only. The source cluster from which this Backup was created.
4645
// Valid formats:
4746
//
4847
// - `projects/*/locations/*/clusters/*`
4948
// - `projects/*/zones/*/clusters/*`
5049
//
5150
// This is inherited from the parent BackupPlan's
5251
// [cluster][google.cloud.gkebackup.v1.BackupPlan.cluster] field.
53-
string cluster = 1;
52+
string cluster = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
5453

55-
// The Kubernetes server version of the source cluster.
56-
string k8s_version = 2;
54+
// Output only. The Kubernetes server version of the source cluster.
55+
string k8s_version = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
5756

58-
// A list of the Backup for GKE CRD versions found in the cluster.
59-
map<string, string> backup_crd_versions = 3;
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];
6061

6162
// Platform-specific version
6263
oneof platform_version {
63-
// GKE version
64-
string gke_version = 4;
64+
// Output only. GKE version
65+
string gke_version = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
6566

66-
// Anthos version
67-
string anthos_version = 5;
67+
// Output only. Anthos version
68+
string anthos_version = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
6869
}
6970
}
7071

@@ -113,29 +114,29 @@ message Backup {
113114
// means that the Backup was created manually.
114115
bool manual = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
115116

116-
// A set of custom labels supplied by user.
117-
map<string, string> labels = 6;
117+
// Optional. A set of custom labels supplied by user.
118+
map<string, string> labels = 6 [(google.api.field_behavior) = OPTIONAL];
118119

119-
// Minimum age for this Backup (in days). If this field is set to a non-zero
120-
// value, the Backup will be "locked" against deletion (either manual or
121-
// automatic deletion) for the number of days provided (measured from the
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
122123
// creation time of the Backup). MUST be an integer value between 0-90
123124
// (inclusive).
124125
//
125126
// Defaults to parent BackupPlan's
126127
// [backup_delete_lock_days][google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.backup_delete_lock_days]
127128
// setting and may only be increased
128129
// (either at creation time or in a subsequent update).
129-
int32 delete_lock_days = 7;
130+
int32 delete_lock_days = 7 [(google.api.field_behavior) = OPTIONAL];
130131

131132
// Output only. The time at which an existing delete lock will expire for this
132133
// backup (calculated from create_time +
133134
// [delete_lock_days][google.cloud.gkebackup.v1.Backup.delete_lock_days]).
134135
google.protobuf.Timestamp delete_lock_expire_time = 8
135136
[(google.api.field_behavior) = OUTPUT_ONLY];
136137

137-
// The age (in days) after which this Backup will be automatically deleted.
138-
// Must be an integer value >= 0:
138+
// Optional. The age (in days) after which this Backup will be automatically
139+
// deleted. Must be an integer value >= 0:
139140
//
140141
// - If 0, no automatic deletion will occur for this Backup.
141142
// - If not 0, this must be >=
@@ -147,7 +148,7 @@ message Backup {
147148
// Defaults to the parent BackupPlan's
148149
// [backup_retain_days][google.cloud.gkebackup.v1.BackupPlan.RetentionPolicy.backup_retain_days]
149150
// value.
150-
int32 retain_days = 9;
151+
int32 retain_days = 9 [(google.api.field_behavior) = OPTIONAL];
151152

152153
// Output only. The time at which this Backup will be automatically deleted
153154
// (calculated from create_time +
@@ -230,8 +231,8 @@ message Backup {
230231
// applied to the same version of the resource.
231232
string etag = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
232233

233-
// User specified descriptive string for this Backup.
234-
string description = 25;
234+
// Optional. User specified descriptive string for this Backup.
235+
string description = 25 [(google.api.field_behavior) = OPTIONAL];
235236

236237
// Output only. The total number of Kubernetes Pods contained in the Backup.
237238
int32 pod_count = 26 [(google.api.field_behavior) = OUTPUT_ONLY];

0 commit comments

Comments
 (0)