Skip to content

Commit 5e76753

Browse files
Google APIscopybara-github
authored andcommitted
feat!: removed the nonfunctional GatewayService and replaced it with the GatewayControl service
BREAKING CHANGE: existing client libraries are being regenerated to remove unused functionality and introduce new features. PiperOrigin-RevId: 665485495
1 parent 9f3335a commit 5e76753

5 files changed

Lines changed: 156 additions & 101 deletions

File tree

google/cloud/gkeconnect/gateway/v1beta1/BUILD.bazel

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,27 @@
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 = "gateway_proto",
2326
srcs = [
24-
"gateway.proto",
27+
"control.proto",
2528
],
2629
deps = [
2730
"//google/api:annotations_proto",
2831
"//google/api:client_proto",
29-
"//google/api:httpbody_proto",
32+
"//google/api:field_behavior_proto",
3033
],
3134
)
3235

@@ -41,6 +44,7 @@ proto_library_with_info(
4144
##############################################################################
4245
# Java
4346
##############################################################################
47+
# buildifier: disable=same-origin-load
4448
load(
4549
"@com_google_googleapis_imports//:imports.bzl",
4650
"java_gapic_assembly_gradle_pkg",
@@ -64,7 +68,8 @@ java_grpc_library(
6468
java_gapic_library(
6569
name = "gateway_java_gapic",
6670
srcs = [":gateway_proto_with_info"],
67-
grpc_service_config = "connectgw_grpc_service_config.json",
71+
gapic_yaml = None,
72+
grpc_service_config = "connectgateway_v1beta1_grpc_service_config.json",
6873
rest_numeric_enums = False,
6974
service_yaml = "connectgateway_v1beta1.yaml",
7075
test_deps = [
@@ -80,7 +85,7 @@ java_gapic_library(
8085
java_gapic_test(
8186
name = "gateway_java_gapic_test_suite",
8287
test_classes = [
83-
"com.google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClientTest",
88+
"com.google.cloud.gkeconnect.gateway.v1beta1.GatewayControlClientTest",
8489
],
8590
runtime_deps = [":gateway_java_gapic_test"],
8691
)
@@ -101,6 +106,7 @@ java_gapic_assembly_gradle_pkg(
101106
##############################################################################
102107
# Go
103108
##############################################################################
109+
# buildifier: disable=same-origin-load
104110
load(
105111
"@com_google_googleapis_imports//:imports.bzl",
106112
"go_gapic_assembly_pkg",
@@ -115,14 +121,13 @@ go_proto_library(
115121
protos = [":gateway_proto"],
116122
deps = [
117123
"//google/api:annotations_go_proto",
118-
"//google/api:httpbody_go_proto",
119124
],
120125
)
121126

122127
go_gapic_library(
123128
name = "gateway_go_gapic",
124129
srcs = [":gateway_proto_with_info"],
125-
grpc_service_config = "connectgw_grpc_service_config.json",
130+
grpc_service_config = "connectgateway_v1beta1_grpc_service_config.json",
126131
importpath = "cloud.google.com/go/gkeconnect/gateway/apiv1beta1;gateway",
127132
metadata = True,
128133
release_level = "beta",
@@ -131,7 +136,6 @@ go_gapic_library(
131136
transport = "grpc+rest",
132137
deps = [
133138
":gateway_go_proto",
134-
"//google/api:httpbody_go_proto",
135139
],
136140
)
137141

@@ -150,6 +154,7 @@ go_gapic_assembly_pkg(
150154
##############################################################################
151155
# Python
152156
##############################################################################
157+
# buildifier: disable=same-origin-load
153158
load(
154159
"@com_google_googleapis_imports//:imports.bzl",
155160
"py_gapic_assembly_pkg",
@@ -160,11 +165,13 @@ load(
160165
py_gapic_library(
161166
name = "gateway_py_gapic",
162167
srcs = [":gateway_proto"],
163-
grpc_service_config = "connectgw_grpc_service_config.json",
168+
grpc_service_config = "connectgateway_v1beta1_grpc_service_config.json",
164169
opt_args = ["warehouse-package-name=google-cloud-gke-connect-gateway"],
165170
rest_numeric_enums = False,
166171
service_yaml = "connectgateway_v1beta1.yaml",
167172
transport = "grpc",
173+
deps = [
174+
],
168175
)
169176

170177
py_test(
@@ -188,6 +195,7 @@ py_gapic_assembly_pkg(
188195
##############################################################################
189196
# PHP
190197
##############################################################################
198+
# buildifier: disable=same-origin-load
191199
load(
192200
"@com_google_googleapis_imports//:imports.bzl",
193201
"php_gapic_assembly_pkg",
@@ -203,12 +211,14 @@ php_proto_library(
203211
php_gapic_library(
204212
name = "gateway_php_gapic",
205213
srcs = [":gateway_proto_with_info"],
206-
grpc_service_config = "connectgw_grpc_service_config.json",
214+
grpc_service_config = "connectgateway_v1beta1_grpc_service_config.json",
207215
migration_mode = "MIGRATING",
208216
rest_numeric_enums = False,
209217
service_yaml = "connectgateway_v1beta1.yaml",
210218
transport = "grpc+rest",
211-
deps = [":gateway_php_proto"],
219+
deps = [
220+
":gateway_php_proto",
221+
],
212222
)
213223

214224
# Open Source Packages
@@ -223,6 +233,7 @@ php_gapic_assembly_pkg(
223233
##############################################################################
224234
# Node.js
225235
##############################################################################
236+
# buildifier: disable=same-origin-load
226237
load(
227238
"@com_google_googleapis_imports//:imports.bzl",
228239
"nodejs_gapic_assembly_pkg",
@@ -234,7 +245,7 @@ nodejs_gapic_library(
234245
package_name = "@google-cloud/gke-connect-gateway",
235246
src = ":gateway_proto_with_info",
236247
extra_protoc_parameters = ["metadata"],
237-
grpc_service_config = "connectgw_grpc_service_config.json",
248+
grpc_service_config = "connectgateway_v1beta1_grpc_service_config.json",
238249
package = "google.cloud.gkeconnect.gateway.v1beta1",
239250
rest_numeric_enums = False,
240251
service_yaml = "connectgateway_v1beta1.yaml",
@@ -253,6 +264,7 @@ nodejs_gapic_assembly_pkg(
253264
##############################################################################
254265
# Ruby
255266
##############################################################################
267+
# buildifier: disable=same-origin-load
256268
load(
257269
"@com_google_googleapis_imports//:imports.bzl",
258270
"ruby_cloud_gapic_library",
@@ -276,17 +288,18 @@ ruby_cloud_gapic_library(
276288
name = "gateway_ruby_gapic",
277289
srcs = [":gateway_proto_with_info"],
278290
extra_protoc_parameters = [
279-
"ruby-cloud-gem-name=google-cloud-gke_connect-gateway-v1beta1",
280-
"ruby-cloud-env-prefix=GKE_CONNECT_GATEWAY",
281-
"ruby-cloud-product-url=https://cloud.google.com/anthos/multicluster-management/gateway/",
282291
"ruby-cloud-api-id=connectgateway.googleapis.com",
283292
"ruby-cloud-api-shortname=connectgateway",
293+
"ruby-cloud-env-prefix=GKE_CONNECT_GATEWAY",
294+
"ruby-cloud-gem-name=google-cloud-gke_connect-gateway-v1beta1",
295+
"ruby-cloud-product-url=https://cloud.google.com/anthos/multicluster-management/gateway/",
284296
],
285-
grpc_service_config = "connectgw_grpc_service_config.json",
297+
grpc_service_config = "connectgateway_v1beta1_grpc_service_config.json",
286298
rest_numeric_enums = False,
287299
ruby_cloud_description = "The Connect gateway builds on the power of fleets to let Anthos users connect to and run commands against registered Anthos clusters in a simple, consistent, and secured way, whether the clusters are on Google Cloud, other public clouds, or on premises, and makes it easier to automate DevOps processes across all your clusters.",
288300
ruby_cloud_title = "Connect Gateway V1beta1",
289301
service_yaml = "connectgateway_v1beta1.yaml",
302+
transport = "grpc+rest",
290303
deps = [
291304
":gateway_ruby_grpc",
292305
":gateway_ruby_proto",
@@ -306,6 +319,7 @@ ruby_gapic_assembly_pkg(
306319
##############################################################################
307320
# C#
308321
##############################################################################
322+
# buildifier: disable=same-origin-load
309323
load(
310324
"@com_google_googleapis_imports//:imports.bzl",
311325
"csharp_gapic_assembly_pkg",
@@ -329,9 +343,10 @@ csharp_gapic_library(
329343
name = "gateway_csharp_gapic",
330344
srcs = [":gateway_proto_with_info"],
331345
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
332-
grpc_service_config = "connectgw_grpc_service_config.json",
346+
grpc_service_config = "connectgateway_v1beta1_grpc_service_config.json",
333347
rest_numeric_enums = False,
334348
service_yaml = "connectgateway_v1beta1.yaml",
349+
transport = "grpc+rest",
335350
deps = [
336351
":gateway_csharp_grpc",
337352
":gateway_csharp_proto",
@@ -351,4 +366,21 @@ csharp_gapic_assembly_pkg(
351366
##############################################################################
352367
# C++
353368
##############################################################################
354-
# Put your C++ rules here
369+
# buildifier: disable=same-origin-load
370+
load(
371+
"@com_google_googleapis_imports//:imports.bzl",
372+
"cc_grpc_library",
373+
"cc_proto_library",
374+
)
375+
376+
cc_proto_library(
377+
name = "gateway_cc_proto",
378+
deps = [":gateway_proto"],
379+
)
380+
381+
cc_grpc_library(
382+
name = "gateway_cc_grpc",
383+
srcs = [":gateway_proto"],
384+
grpc_only = True,
385+
deps = [":gateway_cc_proto"],
386+
)

google/cloud/gkeconnect/gateway/v1beta1/connectgateway_v1beta1.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,24 @@ name: connectgateway.googleapis.com
44
title: Connect Gateway API
55

66
apis:
7-
- name: google.cloud.gkeconnect.gateway.v1beta1.GatewayService
7+
- name: google.cloud.gkeconnect.gateway.v1beta1.GatewayControl
88

99
documentation:
1010
summary: |-
1111
The Connect Gateway service allows connectivity from external parties to
1212
connected Kubernetes clusters.
1313
14-
backend:
15-
rules:
16-
- selector: 'google.cloud.gkeconnect.gateway.v1beta1.GatewayService.*'
17-
deadline: 300.0
18-
1914
authentication:
2015
rules:
21-
- selector: 'google.cloud.gkeconnect.gateway.v1beta1.GatewayService.*'
16+
- selector: google.cloud.gkeconnect.gateway.v1beta1.GatewayControl.GenerateCredentials
2217
oauth:
2318
canonical_scopes: |-
2419
https://www.googleapis.com/auth/cloud-platform
20+
21+
publishing:
22+
new_issue_uri: https://issuetracker.google.com/issues/new?component=1618911
23+
documentation_uri: https://cloud.google.com/kubernetes-engine/enterprise/multicluster-management/gateway
24+
api_short_name: connectgateway
25+
github_label: 'api: connectgateway'
26+
doc_tag_prefix: connectgateway
27+
organization: CLOUD

google/cloud/gkeconnect/gateway/v1beta1/connectgw_grpc_service_config.json renamed to google/cloud/gkeconnect/gateway/v1beta1/connectgateway_v1beta1_grpc_service_config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"methodConfig": [{
33
"name": [
4-
{ "service": "google.cloud/gkeconnect.gateway.v1beta1.GatewayService" }
4+
{ "service": "google.cloud.gkeconnect.gateway.v1beta1.GatewayControl", "method": "GenerateCredentials" }
55
],
66
"timeout": "60s",
77
"retryPolicy": {
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// Copyright 2024 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.gkeconnect.gateway.v1beta1;
18+
19+
import "google/api/annotations.proto";
20+
import "google/api/client.proto";
21+
import "google/api/field_behavior.proto";
22+
23+
option csharp_namespace = "Google.Cloud.GkeConnect.Gateway.V1Beta1";
24+
option go_package = "cloud.google.com/go/gkeconnect/gateway/apiv1beta1/gatewaypb;gatewaypb";
25+
option java_multiple_files = true;
26+
option java_outer_classname = "ControlProto";
27+
option java_package = "com.google.cloud.gkeconnect.gateway.v1beta1";
28+
option php_namespace = "Google\\Cloud\\GkeConnect\\Gateway\\V1beta1";
29+
option ruby_package = "Google::Cloud::GkeConnect::Gateway::V1beta1";
30+
31+
// GatewayControl is the control plane API for Connect Gateway.
32+
service GatewayControl {
33+
option (google.api.default_host) = "connectgateway.googleapis.com";
34+
option (google.api.oauth_scopes) =
35+
"https://www.googleapis.com/auth/cloud-platform";
36+
37+
// GenerateCredentials provides connection information that allows a user to
38+
// access the specified membership using Connect Gateway.
39+
rpc GenerateCredentials(GenerateCredentialsRequest)
40+
returns (GenerateCredentialsResponse) {
41+
option (google.api.http) = {
42+
get: "/v1beta1/{name=projects/*/locations/*/memberships/*}:generateCredentials"
43+
};
44+
}
45+
}
46+
47+
// A request for connection information for a particular membership.
48+
message GenerateCredentialsRequest {
49+
// Operating systems requiring specialized kubeconfigs.
50+
enum OperatingSystem {
51+
// Generates a kubeconfig that works for all operating systems not defined
52+
// below.
53+
OPERATING_SYSTEM_UNSPECIFIED = 0;
54+
55+
// Generates a kubeconfig that is specifically designed to work with
56+
// Windows.
57+
OPERATING_SYSTEM_WINDOWS = 1;
58+
}
59+
60+
// Required. The Fleet membership resource.
61+
string name = 1 [(google.api.field_behavior) = REQUIRED];
62+
63+
// Optional. Whether to force the use of Connect Agent-based transport.
64+
//
65+
// This will return a configuration that uses Connect Agent as the underlying
66+
// transport mechanism for cluster types that would otherwise have used a
67+
// different transport. Requires that Connect Agent be installed on the
68+
// cluster. Setting this field to false is equivalent to not setting it.
69+
bool force_use_agent = 2 [(google.api.field_behavior) = OPTIONAL];
70+
71+
// Optional. The Connect Gateway version to be used in the resulting
72+
// configuration.
73+
//
74+
// Leave this field blank to let the server choose the version (recommended).
75+
string version = 3 [(google.api.field_behavior) = OPTIONAL];
76+
77+
// Optional. The namespace to use in the kubeconfig context.
78+
//
79+
// If this field is specified, the server will set the `namespace` field in
80+
// kubeconfig context. If not specified, the `namespace` field is omitted.
81+
string kubernetes_namespace = 4 [(google.api.field_behavior) = OPTIONAL];
82+
83+
// Optional. The operating system where the kubeconfig will be used.
84+
OperatingSystem operating_system = 5 [(google.api.field_behavior) = OPTIONAL];
85+
}
86+
87+
// Connection information for a particular membership.
88+
message GenerateCredentialsResponse {
89+
// A full YAML kubeconfig in serialized format.
90+
bytes kubeconfig = 1;
91+
92+
// The generated URI of the cluster as accessed through the Connect Gateway
93+
// API.
94+
string endpoint = 2;
95+
}

0 commit comments

Comments
 (0)