Skip to content

Commit 17b39f1

Browse files
Google APIscopybara-github
authored andcommitted
feat: Adds support for configuring scaling settings
Clients can now specify machine type and min/max instances when creating a connector. PiperOrigin-RevId: 469463049
1 parent fcd2684 commit 17b39f1

3 files changed

Lines changed: 44 additions & 20 deletions

File tree

google/cloud/vpcaccess/v1/BUILD.bazel

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ proto_library_with_info(
3838
deps = [
3939
":vpcaccess_proto",
4040
"//google/cloud:common_resources_proto",
41+
"//google/cloud/location:location_proto",
4142
],
4243
)
4344

@@ -67,13 +68,18 @@ java_grpc_library(
6768
java_gapic_library(
6869
name = "vpcaccess_java_gapic",
6970
srcs = [":vpcaccess_proto_with_info"],
71+
gapic_yaml = None,
7072
grpc_service_config = "vpcaccess_grpc_service_config.json",
73+
service_yaml = "vpcaccess_v1.yaml",
7174
test_deps = [
7275
":vpcaccess_java_grpc",
76+
"//google/cloud/location:location_java_grpc",
7377
],
7478
transport = "grpc+rest",
7579
deps = [
7680
":vpcaccess_java_proto",
81+
"//google/api:api_java_proto",
82+
"//google/cloud/location:location_java_proto",
7783
],
7884
)
7985

@@ -131,6 +137,7 @@ go_gapic_library(
131137
transport = "grpc+rest",
132138
deps = [
133139
":vpcaccess_go_proto",
140+
"//google/cloud/location:location_go_proto",
134141
"//google/longrunning:longrunning_go_proto",
135142
"@com_google_cloud_go//longrunning:go_default_library",
136143
"@com_google_cloud_go//longrunning/autogen:go_default_library",
@@ -170,6 +177,9 @@ py_gapic_library(
170177
srcs = [":vpcaccess_proto"],
171178
grpc_service_config = "vpcaccess_grpc_service_config.json",
172179
opt_args = ["warehouse-package-name=google-cloud-vpc-access"],
180+
service_yaml = "vpcaccess_v1.yaml",
181+
deps = [
182+
],
173183
)
174184

175185
py_test(
@@ -287,15 +297,16 @@ ruby_cloud_gapic_library(
287297
name = "vpcaccess_ruby_gapic",
288298
srcs = [":vpcaccess_proto_with_info"],
289299
extra_protoc_parameters = [
290-
"ruby-cloud-gem-name=google-cloud-vpc_access-v1",
291-
"ruby-cloud-env-prefix=VPC_ACCESS",
292-
"ruby-cloud-product-url=https://cloud.google.com/vpc/docs/serverless-vpc-access",
293300
"ruby-cloud-api-id=vpcaccess.googleapis.com",
294301
"ruby-cloud-api-shortname=vpcaccess",
302+
"ruby-cloud-env-prefix=VPC_ACCESS",
303+
"ruby-cloud-gem-name=google-cloud-vpc_access-v1",
304+
"ruby-cloud-product-url=https://cloud.google.com/vpc/docs/serverless-vpc-access",
295305
],
296306
grpc_service_config = "vpcaccess_grpc_service_config.json",
297307
ruby_cloud_description = "Serverless VPC Access enables you to connect from a serverless environment on Google Cloud (Cloud Run, Cloud Functions, or the App Engine standard environment) directly to your VPC network. This connection makes it possible for your serverless environment to access Compute Engine VM instances, Memorystore instances, and any other resources with an internal IP address.",
298308
ruby_cloud_title = "Serverless VPC Access V1",
309+
service_yaml = "vpcaccess_v1.yaml",
299310
deps = [
300311
":vpcaccess_ruby_grpc",
301312
":vpcaccess_ruby_proto",

google/cloud/vpcaccess/v1/vpc_access.proto

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -89,20 +89,6 @@ message Connector {
8989
pattern: "projects/{project}/locations/{location}/connectors/{connector}"
9090
};
9191

92-
// The subnet in which to house the connector
93-
message Subnet {
94-
// Subnet name (relative, not fully qualified).
95-
// E.g. if the full subnet selfLink is
96-
// https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetName}
97-
// the correct input for this field would be {subnetName}
98-
string name = 1;
99-
100-
// Project in which the subnet exists.
101-
// If not set, this project is assumed to be the project for which
102-
// the connector create request was issued.
103-
string project_id = 2;
104-
}
105-
10692
// State of a connector.
10793
enum State {
10894
// Invalid state.
@@ -124,6 +110,20 @@ message Connector {
124110
UPDATING = 5;
125111
}
126112

113+
// The subnet in which to house the connector
114+
message Subnet {
115+
// Subnet name (relative, not fully qualified).
116+
// E.g. if the full subnet selfLink is
117+
// https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetName}
118+
// the correct input for this field would be {subnetName}
119+
string name = 1;
120+
121+
// Project in which the subnet exists.
122+
// If not set, this project is assumed to be the project for which
123+
// the connector create request was issued.
124+
string project_id = 2;
125+
}
126+
127127
// The resource name in the format `projects/*/locations/*/connectors/*`.
128128
string name = 1;
129129

@@ -140,14 +140,23 @@ message Connector {
140140
// Minimum throughput of the connector in Mbps. Default and min is 200.
141141
int32 min_throughput = 5;
142142

143-
// Maximum throughput of the connector in Mbps. Default is 200, max is 1000.
143+
// Maximum throughput of the connector in Mbps. Default is 300, max is 1000.
144144
int32 max_throughput = 6;
145145

146146
// Output only. List of projects using the connector.
147147
repeated string connected_projects = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
148148

149149
// The subnet in which to house the VPC Access Connector.
150150
Subnet subnet = 8;
151+
152+
// Machine type of VM Instance underlying connector. Default is e2-micro
153+
string machine_type = 10;
154+
155+
// Minimum value of instances in autoscaling group underlying the connector.
156+
int32 min_instances = 11;
157+
158+
// Maximum value of instances in autoscaling group underlying the connector.
159+
int32 max_instances = 12;
151160
}
152161

153162
// Request for creating a Serverless VPC Access connector.

google/cloud/vpcaccess/v1/vpcaccess_v1.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ name: vpcaccess.googleapis.com
44
title: Serverless VPC Access API
55

66
apis:
7+
- name: google.cloud.location.Locations
78
- name: google.cloud.vpcaccess.v1.VpcAccessService
9+
- name: google.longrunning.Operations
810

911
types:
1012
- name: google.cloud.vpcaccess.v1.OperationMetadata
@@ -19,7 +21,9 @@ backend:
1921
rules:
2022
- selector: google.cloud.location.Locations.ListLocations
2123
deadline: 30.0
22-
- selector: 'google.cloud.vpcaccess.v1.VpcAccessService.*'
24+
- selector: google.cloud.vpcaccess.v1.VpcAccessService.GetConnector
25+
deadline: 30.0
26+
- selector: google.cloud.vpcaccess.v1.VpcAccessService.ListConnectors
2327
deadline: 30.0
2428
- selector: 'google.longrunning.Operations.*'
2529
deadline: 30.0

0 commit comments

Comments
 (0)