Skip to content

Commit 1615617

Browse files
Google APIscopybara-github
authored andcommitted
feat: publish log entry protos for gkebackup platform logging
PiperOrigin-RevId: 403983090
1 parent 5b0219d commit 1615617

7 files changed

Lines changed: 852 additions & 0 deletions

File tree

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
# This file was automatically generated by BuildFileGenerator
2+
3+
# This is an API workspace, having public visibility by default makes perfect sense.
4+
package(default_visibility = ["//visibility:public"])
5+
6+
##############################################################################
7+
# Common
8+
##############################################################################
9+
load("@rules_proto//proto:defs.bzl", "proto_library")
10+
11+
proto_library(
12+
name = "logging_proto",
13+
srcs = [
14+
"logged_backup.proto",
15+
"logged_backup_plan.proto",
16+
"logged_common.proto",
17+
"logged_restore.proto",
18+
"logged_restore_plan.proto",
19+
"logging.proto",
20+
],
21+
deps = [
22+
"//google/rpc:status_proto",
23+
"@com_google_protobuf//:field_mask_proto",
24+
],
25+
)
26+
27+
##############################################################################
28+
# Java
29+
##############################################################################
30+
load(
31+
"@com_google_googleapis_imports//:imports.bzl",
32+
"java_grpc_library",
33+
"java_proto_library",
34+
)
35+
36+
java_proto_library(
37+
name = "logging_java_proto",
38+
deps = [":logging_proto"],
39+
)
40+
41+
java_grpc_library(
42+
name = "logging_java_grpc",
43+
srcs = [":logging_proto"],
44+
deps = [":logging_java_proto"],
45+
)
46+
47+
##############################################################################
48+
# Go
49+
##############################################################################
50+
load(
51+
"@com_google_googleapis_imports//:imports.bzl",
52+
"go_proto_library",
53+
)
54+
55+
go_proto_library(
56+
name = "logging_go_proto",
57+
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
58+
importpath = "google.golang.org/genproto/googleapis/cloud/gkebackup/logging/v1",
59+
protos = [":logging_proto"],
60+
deps = [
61+
"//google/rpc:status_go_proto",
62+
],
63+
)
64+
65+
##############################################################################
66+
# Python
67+
##############################################################################
68+
load(
69+
"@com_google_googleapis_imports//:imports.bzl",
70+
"moved_proto_library",
71+
"py_grpc_library",
72+
"py_proto_library",
73+
)
74+
75+
moved_proto_library(
76+
name = "logging_moved_proto",
77+
srcs = [":logging_proto"],
78+
deps = [
79+
"//google/rpc:status_proto",
80+
"@com_google_protobuf//:field_mask_proto",
81+
],
82+
)
83+
84+
py_proto_library(
85+
name = "logging_py_proto",
86+
deps = [":logging_moved_proto"],
87+
)
88+
89+
py_grpc_library(
90+
name = "logging_py_grpc",
91+
srcs = [":logging_moved_proto"],
92+
deps = [":logging_py_proto"],
93+
)
94+
95+
##############################################################################
96+
# PHP
97+
##############################################################################
98+
load(
99+
"@com_google_googleapis_imports//:imports.bzl",
100+
"php_grpc_library",
101+
"php_proto_library",
102+
)
103+
104+
php_proto_library(
105+
name = "logging_php_proto",
106+
deps = [":logging_proto"],
107+
)
108+
109+
php_grpc_library(
110+
name = "logging_php_grpc",
111+
srcs = [":logging_proto"],
112+
deps = [":logging_php_proto"],
113+
)
114+
115+
##############################################################################
116+
# Node.js
117+
##############################################################################
118+
load(
119+
"@com_google_googleapis_imports//:imports.bzl",
120+
"nodejs_gapic_assembly_pkg",
121+
"nodejs_gapic_library",
122+
)
123+
124+
125+
##############################################################################
126+
# Ruby
127+
##############################################################################
128+
load(
129+
"@com_google_googleapis_imports//:imports.bzl",
130+
"ruby_grpc_library",
131+
"ruby_proto_library",
132+
)
133+
134+
ruby_proto_library(
135+
name = "logging_ruby_proto",
136+
deps = [":logging_proto"],
137+
)
138+
139+
ruby_grpc_library(
140+
name = "logging_ruby_grpc",
141+
srcs = [":logging_proto"],
142+
deps = [":logging_ruby_proto"],
143+
)
144+
145+
##############################################################################
146+
# C#
147+
##############################################################################
148+
load(
149+
"@com_google_googleapis_imports//:imports.bzl",
150+
"csharp_grpc_library",
151+
"csharp_proto_library",
152+
)
153+
154+
csharp_proto_library(
155+
name = "logging_csharp_proto",
156+
deps = [":logging_proto"],
157+
)
158+
159+
csharp_grpc_library(
160+
name = "logging_csharp_grpc",
161+
srcs = [":logging_proto"],
162+
deps = [":logging_csharp_proto"],
163+
)
164+
165+
##############################################################################
166+
# C++
167+
##############################################################################
168+
# Put your C++ code here
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
// Copyright 2021 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.logging.v1;
18+
19+
option go_package = "google.golang.org/genproto/googleapis/cloud/gkebackup/logging/v1;logging";
20+
option java_multiple_files = true;
21+
option java_outer_classname = "LoggedBackupProto";
22+
option java_package = "google.cloud.gkebackup.logging.v1";
23+
option csharp_namespace = "Google.Cloud.GkeBackup.Logging.V1";
24+
option php_namespace = "Google\\Cloud\\GkeBackup\\Logging\\V1";
25+
option ruby_package = "Google::Cloud::GkeBackup::Logging::V1";
26+
27+
// Backup as stored in Platform log. It's used to log the details of
28+
// a createBackup/updateBackup request, so only fields that can be taken
29+
// from API calls are included here.
30+
message LoggedBackup {
31+
// State
32+
enum State {
33+
// The Backup resource is in the process of being created.
34+
STATE_UNSPECIFIED = 0;
35+
36+
// The Backup resource has been created and the associated BackupJob
37+
// Kubernetes resource has been injected into the source cluster.
38+
CREATING = 1;
39+
40+
// The gkebackup agent in the cluster has begun executing the backup
41+
// operation.
42+
IN_PROGRESS = 2;
43+
44+
// The backup operation has completed successfully.
45+
SUCCEEDED = 3;
46+
47+
// The backup operation has failed.
48+
FAILED = 4;
49+
50+
// This Backup resource (and its associated artifacts) is in the process
51+
// of being deleted.
52+
DELETING = 5;
53+
}
54+
55+
// A set of custom labels supplied by user.
56+
map<string, string> labels = 1;
57+
58+
// delete_lock_days specifies the number of days from the create_time of this
59+
// Backup before which deletion will be blocked.
60+
int32 delete_lock_days = 2;
61+
62+
// retain_days specifies the desired number of days from the create_time of
63+
// this Backup after which it will be automatically deleted.
64+
int32 retain_days = 3;
65+
66+
// User specified descriptive string for this Backup.
67+
string description = 4;
68+
69+
// Current state of the Backup
70+
State state = 5;
71+
72+
// Human-readable description of why the backup is in the current `state`.
73+
string state_reason = 6;
74+
}
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
// Copyright 2021 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.logging.v1;
18+
19+
import "google/cloud/gkebackup/logging/v1/logged_common.proto";
20+
21+
option go_package = "google.golang.org/genproto/googleapis/cloud/gkebackup/logging/v1;logging";
22+
option java_multiple_files = true;
23+
option java_outer_classname = "LoggedBackupPlanProto";
24+
option java_package = "google.cloud.gkebackup.logging.v1";
25+
option csharp_namespace = "Google.Cloud.GkeBackup.Logging.V1";
26+
option php_namespace = "Google\\Cloud\\GkeBackup\\Logging\\V1";
27+
option ruby_package = "Google::Cloud::GkeBackup::Logging::V1";
28+
29+
// BackupPlan as stored in Platform log. It's used to log the details of
30+
// a createBackupPlan/updateBackupPlan request, so only fields that can be taken
31+
// from user input are included here.
32+
message LoggedBackupPlan {
33+
// RentionPolicy is an inner message type to define:
34+
// 1. When to automatically delete Backups created under this BackupPlan
35+
// 2. A plan level minimum Backup retain days which blocks deletion
36+
// 3. Lock to disallow any policy updates
37+
message RetentionPolicy {
38+
// Number of days during which deletion of a Backup created under this
39+
// BackupPlan will be blocked.
40+
int32 backup_delete_lock_days = 1;
41+
42+
// Number of days after which the service will delete a Backup.
43+
// If specified, a Backup created under this BackupPlan will be
44+
// automatically deleted after its age reaches create_time +
45+
// backup_retain_days.
46+
int32 backup_retain_days = 2;
47+
48+
// A flag denotes that the retention policy of this BackupPlan is locked.
49+
// If set to True, no further update is allowed on this policy, including
50+
// the 'locked' field itself.
51+
// Default to False.
52+
bool locked = 3;
53+
}
54+
55+
// Schedule, an inner message type defines a cron schedule.
56+
message Schedule {
57+
// A cron style string schedule on which an operation will be executed.
58+
string cron_schedule = 1;
59+
60+
// A flag to toggle scheduled operation.
61+
bool paused = 2;
62+
}
63+
64+
// BackupConfig, an inner message type defines the configuration of creating
65+
// a backup from this BackupPlan
66+
message BackupConfig {
67+
oneof backup_scope {
68+
// If set to true, backup whole cluster
69+
bool all_namespaces = 1;
70+
71+
// If set, backup the list of namespaces
72+
Namespaces selected_namespaces = 2;
73+
74+
// If set, backup the list of applications
75+
NamespacedNames selected_applications = 3;
76+
}
77+
78+
// A boolean flag specifies whether volume data should be backed up
79+
bool include_volume_data = 4;
80+
81+
// A boolean flag specifies whether secrets should be backed up
82+
bool include_secrets = 5;
83+
84+
// Custom encryption key. For preview, support GCP KMS only.
85+
// This only contains the key metadata, and no key material.
86+
EncryptionKey encryption_key = 6;
87+
}
88+
89+
// User specified descriptive string for this BackupPlan.
90+
string description = 1;
91+
92+
// GCP resource name of the source cluster for this BackupPlan.
93+
string cluster = 2;
94+
95+
// RetentionPolicy governs lifecycle of Backups created under this plan.
96+
RetentionPolicy retention_policy = 3;
97+
98+
// A set of custom labels supplied by user.
99+
map<string, string> labels = 4;
100+
101+
// Defines scheduled Backup creation under this BackupPlan.
102+
Schedule backup_schedule = 5;
103+
104+
// A flag indicates whether the plan has been deactivated.
105+
bool deactivated = 6;
106+
107+
// Defines backup configuration of this BackupPlan.
108+
BackupConfig backup_config = 7;
109+
}

0 commit comments

Comments
 (0)