Skip to content

Commit da5f842

Browse files
Google APIscopybara-github
authored andcommitted
feat: Added the gRPC service config for the Service Controller v1 API
docs: Updated some comments. PiperOrigin-RevId: 381355331
1 parent 4ba12b9 commit da5f842

11 files changed

Lines changed: 205 additions & 133 deletions

google/api/servicecontrol/v1/BUILD.bazel

Lines changed: 120 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# This file was automatically generated by BuildFileGenerator
2-
# https://github.com/googleapis/gapic-generator/tree/master/rules_gapic/bazel
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
3+
34
# Most of the manual changes to this file will be overwritten.
45
# It's **only** allowed to change the following rule attribute values:
56
# - names of *_gapic_assembly_* rules
67
# - certain parameters of *_gapic_library rules, including but not limited to:
78
# * extra_protoc_parameters
89
# * extra_protoc_file_parameters
910
# The complete list of preserved parameters can be found in the source code.
11+
1012
# This is an API workspace, having public visibility by default makes perfect sense.
1113
package(default_visibility = ["//visibility:public"])
1214

@@ -31,6 +33,7 @@ proto_library(
3133
deps = [
3234
"//google/api:annotations_proto",
3335
"//google/api:client_proto",
36+
"//google/api:distribution_proto",
3437
"//google/logging/type:type_proto",
3538
"//google/rpc:status_proto",
3639
"@com_google_protobuf//:any_proto",
@@ -51,98 +54,113 @@ proto_library_with_info(
5154
##############################################################################
5255
# Java
5356
##############################################################################
54-
# load(
55-
# "@com_google_googleapis_imports//:imports.bzl",
56-
# "java_gapic_assembly_gradle_pkg",
57-
# "java_gapic_library",
58-
# "java_gapic_test",
59-
# "java_grpc_library",
60-
# "java_proto_library",
61-
# )
62-
# java_proto_library(
63-
# name = "servicecontrol_java_proto",
64-
# deps = [":servicecontrol_proto"],
65-
# )
66-
# java_grpc_library(
67-
# name = "servicecontrol_java_grpc",
68-
# srcs = [":servicecontrol_proto"],
69-
# deps = [":servicecontrol_java_proto"],
70-
# )
71-
# java_gapic_library(
72-
# name = "servicecontrol_java_gapic",
73-
# srcs = [":servicecontrol_proto_with_info"],
74-
# grpc_service_config = None,
75-
# package = "google.api.servicecontrol.v1",
76-
# test_deps = [
77-
# ":servicecontrol_java_grpc",
78-
# ],
79-
# deps = [
80-
# ":servicecontrol_java_proto",
81-
# ],
82-
# )
83-
# java_gapic_test(
84-
# name = "servicecontrol_java_gapic_test_suite",
85-
# test_classes = [
86-
# ],
87-
# runtime_deps = [":servicecontrol_java_gapic_test"],
88-
# )
89-
# # Open Source Packages
90-
# java_gapic_assembly_gradle_pkg(
91-
# name = "google-cloud-api-servicecontrol-v1-java",
92-
# deps = [
93-
# ":servicecontrol_java_gapic",
94-
# ":servicecontrol_java_grpc",
95-
# ":servicecontrol_java_proto",
96-
# ":servicecontrol_proto",
97-
# ],
98-
# )
57+
load(
58+
"@com_google_googleapis_imports//:imports.bzl",
59+
"java_gapic_assembly_gradle_pkg",
60+
"java_gapic_library",
61+
"java_gapic_test",
62+
"java_grpc_library",
63+
"java_proto_library",
64+
)
65+
66+
java_proto_library(
67+
name = "servicecontrol_java_proto",
68+
deps = [":servicecontrol_proto"],
69+
)
70+
71+
java_grpc_library(
72+
name = "servicecontrol_java_grpc",
73+
srcs = [":servicecontrol_proto"],
74+
deps = [":servicecontrol_java_proto"],
75+
)
76+
77+
java_gapic_library(
78+
name = "servicecontrol_java_gapic",
79+
srcs = [":servicecontrol_proto_with_info"],
80+
grpc_service_config = "servicecontrol_grpc_service_config.json",
81+
test_deps = [
82+
":servicecontrol_java_grpc",
83+
],
84+
deps = [
85+
":servicecontrol_java_proto",
86+
],
87+
)
88+
89+
java_gapic_test(
90+
name = "servicecontrol_java_gapic_test_suite",
91+
test_classes = [
92+
"com.google.api.servicecontrol.v1.QuotaControllerClientTest",
93+
"com.google.api.servicecontrol.v1.ServiceControllerClientTest",
94+
],
95+
runtime_deps = [":servicecontrol_java_gapic_test"],
96+
)
97+
98+
# Open Source Packages
99+
java_gapic_assembly_gradle_pkg(
100+
name = "google-cloud-api-servicecontrol-v1-java",
101+
deps = [
102+
":servicecontrol_java_gapic",
103+
":servicecontrol_java_grpc",
104+
":servicecontrol_java_proto",
105+
":servicecontrol_proto",
106+
],
107+
)
108+
99109
##############################################################################
100110
# Go
101111
##############################################################################
102-
# load(
103-
# "@com_google_googleapis_imports//:imports.bzl",
104-
# "go_gapic_assembly_pkg",
105-
# "go_gapic_library",
106-
# "go_proto_library",
107-
# "go_test",
108-
# )
109-
# go_proto_library(
110-
# name = "servicecontrol_go_proto",
111-
# compilers = ["@io_bazel_rules_go//proto:go_grpc"],
112-
# importpath = "google.golang.org/genproto/googleapis/api/servicecontrol/v1",
113-
# protos = [":servicecontrol_proto"],
114-
# deps = [
115-
# "//google/api:annotations_go_proto",
116-
# "//google/logging/type:type_proto",
117-
# "//google/rpc:status_go_proto",
118-
# ],
119-
# )
120-
# go_gapic_library(
121-
# name = "servicecontrol_go_gapic",
122-
# srcs = [":servicecontrol_proto_with_info"],
123-
# grpc_service_config = None,
124-
# importpath = "cloud.google.com/go/api/servicecontrol/apiv1;servicecontrol",
125-
# service_yaml = "servicecontrol.yaml",
126-
# deps = [
127-
# ":servicecontrol_go_proto",
128-
# "@io_bazel_rules_go//proto/wkt:duration_go_proto",
129-
# ],
130-
# )
131-
# go_test(
132-
# name = "servicecontrol_go_gapic_test",
133-
# srcs = [":servicecontrol_go_gapic_srcjar_test"],
134-
# embed = [":servicecontrol_go_gapic"],
135-
# importpath = "cloud.google.com/go/api/servicecontrol/apiv1",
136-
# )
137-
# # Open Source Packages
138-
# go_gapic_assembly_pkg(
139-
# name = "gapi-cloud-api-servicecontrol-v1-go",
140-
# deps = [
141-
# ":servicecontrol_go_gapic",
142-
# ":servicecontrol_go_gapic_srcjar-test.srcjar",
143-
# ":servicecontrol_go_proto",
144-
# ],
145-
# )
112+
load(
113+
"@com_google_googleapis_imports//:imports.bzl",
114+
"go_gapic_assembly_pkg",
115+
"go_gapic_library",
116+
"go_proto_library",
117+
"go_test",
118+
)
119+
120+
go_proto_library(
121+
name = "servicecontrol_go_proto",
122+
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
123+
importpath = "google.golang.org/genproto/googleapis/api/servicecontrol/v1",
124+
protos = [":servicecontrol_proto"],
125+
deps = [
126+
"//google/api:annotations_go_proto",
127+
"//google/api:distribution_go_proto",
128+
"//google/logging/type:type_go_proto",
129+
"//google/rpc:status_go_proto",
130+
],
131+
)
132+
133+
go_gapic_library(
134+
name = "servicecontrol_go_gapic",
135+
srcs = [":servicecontrol_proto_with_info"],
136+
grpc_service_config = "servicecontrol_grpc_service_config.json",
137+
importpath = "cloud.google.com/go/api/servicecontrol/apiv1;servicecontrol",
138+
metadata = True,
139+
service_yaml = "servicecontrol.yaml",
140+
deps = [
141+
":servicecontrol_go_proto",
142+
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
143+
],
144+
)
145+
146+
go_test(
147+
name = "servicecontrol_go_gapic_test",
148+
srcs = [":servicecontrol_go_gapic_srcjar_test"],
149+
embed = [":servicecontrol_go_gapic"],
150+
importpath = "cloud.google.com/go/api/servicecontrol/apiv1",
151+
)
152+
153+
# Open Source Packages
154+
go_gapic_assembly_pkg(
155+
name = "gapi-cloud-api-servicecontrol-v1-go",
156+
deps = [
157+
":servicecontrol_go_gapic",
158+
":servicecontrol_go_gapic_srcjar-metadata.srcjar",
159+
":servicecontrol_go_gapic_srcjar-test.srcjar",
160+
":servicecontrol_go_proto",
161+
],
162+
)
163+
146164
##############################################################################
147165
# Python
148166
##############################################################################
@@ -155,11 +173,11 @@ load(
155173
py_gapic_library(
156174
name = "servicecontrol_py_gapic",
157175
srcs = [":servicecontrol_proto"],
158-
grpc_service_config = None,
176+
grpc_service_config = "servicecontrol_grpc_service_config.json",
159177
opt_args = [
160-
"warehouse-package-name=google-cloud-service-control",
161-
"python-gapic-namespace=google.cloud",
162178
"python-gapic-name=servicecontrol",
179+
"python-gapic-namespace=google.cloud",
180+
"warehouse-package-name=google-cloud-service-control",
163181
],
164182
)
165183

@@ -196,7 +214,8 @@ php_grpc_library(
196214
php_gapic_library(
197215
name = "servicecontrol_php_gapic",
198216
srcs = [":servicecontrol_proto_with_info"],
199-
grpc_service_config = None,
217+
grpc_service_config = "servicecontrol_grpc_service_config.json",
218+
service_yaml = "servicecontrol.yaml",
200219
deps = [
201220
":servicecontrol_php_grpc",
202221
":servicecontrol_php_proto",
@@ -227,7 +246,7 @@ nodejs_gapic_library(
227246
package_name = "@google-cloud/service-control",
228247
src = ":servicecontrol_proto_with_info",
229248
extra_protoc_parameters = ["metadata"],
230-
grpc_service_config = None,
249+
grpc_service_config = "servicecontrol_grpc_service_config.json",
231250
package = "google.api.servicecontrol.v1",
232251
service_yaml = "servicecontrol.yaml",
233252
deps = [],
@@ -269,12 +288,13 @@ ruby_cloud_gapic_library(
269288
name = "servicecontrol_ruby_gapic",
270289
srcs = [":servicecontrol_proto_with_info"],
271290
extra_protoc_parameters = [
272-
"ruby-cloud-gem-name=google-cloud-service_control-v1",
273-
"ruby-cloud-env-prefix=SERVICE_CONTROL",
274-
"ruby-cloud-product-url=https://cloud.google.com/service-infrastructure/docs/overview/",
275291
"ruby-cloud-api-id=servicecontrol.googleapis.com",
276292
"ruby-cloud-api-shortname=servicecontrol",
293+
"ruby-cloud-env-prefix=SERVICE_CONTROL",
294+
"ruby-cloud-gem-name=google-cloud-service_control-v1",
295+
"ruby-cloud-product-url=https://cloud.google.com/service-infrastructure/docs/overview/",
277296
],
297+
grpc_service_config = "servicecontrol_grpc_service_config.json",
278298
ruby_cloud_description = "The Service Control API provides control plane functionality to managed services, such as logging, monitoring, and status checks.",
279299
ruby_cloud_title = "Service Control API V1",
280300
deps = [
@@ -319,7 +339,7 @@ csharp_gapic_library(
319339
name = "servicecontrol_csharp_gapic",
320340
srcs = [":servicecontrol_proto_with_info"],
321341
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
322-
grpc_service_config = None,
342+
grpc_service_config = "servicecontrol_grpc_service_config.json",
323343
deps = [
324344
":servicecontrol_csharp_grpc",
325345
":servicecontrol_csharp_proto",
@@ -335,6 +355,7 @@ csharp_gapic_assembly_pkg(
335355
":servicecontrol_csharp_proto",
336356
],
337357
)
358+
338359
##############################################################################
339360
# C++
340361
##############################################################################

google/api/servicecontrol/v1/check_error.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 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.

google/api/servicecontrol/v1/distribution.proto

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 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.
@@ -16,6 +16,8 @@ syntax = "proto3";
1616

1717
package google.api.servicecontrol.v1;
1818

19+
import "google/api/distribution.proto";
20+
1921
option cc_enable_arenas = true;
2022
option csharp_namespace = "Google.Cloud.ServiceControl.V1";
2123
option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol";
@@ -158,4 +160,7 @@ message Distribution {
158160
// Buckets with arbitrary user-provided width.
159161
ExplicitBuckets explicit_buckets = 9;
160162
}
163+
164+
// Example points. Must be in increasing order of `value` field.
165+
repeated google.api.Distribution.Exemplar exemplars = 10;
161166
}

google/api/servicecontrol/v1/http_request.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 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.

google/api/servicecontrol/v1/log_entry.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 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.

google/api/servicecontrol/v1/metric_value.proto

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 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.
@@ -39,11 +39,13 @@ message MetricValue {
3939
// The start of the time period over which this metric value's measurement
4040
// applies. The time period has different semantics for different metric
4141
// types (cumulative, delta, and gauge). See the metric definition
42-
// documentation in the service configuration for details.
42+
// documentation in the service configuration for details. If not specified,
43+
// [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
4344
google.protobuf.Timestamp start_time = 2;
4445

4546
// The end of the time period over which this metric value's measurement
46-
// applies.
47+
// applies. If not specified,
48+
// [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
4749
google.protobuf.Timestamp end_time = 3;
4850

4951
// The value. The type of value used in the request must

google/api/servicecontrol/v1/operation.proto

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 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.
@@ -34,13 +34,13 @@ option ruby_package = "Google::Cloud::ServiceControl::V1";
3434
message Operation {
3535
// Defines the importance of the data contained in the operation.
3636
enum Importance {
37-
// The API implementation may cache and aggregate the data.
38-
// The data may be lost when rare and unexpected system failures occur.
37+
// Allows data caching, batching, and aggregation. It provides
38+
// higher performance with higher data loss risk.
3939
LOW = 0;
4040

41-
// The API implementation doesn't cache and aggregate the data.
42-
// If the method returns successfully, it's guaranteed that the data has
43-
// been persisted in durable storage.
41+
// Disables data aggregation to minimize data loss. It is for operations
42+
// that contains significant monetary value or audit trail. This feature
43+
// only applies to the client libraries.
4444
HIGH = 1;
4545
}
4646

@@ -76,8 +76,10 @@ message Operation {
7676
google.protobuf.Timestamp start_time = 4;
7777

7878
// End time of the operation.
79-
// Required when the operation is used in [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
80-
// but optional when the operation is used in [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
79+
// Required when the operation is used in
80+
// [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report],
81+
// but optional when the operation is used in
82+
// [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check].
8183
google.protobuf.Timestamp end_time = 5;
8284

8385
// Labels describing the operation. Only the following labels are allowed:

0 commit comments

Comments
 (0)