├── .bazelrc ├── .github └── workflows │ └── testing.yml ├── .gitignore ├── BUILD.bazel ├── LICENSE ├── MODULE.bazel ├── README.md ├── WORKSPACE ├── WORKSPACE.bzlmod └── grpc ├── binlog ├── v1 │ └── binarylog.proto └── v1alpha │ └── binarylog.proto ├── channelz └── v1 │ └── channelz.proto ├── core └── stats.proto ├── examples └── helloworld.proto ├── gcp ├── altscontext.proto ├── handshaker.proto └── transport_security_common.proto ├── health └── v1 │ └── health.proto ├── lb └── v1 │ ├── load_balancer.proto │ └── load_reporter.proto ├── lookup └── v1 │ ├── rls.proto │ └── rls_config.proto ├── reflection ├── v1 │ └── reflection.proto └── v1alpha │ └── reflection.proto ├── service_config └── service_config.proto └── testing ├── benchmark_service.proto ├── control.proto ├── empty.proto ├── messages.proto ├── payloads.proto ├── report_qps_scenario_service.proto ├── stats.proto ├── test.proto ├── worker_service.proto └── xdsconfig └── xdsconfig.proto /.bazelrc: -------------------------------------------------------------------------------- 1 | build --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 2 | -------------------------------------------------------------------------------- /.github/workflows/testing.yml: -------------------------------------------------------------------------------- 1 | name: Testing 2 | 3 | on: 4 | push: 5 | pull_request: 6 | 7 | permissions: 8 | contents: read 9 | 10 | jobs: 11 | test: 12 | runs-on: ubuntu-latest 13 | env: 14 | USE_BAZEL_VERSION: ${{ matrix.bazel_version }} 15 | strategy: 16 | matrix: 17 | bazel_version: ["6.0.0", "7.0.0"] 18 | bzlmod: ["--noenable_bzlmod", "--enable_bzlmod"] 19 | exclude: 20 | - bazel_version: "6.0.0" 21 | bzlmod: "--enable_bzlmod" 22 | steps: 23 | - name: Checkout repo 24 | uses: actions/checkout@v2 25 | 26 | - name: Run bazel build 27 | run: bazelisk build ${{ matrix.bzlmod }} //... 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bazel-bin 2 | bazel-genfiles 3 | bazel-grpc-proto 4 | bazel-out 5 | bazel-testlogs 6 | tools/bazel-* 7 | MODULE.bazel.lock 8 | -------------------------------------------------------------------------------- /BUILD.bazel: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The gRPC Authors 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 | load("@rules_proto//proto:defs.bzl", "proto_library") 16 | 17 | package(default_visibility = [ 18 | "//visibility:private", 19 | ]) 20 | 21 | proto_library( 22 | name = "stats_proto", 23 | srcs = ["grpc/core/stats.proto"], 24 | ) 25 | 26 | proto_library( 27 | name = "messages_proto", 28 | srcs = ["grpc/testing/messages.proto"], 29 | ) 30 | 31 | java_proto_library( 32 | name = "messages_java_proto", 33 | visibility = ["//visibility:public"], 34 | deps = [":messages_proto"], 35 | ) 36 | 37 | proto_library( 38 | name = "benchmark_service_proto", 39 | srcs = ["grpc/testing/benchmark_service.proto"], 40 | deps = [":messages_proto"], 41 | ) 42 | 43 | java_proto_library( 44 | name = "benchmark_service_java_proto", 45 | visibility = ["//visibility:public"], 46 | deps = [":benchmark_service_proto"], 47 | ) 48 | 49 | proto_library( 50 | name = "control_proto", 51 | srcs = [ 52 | "grpc/testing/control.proto", 53 | "grpc/testing/payloads.proto", 54 | "grpc/testing/stats.proto", 55 | ], 56 | deps = [ 57 | ":stats_proto", 58 | "@com_google_protobuf//:timestamp_proto", 59 | ], 60 | ) 61 | 62 | java_proto_library( 63 | name = "control_java_proto", 64 | visibility = ["//visibility:public"], 65 | deps = [":control_proto"], 66 | ) 67 | 68 | proto_library( 69 | name = "xdsconfig", 70 | srcs = ["grpc/testing/xdsconfig/xdsconfig.proto"], 71 | deps = ["@com_google_protobuf//:any_proto"], 72 | ) 73 | 74 | proto_library( 75 | name = "report_qps_scenario_service_proto", 76 | srcs = ["grpc/testing/report_qps_scenario_service.proto"], 77 | deps = [":control_proto"], 78 | ) 79 | 80 | java_proto_library( 81 | name = "report_qps_scenario_service_java_proto", 82 | visibility = ["//visibility:public"], 83 | deps = [":report_qps_scenario_service_proto"], 84 | ) 85 | 86 | proto_library( 87 | name = "worker_service_proto", 88 | srcs = [ 89 | "grpc/testing/worker_service.proto", 90 | ], 91 | deps = [ 92 | ":control_proto", 93 | ], 94 | ) 95 | 96 | java_proto_library( 97 | name = "worker_service_java_proto", 98 | visibility = ["//visibility:public"], 99 | deps = [":worker_service_proto"], 100 | ) 101 | 102 | proto_library( 103 | name = "channelz_proto", 104 | srcs = ["grpc/channelz/v1/channelz.proto"], 105 | visibility = ["//visibility:public"], 106 | deps = [ 107 | "@com_google_protobuf//:any_proto", 108 | "@com_google_protobuf//:duration_proto", 109 | "@com_google_protobuf//:timestamp_proto", 110 | "@com_google_protobuf//:wrappers_proto", 111 | ], 112 | ) 113 | 114 | java_proto_library( 115 | name = "channelz_java_proto", 116 | visibility = ["//visibility:public"], 117 | deps = [":channelz_proto"], 118 | ) 119 | 120 | java_lite_proto_library( 121 | name = "channelz_java_proto_lite", 122 | visibility = ["//visibility:public"], 123 | deps = [":channelz_proto"], 124 | ) 125 | 126 | proto_library( 127 | name = "health_proto", 128 | srcs = ["grpc/health/v1/health.proto"], 129 | visibility = ["//visibility:public"], 130 | ) 131 | 132 | java_proto_library( 133 | name = "health_java_proto", 134 | visibility = ["//visibility:public"], 135 | deps = [":health_proto"], 136 | ) 137 | 138 | proto_library( 139 | name = "alts_handshaker_proto", 140 | srcs = [ 141 | "grpc/gcp/altscontext.proto", 142 | "grpc/gcp/handshaker.proto", 143 | "grpc/gcp/transport_security_common.proto", 144 | ], 145 | visibility = ["//visibility:public"], 146 | ) 147 | 148 | java_proto_library( 149 | name = "alts_handshaker_java_proto", 150 | visibility = ["//visibility:public"], 151 | deps = [":alts_handshaker_proto"], 152 | ) 153 | 154 | proto_library( 155 | name = "binarylog_proto", 156 | srcs = ["grpc/binlog/v1/binarylog.proto"], 157 | visibility = ["//visibility:public"], 158 | deps = [ 159 | "@com_google_protobuf//:duration_proto", 160 | "@com_google_protobuf//:timestamp_proto", 161 | ], 162 | ) 163 | 164 | java_proto_library( 165 | name = "binarylog_java_proto", 166 | visibility = ["//visibility:public"], 167 | deps = [":binarylog_proto"], 168 | ) 169 | 170 | proto_library( 171 | name = "grpclb_load_balancer_proto", 172 | srcs = ["grpc/lb/v1/load_balancer.proto"], 173 | visibility = ["//visibility:public"], 174 | deps = [ 175 | "@com_google_protobuf//:duration_proto", 176 | "@com_google_protobuf//:timestamp_proto", 177 | ], 178 | ) 179 | 180 | java_proto_library( 181 | name = "grpclb_load_balancer_java_proto", 182 | visibility = ["//visibility:public"], 183 | deps = [":grpclb_load_balancer_proto"], 184 | ) 185 | 186 | proto_library( 187 | name = "grpclb_load_reporter_proto", 188 | srcs = ["grpc/lb/v1/load_reporter.proto"], 189 | visibility = ["//visibility:public"], 190 | deps = [ 191 | "@com_google_protobuf//:duration_proto", 192 | "@com_google_protobuf//:timestamp_proto", 193 | ], 194 | ) 195 | 196 | proto_library( 197 | name = "reflection_proto", 198 | srcs = ["grpc/reflection/v1/reflection.proto"], 199 | visibility = ["//visibility:public"], 200 | ) 201 | 202 | java_proto_library( 203 | name = "reflection_java_proto", 204 | visibility = ["//visibility:public"], 205 | deps = [":reflection_proto"], 206 | ) 207 | 208 | # Deprecated: do not use 209 | proto_library( 210 | name = "reflection_proto_deprecated", 211 | srcs = ["grpc/reflection/v1alpha/reflection.proto"], 212 | deprecation = "Use :reflection_proto instead", 213 | visibility = ["//visibility:public"], 214 | ) 215 | 216 | # Deprecated: do not use 217 | java_proto_library( 218 | name = "reflection_java_proto_deprecated", 219 | deprecation = "Use :reflection_java_proto instead", 220 | visibility = ["//visibility:public"], 221 | deps = [":reflection_proto_deprecated"], 222 | ) 223 | 224 | proto_library( 225 | name = "rls_proto", 226 | srcs = ["grpc/lookup/v1/rls.proto"], 227 | visibility = ["//visibility:public"], 228 | deps = ["@com_google_protobuf//:any_proto"], 229 | ) 230 | 231 | java_proto_library( 232 | name = "rls_java_proto", 233 | visibility = ["//visibility:public"], 234 | deps = [":rls_proto"], 235 | ) 236 | 237 | proto_library( 238 | name = "rls_config_proto", 239 | srcs = ["grpc/lookup/v1/rls_config.proto"], 240 | visibility = ["//visibility:public"], 241 | deps = ["@com_google_protobuf//:duration_proto"], 242 | ) 243 | 244 | java_proto_library( 245 | name = "rls_config_java_proto", 246 | visibility = ["//visibility:public"], 247 | deps = [":rls_config_proto"], 248 | ) 249 | 250 | proto_library( 251 | name = "service_config_proto", 252 | srcs = ["grpc/service_config/service_config.proto"], 253 | visibility = ["//visibility:public"], 254 | deps = [ 255 | ":rls_config_proto", 256 | "@com_google_googleapis//google/rpc:code_proto", 257 | "@com_google_protobuf//:duration_proto", 258 | "@com_google_protobuf//:struct_proto", 259 | "@com_google_protobuf//:wrappers_proto", 260 | ], 261 | ) 262 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /MODULE.bazel: -------------------------------------------------------------------------------- 1 | module( 2 | name = "grpc-proto", 3 | version = "0.0.0", 4 | repo_name = "io_grpc_grpc_proto", 5 | ) 6 | 7 | bazel_dep(name = "googleapis", version = "0.0.0-20240326-1c8d509c5", repo_name = "com_google_googleapis") 8 | bazel_dep(name = "rules_proto", version = "4.0.0") 9 | bazel_dep(name = "protobuf", version = "23.1", repo_name = "com_google_protobuf") 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # grpc-proto 2 | This repository contains the canonical versions of common protocol definitions 3 | for peripheral services around gRPC such as health checking and load balancing. 4 | 5 | ## Usage 6 | 7 | For Bazel users, it can be included directly as an `http_repository`. 8 | 9 | Non-Bazel users are expected to copy the proto files from this repo as needed. 10 | However, those copies should not be modified; they should be byte-identical with 11 | the version of grpc-proto that was copied from. Changes should be made to proto 12 | files in this repo before being recopied elsewhere. This prevents forking the 13 | proto and makes clear the "latest version" of the proto. 14 | 15 | Projects that copy the protos should defend against repo-specific modifications. 16 | They should use a script to copy that overwrites any such changes, or have 17 | sanity tests that would fail if a proto was no longer byte-identical. 18 | 19 | ## Directory Structure 20 | 21 | The directory structure should match the protocol package. For example, 22 | `health.proto` in package `grpc.health.v1` will be placed in 23 | `grpc/health/v1/health.proto`. 24 | -------------------------------------------------------------------------------- /WORKSPACE: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The gRPC Authors 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 | # proto_library, cc_proto_library, and java_proto_library rules implicitly 16 | # depend on @com_google_protobuf for protoc and proto runtimes. 17 | # This statement defines the @com_google_protobuf repo. 18 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 19 | 20 | http_archive( 21 | name = "com_google_protobuf", 22 | sha256 = "616bb3536ac1fff3fb1a141450fa28b875e985712170ea7f1bfe5e5fc41e2cd8", 23 | strip_prefix = "protobuf-24.4", 24 | urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protobuf-24.4.tar.gz"], 25 | ) 26 | 27 | load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") 28 | 29 | protobuf_deps() 30 | 31 | # Unfortunately the googleapis repo doesn't seem to be doing regular releases. 32 | # Their last and only one was on Sep 1, 2016. So, we need to pin to a 33 | # particular git commit, and this one was made on Feb 6, 2020. 34 | GOOGLEAPIS_GIT_SHA = "052b274138fce2be80f97b6dcb83ab343c7c8812" 35 | 36 | GOOGLEAPIS_SHA = "e31dc9f889bf53e001998d16385881b507c8cc1455bbe5618b16f0f8cb0fd46f" 37 | 38 | http_archive( 39 | name = "com_google_googleapis", 40 | sha256 = GOOGLEAPIS_SHA, 41 | strip_prefix = "googleapis-" + GOOGLEAPIS_GIT_SHA, 42 | urls = ["https://github.com/googleapis/googleapis/archive/" + GOOGLEAPIS_GIT_SHA + ".tar.gz"], 43 | ) 44 | 45 | load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language") 46 | 47 | switched_rules_by_language( 48 | name = "com_google_googleapis_imports", 49 | ) 50 | -------------------------------------------------------------------------------- /WORKSPACE.bzlmod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grpc/grpc-proto/23f5b568eefcb876e6ebc3b01725f1f20cff999e/WORKSPACE.bzlmod -------------------------------------------------------------------------------- /grpc/binlog/v1/binarylog.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The gRPC Authors 2 | // All rights reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | // The canonical version of this proto can be found at 17 | // https://github.com/grpc/grpc-proto/blob/master/grpc/binlog/v1/binarylog.proto 18 | 19 | syntax = "proto3"; 20 | 21 | package grpc.binarylog.v1; 22 | 23 | import "google/protobuf/duration.proto"; 24 | import "google/protobuf/timestamp.proto"; 25 | 26 | option go_package = "google.golang.org/grpc/binarylog/grpc_binarylog_v1"; 27 | option java_multiple_files = true; 28 | option java_package = "io.grpc.binarylog.v1"; 29 | option java_outer_classname = "BinaryLogProto"; 30 | 31 | // Log entry we store in binary logs 32 | message GrpcLogEntry { 33 | // Enumerates the type of event 34 | // Note the terminology is different from the RPC semantics 35 | // definition, but the same meaning is expressed here. 36 | enum EventType { 37 | EVENT_TYPE_UNKNOWN = 0; 38 | // Header sent from client to server 39 | EVENT_TYPE_CLIENT_HEADER = 1; 40 | // Header sent from server to client 41 | EVENT_TYPE_SERVER_HEADER = 2; 42 | // Message sent from client to server 43 | EVENT_TYPE_CLIENT_MESSAGE = 3; 44 | // Message sent from server to client 45 | EVENT_TYPE_SERVER_MESSAGE = 4; 46 | // A signal that client is done sending 47 | EVENT_TYPE_CLIENT_HALF_CLOSE = 5; 48 | // Trailer indicates the end of the RPC. 49 | // On client side, this event means a trailer was either received 50 | // from the network or the gRPC library locally generated a status 51 | // to inform the application about a failure. 52 | // On server side, this event means the server application requested 53 | // to send a trailer. Note: EVENT_TYPE_CANCEL may still arrive after 54 | // this due to races on server side. 55 | EVENT_TYPE_SERVER_TRAILER = 6; 56 | // A signal that the RPC is cancelled. On client side, this 57 | // indicates the client application requests a cancellation. 58 | // On server side, this indicates that cancellation was detected. 59 | // Note: This marks the end of the RPC. Events may arrive after 60 | // this due to races. For example, on client side a trailer 61 | // may arrive even though the application requested to cancel the RPC. 62 | EVENT_TYPE_CANCEL = 7; 63 | } 64 | 65 | // Enumerates the entity that generates the log entry 66 | enum Logger { 67 | LOGGER_UNKNOWN = 0; 68 | LOGGER_CLIENT = 1; 69 | LOGGER_SERVER = 2; 70 | } 71 | 72 | // The timestamp of the binary log message 73 | google.protobuf.Timestamp timestamp = 1; 74 | 75 | // Uniquely identifies a call. The value must not be 0 in order to disambiguate 76 | // from an unset value. 77 | // Each call may have several log entries, they will all have the same call_id. 78 | // Nothing is guaranteed about their value other than they are unique across 79 | // different RPCs in the same gRPC process. 80 | uint64 call_id = 2; 81 | 82 | // The entry sequence id for this call. The first GrpcLogEntry has a 83 | // value of 1, to disambiguate from an unset value. The purpose of 84 | // this field is to detect missing entries in environments where 85 | // durability or ordering is not guaranteed. 86 | uint64 sequence_id_within_call = 3; 87 | 88 | EventType type = 4; 89 | Logger logger = 5; // One of the above Logger enum 90 | 91 | // The logger uses one of the following fields to record the payload, 92 | // according to the type of the log entry. 93 | oneof payload { 94 | ClientHeader client_header = 6; 95 | ServerHeader server_header = 7; 96 | // Used by EVENT_TYPE_CLIENT_MESSAGE, EVENT_TYPE_SERVER_MESSAGE 97 | Message message = 8; 98 | Trailer trailer = 9; 99 | } 100 | 101 | // true if payload does not represent the full message or metadata. 102 | bool payload_truncated = 10; 103 | 104 | // Peer address information, will only be recorded on the first 105 | // incoming event. On client side, peer is logged on 106 | // EVENT_TYPE_SERVER_HEADER normally or EVENT_TYPE_SERVER_TRAILER in 107 | // the case of trailers-only. On server side, peer is always 108 | // logged on EVENT_TYPE_CLIENT_HEADER. 109 | Address peer = 11; 110 | }; 111 | 112 | message ClientHeader { 113 | // This contains only the metadata from the application. 114 | Metadata metadata = 1; 115 | 116 | // The name of the RPC method, which looks something like: 117 | // // 118 | // Note the leading "/" character. 119 | string method_name = 2; 120 | 121 | // A single process may be used to run multiple virtual 122 | // servers with different identities. 123 | // The authority is the name of such a server identity. 124 | // It is typically a portion of the URI in the form of 125 | // or : . 126 | string authority = 3; 127 | 128 | // the RPC timeout 129 | google.protobuf.Duration timeout = 4; 130 | } 131 | 132 | message ServerHeader { 133 | // This contains only the metadata from the application. 134 | Metadata metadata = 1; 135 | } 136 | 137 | message Trailer { 138 | // This contains only the metadata from the application. 139 | Metadata metadata = 1; 140 | 141 | // The gRPC status code. 142 | uint32 status_code = 2; 143 | 144 | // An original status message before any transport specific 145 | // encoding. 146 | string status_message = 3; 147 | 148 | // The value of the 'grpc-status-details-bin' metadata key. If 149 | // present, this is always an encoded 'google.rpc.Status' message. 150 | bytes status_details = 4; 151 | } 152 | 153 | // Message payload, used by CLIENT_MESSAGE and SERVER_MESSAGE 154 | message Message { 155 | // Length of the message. It may not be the same as the length of the 156 | // data field, as the logging payload can be truncated or omitted. 157 | uint32 length = 1; 158 | // May be truncated or omitted. 159 | bytes data = 2; 160 | } 161 | 162 | // A list of metadata pairs, used in the payload of client header, 163 | // server header, and server trailer. 164 | // Implementations may omit some entries to honor the header limits 165 | // of GRPC_BINARY_LOG_CONFIG. 166 | // 167 | // Header keys added by gRPC are omitted. To be more specific, 168 | // implementations will not log the following entries, and this is 169 | // not to be treated as a truncation: 170 | // - entries handled by grpc that are not user visible, such as those 171 | // that begin with 'grpc-' (with exception of grpc-trace-bin) 172 | // or keys like 'lb-token' 173 | // - transport specific entries, including but not limited to: 174 | // ':path', ':authority', 'content-encoding', 'user-agent', 'te', etc 175 | // - entries added for call credentials 176 | // 177 | // Implementations must always log grpc-trace-bin if it is present. 178 | // Practically speaking it will only be visible on server side because 179 | // grpc-trace-bin is managed by low level client side mechanisms 180 | // inaccessible from the application level. On server side, the 181 | // header is just a normal metadata key. 182 | // The pair will not count towards the size limit. 183 | message Metadata { 184 | repeated MetadataEntry entry = 1; 185 | } 186 | 187 | // A metadata key value pair 188 | message MetadataEntry { 189 | string key = 1; 190 | bytes value = 2; 191 | } 192 | 193 | // Address information 194 | message Address { 195 | enum Type { 196 | TYPE_UNKNOWN = 0; 197 | // address is in 1.2.3.4 form 198 | TYPE_IPV4 = 1; 199 | // address is in IPv6 canonical form (RFC5952 section 4) 200 | // The scope is NOT included in the address string. 201 | TYPE_IPV6 = 2; 202 | // address is UDS string 203 | TYPE_UNIX = 3; 204 | }; 205 | Type type = 1; 206 | string address = 2; 207 | // only for TYPE_IPV4 and TYPE_IPV6 208 | uint32 ip_port = 3; 209 | } 210 | -------------------------------------------------------------------------------- /grpc/binlog/v1alpha/binarylog.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The gRPC Authors 2 | // All rights reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // Service exported by server reflection 16 | 17 | // IMPORTANT NOTE: 18 | // This proto was never stabilized, and is now deprecated. 19 | // The released proto can be found at: grpc/binlog/v1/binarylog.proto 20 | 21 | syntax = "proto3"; 22 | 23 | package grpc.binarylog.v1alpha; 24 | 25 | import "google/protobuf/duration.proto"; 26 | 27 | option java_multiple_files = true; 28 | option java_package = "io.grpc.binarylog.v1alpha"; 29 | option java_outer_classname = "BinaryLogProto"; 30 | 31 | // Log entry we store in binary logs 32 | message GrpcLogEntry { 33 | // Enumerates the type of logs 34 | enum Type { 35 | UNKNOWN_TYPE = 0; 36 | SEND_INITIAL_METADATA = 1; 37 | SEND_TRAILING_METADATA = 2; 38 | SEND_MESSAGE = 3; 39 | RECV_INITIAL_METADATA = 4; 40 | RECV_TRAILING_METADATA = 5; 41 | RECV_MESSAGE = 6; 42 | }; 43 | 44 | // Enumerates the entity that generates the log entry 45 | enum Logger { 46 | UNKNOWN_LOGGER = 0; 47 | CLIENT = 1; 48 | SERVER = 2; 49 | } 50 | 51 | Type type = 1 [deprecated = true]; // One of the above Type enum 52 | Logger logger = 2 [deprecated = true]; // One of the above Logger enum 53 | 54 | // Uniquely identifies a call. Each call may have several log entries, they 55 | // will share the same call_id. 128 bits split into 2 64-bit parts. 56 | Uint128 call_id = 3 [deprecated = true]; 57 | 58 | // The logger uses one of the following fields to record the payload, 59 | // according to the type of the log entry. 60 | oneof payload { 61 | // Used by {SEND,RECV}_INITIAL_METADATA and 62 | // {SEND,RECV}_TRAILING_METADATA. This contains only the metadata 63 | // from the application. 64 | Metadata metadata = 4 [deprecated = true]; 65 | // Used by {SEND,RECV}_MESSAGE 66 | Message message = 5 [deprecated = true]; 67 | } 68 | 69 | // Peer address information, will only be recorded in SEND_INITIAL_METADATA 70 | // and RECV_INITIAL_METADATA entries. 71 | Peer peer = 6 [deprecated = true]; 72 | 73 | // true if payload does not represent the full message or metadata. 74 | bool truncated = 7 [deprecated = true]; 75 | 76 | // The method name. Logged for the first entry: 77 | // RECV_INITIAL_METADATA for server side or 78 | // SEND_INITIAL_METADATA for client side. 79 | string method_name = 8 [deprecated = true]; 80 | 81 | // status_code and status_message: 82 | // Only present for SEND_TRAILING_METADATA on server side or 83 | // RECV_TRAILING_METADATA on client side. 84 | uint32 status_code = 9 [deprecated = true]; 85 | 86 | // An original status message before any transport specific 87 | // encoding. 88 | string status_message = 10 [deprecated = true]; 89 | 90 | // The value of the 'grpc-status-details-bin' metadata key. If 91 | // present, this is always an encoded 'google.rpc.Status' message. 92 | bytes status_details = 11 [deprecated = true]; 93 | 94 | // the RPC timeout 95 | google.protobuf.Duration timeout = 12 [deprecated = true]; 96 | 97 | // The entry sequence id for this call. The first GrpcLogEntry has a 98 | // value of 1, to disambiguate from an unset value. The purpose of 99 | // this field is to detect missing entries in environments where 100 | // durability or ordering is not guaranteed. 101 | uint32 sequence_id_within_call = 13 [deprecated = true]; 102 | }; 103 | 104 | // Message payload, used by REQUEST and RESPONSE 105 | message Message { 106 | // This flag is currently used to indicate whether the payload is compressed, 107 | // it may contain other semantics in the future. Value of 1 indicates that the 108 | // binary octet sequence of Message is compressed using the mechanism declared 109 | // by the Message-Encoding header. A value of 0 indicates that no encoding of 110 | // Message bytes has occurred. 111 | uint32 flags = 1 [deprecated = true]; // TODO(zpencer): this is changed because there is no uint8 112 | // Length of the message. It may not be the same as the length of the 113 | // data field, as the logging payload can be truncated or omitted. 114 | uint32 length = 2 [deprecated = true]; 115 | // May be truncated or omitted. 116 | bytes data = 3 [deprecated = true]; 117 | } 118 | 119 | // A list of metadata pairs, used in the payload of CLIENT_INIT_METADATA, 120 | // SERVER_INIT_METADATA and TRAILING_METADATA 121 | // Implementations may omit some entries to honor the header limits 122 | // of GRPC_BINARY_LOG_CONFIG. 123 | // 124 | // Implementations will not log the following entries, and this is 125 | // not to be treated as a truncation: 126 | // - entries handled by grpc that are not user visible, such as those 127 | // that begin with 'grpc-' or keys like 'lb-token' 128 | // - transport specific entries, including but not limited to: 129 | // ':path', ':authority', 'content-encoding', 'user-agent', 'te', etc 130 | // - entries added for call credentials 131 | message Metadata { 132 | repeated MetadataEntry entry = 1 [deprecated = true]; 133 | } 134 | 135 | // A metadata key value pair 136 | message MetadataEntry { 137 | bytes key = 1 [deprecated = true]; 138 | bytes value = 2 [deprecated = true]; 139 | } 140 | 141 | // Peer information 142 | message Peer { 143 | enum PeerType { 144 | UNKNOWN_PEERTYPE = 0; 145 | // address is the address in 1.2.3.4 form 146 | PEER_IPV4 = 1; 147 | // address the address in canonical form (RFC5952 section 4) 148 | // The scope is NOT included in the peer string. 149 | PEER_IPV6 = 2; 150 | // address is UDS string 151 | PEER_UNIX = 3; 152 | }; 153 | PeerType peer_type = 1 [deprecated = true]; 154 | bytes peer = 2 [deprecated = true]; // will be removed: do not use 155 | string address = 3 [deprecated = true]; 156 | // only for PEER_IPV4 and PEER_IPV6 157 | uint32 ip_port = 4 [deprecated = true]; 158 | } 159 | 160 | // Used to record call_id. 161 | message Uint128 { 162 | fixed64 high = 1 [deprecated = true]; 163 | fixed64 low = 2 [deprecated = true]; 164 | }; 165 | -------------------------------------------------------------------------------- /grpc/channelz/v1/channelz.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The gRPC Authors 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 | // This file defines an interface for exporting monitoring information 16 | // out of gRPC servers. See the full design at 17 | // https://github.com/grpc/proposal/blob/master/A14-channelz.md 18 | // 19 | // The canonical version of this proto can be found at 20 | // https://github.com/grpc/grpc-proto/blob/master/grpc/channelz/v1/channelz.proto 21 | 22 | syntax = "proto3"; 23 | 24 | package grpc.channelz.v1; 25 | 26 | import "google/protobuf/any.proto"; 27 | import "google/protobuf/duration.proto"; 28 | import "google/protobuf/timestamp.proto"; 29 | import "google/protobuf/wrappers.proto"; 30 | 31 | option go_package = "google.golang.org/grpc/channelz/grpc_channelz_v1"; 32 | option java_multiple_files = true; 33 | option java_package = "io.grpc.channelz.v1"; 34 | option java_outer_classname = "ChannelzProto"; 35 | 36 | // Channel is a logical grouping of channels, subchannels, and sockets. 37 | message Channel { 38 | // The identifier for this channel. This should be set. 39 | ChannelRef ref = 1; 40 | // Data specific to this channel. 41 | ChannelData data = 2; 42 | // At most one of 'channel_ref+subchannel_ref' and 'socket' is set. 43 | 44 | // There are no ordering guarantees on the order of channel refs. 45 | // There may not be cycles in the ref graph. 46 | // A channel ref may be present in more than one channel or subchannel. 47 | repeated ChannelRef channel_ref = 3; 48 | 49 | // At most one of 'channel_ref+subchannel_ref' and 'socket' is set. 50 | // There are no ordering guarantees on the order of subchannel refs. 51 | // There may not be cycles in the ref graph. 52 | // A sub channel ref may be present in more than one channel or subchannel. 53 | repeated SubchannelRef subchannel_ref = 4; 54 | 55 | // There are no ordering guarantees on the order of sockets. 56 | repeated SocketRef socket_ref = 5; 57 | } 58 | 59 | // Subchannel is a logical grouping of channels, subchannels, and sockets. 60 | // A subchannel is load balanced over by its ancestor 61 | message Subchannel { 62 | // The identifier for this channel. 63 | SubchannelRef ref = 1; 64 | // Data specific to this channel. 65 | ChannelData data = 2; 66 | // At most one of 'channel_ref+subchannel_ref' and 'socket' is set. 67 | 68 | // There are no ordering guarantees on the order of channel refs. 69 | // There may not be cycles in the ref graph. 70 | // A channel ref may be present in more than one channel or subchannel. 71 | repeated ChannelRef channel_ref = 3; 72 | 73 | // At most one of 'channel_ref+subchannel_ref' and 'socket' is set. 74 | // There are no ordering guarantees on the order of subchannel refs. 75 | // There may not be cycles in the ref graph. 76 | // A sub channel ref may be present in more than one channel or subchannel. 77 | repeated SubchannelRef subchannel_ref = 4; 78 | 79 | // There are no ordering guarantees on the order of sockets. 80 | repeated SocketRef socket_ref = 5; 81 | } 82 | 83 | // These come from the specified states in this document: 84 | // https://github.com/grpc/grpc/blob/master/doc/connectivity-semantics-and-api.md 85 | message ChannelConnectivityState { 86 | enum State { 87 | UNKNOWN = 0; 88 | IDLE = 1; 89 | CONNECTING = 2; 90 | READY = 3; 91 | TRANSIENT_FAILURE = 4; 92 | SHUTDOWN = 5; 93 | } 94 | State state = 1; 95 | } 96 | 97 | // Channel data is data related to a specific Channel or Subchannel. 98 | message ChannelData { 99 | // The connectivity state of the channel or subchannel. Implementations 100 | // should always set this. 101 | ChannelConnectivityState state = 1; 102 | 103 | // The target this channel originally tried to connect to. May be absent 104 | string target = 2; 105 | 106 | // A trace of recent events on the channel. May be absent. 107 | ChannelTrace trace = 3; 108 | 109 | // The number of calls started on the channel 110 | int64 calls_started = 4; 111 | // The number of calls that have completed with an OK status 112 | int64 calls_succeeded = 5; 113 | // The number of calls that have completed with a non-OK status 114 | int64 calls_failed = 6; 115 | 116 | // The last time a call was started on the channel. 117 | google.protobuf.Timestamp last_call_started_timestamp = 7; 118 | } 119 | 120 | // A trace event is an interesting thing that happened to a channel or 121 | // subchannel, such as creation, address resolution, subchannel creation, etc. 122 | message ChannelTraceEvent { 123 | // High level description of the event. 124 | string description = 1; 125 | // The supported severity levels of trace events. 126 | enum Severity { 127 | CT_UNKNOWN = 0; 128 | CT_INFO = 1; 129 | CT_WARNING = 2; 130 | CT_ERROR = 3; 131 | } 132 | // the severity of the trace event 133 | Severity severity = 2; 134 | // When this event occurred. 135 | google.protobuf.Timestamp timestamp = 3; 136 | // ref of referenced channel or subchannel. 137 | // Optional, only present if this event refers to a child object. For example, 138 | // this field would be filled if this trace event was for a subchannel being 139 | // created. 140 | oneof child_ref { 141 | ChannelRef channel_ref = 4; 142 | SubchannelRef subchannel_ref = 5; 143 | } 144 | } 145 | 146 | // ChannelTrace represents the recent events that have occurred on the channel. 147 | message ChannelTrace { 148 | // Number of events ever logged in this tracing object. This can differ from 149 | // events.size() because events can be overwritten or garbage collected by 150 | // implementations. 151 | int64 num_events_logged = 1; 152 | // Time that this channel was created. 153 | google.protobuf.Timestamp creation_timestamp = 2; 154 | // List of events that have occurred on this channel. 155 | repeated ChannelTraceEvent events = 3; 156 | } 157 | 158 | // ChannelRef is a reference to a Channel. 159 | message ChannelRef { 160 | // The globally unique id for this channel. Must be a positive number. 161 | int64 channel_id = 1; 162 | // An optional name associated with the channel. 163 | string name = 2; 164 | // Intentionally don't use field numbers from other refs. 165 | reserved 3, 4, 5, 6, 7, 8; 166 | } 167 | 168 | // SubchannelRef is a reference to a Subchannel. 169 | message SubchannelRef { 170 | // The globally unique id for this subchannel. Must be a positive number. 171 | int64 subchannel_id = 7; 172 | // An optional name associated with the subchannel. 173 | string name = 8; 174 | // Intentionally don't use field numbers from other refs. 175 | reserved 1, 2, 3, 4, 5, 6; 176 | } 177 | 178 | // SocketRef is a reference to a Socket. 179 | message SocketRef { 180 | // The globally unique id for this socket. Must be a positive number. 181 | int64 socket_id = 3; 182 | // An optional name associated with the socket. 183 | string name = 4; 184 | // Intentionally don't use field numbers from other refs. 185 | reserved 1, 2, 5, 6, 7, 8; 186 | } 187 | 188 | // ServerRef is a reference to a Server. 189 | message ServerRef { 190 | // A globally unique identifier for this server. Must be a positive number. 191 | int64 server_id = 5; 192 | // An optional name associated with the server. 193 | string name = 6; 194 | // Intentionally don't use field numbers from other refs. 195 | reserved 1, 2, 3, 4, 7, 8; 196 | } 197 | 198 | // Server represents a single server. There may be multiple servers in a single 199 | // program. 200 | message Server { 201 | // The identifier for a Server. This should be set. 202 | ServerRef ref = 1; 203 | // The associated data of the Server. 204 | ServerData data = 2; 205 | 206 | // The sockets that the server is listening on. There are no ordering 207 | // guarantees. This may be absent. 208 | repeated SocketRef listen_socket = 3; 209 | } 210 | 211 | // ServerData is data for a specific Server. 212 | message ServerData { 213 | // A trace of recent events on the server. May be absent. 214 | ChannelTrace trace = 1; 215 | 216 | // The number of incoming calls started on the server 217 | int64 calls_started = 2; 218 | // The number of incoming calls that have completed with an OK status 219 | int64 calls_succeeded = 3; 220 | // The number of incoming calls that have a completed with a non-OK status 221 | int64 calls_failed = 4; 222 | 223 | // The last time a call was started on the server. 224 | google.protobuf.Timestamp last_call_started_timestamp = 5; 225 | } 226 | 227 | // Information about an actual connection. Pronounced "sock-ay". 228 | message Socket { 229 | // The identifier for the Socket. 230 | SocketRef ref = 1; 231 | 232 | // Data specific to this Socket. 233 | SocketData data = 2; 234 | // The locally bound address. 235 | Address local = 3; 236 | // The remote bound address. May be absent. 237 | Address remote = 4; 238 | // Security details for this socket. May be absent if not available, or 239 | // there is no security on the socket. 240 | Security security = 5; 241 | 242 | // Optional, represents the name of the remote endpoint, if different than 243 | // the original target name. 244 | string remote_name = 6; 245 | } 246 | 247 | // SocketData is data associated for a specific Socket. The fields present 248 | // are specific to the implementation, so there may be minor differences in 249 | // the semantics. (e.g. flow control windows) 250 | message SocketData { 251 | // The number of streams that have been started. 252 | int64 streams_started = 1; 253 | // The number of streams that have ended successfully: 254 | // On client side, received frame with eos bit set; 255 | // On server side, sent frame with eos bit set. 256 | int64 streams_succeeded = 2; 257 | // The number of streams that have ended unsuccessfully: 258 | // On client side, ended without receiving frame with eos bit set; 259 | // On server side, ended without sending frame with eos bit set. 260 | int64 streams_failed = 3; 261 | // The number of grpc messages successfully sent on this socket. 262 | int64 messages_sent = 4; 263 | // The number of grpc messages received on this socket. 264 | int64 messages_received = 5; 265 | 266 | // The number of keep alives sent. This is typically implemented with HTTP/2 267 | // ping messages. 268 | int64 keep_alives_sent = 6; 269 | 270 | // The last time a stream was created by this endpoint. Usually unset for 271 | // servers. 272 | google.protobuf.Timestamp last_local_stream_created_timestamp = 7; 273 | // The last time a stream was created by the remote endpoint. Usually unset 274 | // for clients. 275 | google.protobuf.Timestamp last_remote_stream_created_timestamp = 8; 276 | 277 | // The last time a message was sent by this endpoint. 278 | google.protobuf.Timestamp last_message_sent_timestamp = 9; 279 | // The last time a message was received by this endpoint. 280 | google.protobuf.Timestamp last_message_received_timestamp = 10; 281 | 282 | // The amount of window, granted to the local endpoint by the remote endpoint. 283 | // This may be slightly out of date due to network latency. This does NOT 284 | // include stream level or TCP level flow control info. 285 | google.protobuf.Int64Value local_flow_control_window = 11; 286 | 287 | // The amount of window, granted to the remote endpoint by the local endpoint. 288 | // This may be slightly out of date due to network latency. This does NOT 289 | // include stream level or TCP level flow control info. 290 | google.protobuf.Int64Value remote_flow_control_window = 12; 291 | 292 | // Socket options set on this socket. May be absent if 'summary' is set 293 | // on GetSocketRequest. 294 | repeated SocketOption option = 13; 295 | } 296 | 297 | // Address represents the address used to create the socket. 298 | message Address { 299 | message TcpIpAddress { 300 | // Either the IPv4 or IPv6 address in bytes. Will be either 4 bytes or 16 301 | // bytes in length. 302 | bytes ip_address = 1; 303 | // 0-64k, or -1 if not appropriate. 304 | int32 port = 2; 305 | } 306 | // A Unix Domain Socket address. 307 | message UdsAddress { 308 | string filename = 1; 309 | } 310 | // An address type not included above. 311 | message OtherAddress { 312 | // The human readable version of the value. This value should be set. 313 | string name = 1; 314 | // The actual address message. 315 | google.protobuf.Any value = 2; 316 | } 317 | 318 | oneof address { 319 | TcpIpAddress tcpip_address = 1; 320 | UdsAddress uds_address = 2; 321 | OtherAddress other_address = 3; 322 | } 323 | } 324 | 325 | // Security represents details about how secure the socket is. 326 | message Security { 327 | message Tls { 328 | oneof cipher_suite { 329 | // The cipher suite name in the RFC 4346 format: 330 | // https://tools.ietf.org/html/rfc4346#appendix-C 331 | string standard_name = 1; 332 | // Some other way to describe the cipher suite if 333 | // the RFC 4346 name is not available. 334 | string other_name = 2; 335 | } 336 | // the certificate used by this endpoint. 337 | bytes local_certificate = 3; 338 | // the certificate used by the remote endpoint. 339 | bytes remote_certificate = 4; 340 | } 341 | message OtherSecurity { 342 | // The human readable version of the value. 343 | string name = 1; 344 | // The actual security details message. 345 | google.protobuf.Any value = 2; 346 | } 347 | oneof model { 348 | Tls tls = 1; 349 | OtherSecurity other = 2; 350 | } 351 | } 352 | 353 | // SocketOption represents socket options for a socket. Specifically, these 354 | // are the options returned by getsockopt(). 355 | message SocketOption { 356 | // The full name of the socket option. Typically this will be the upper case 357 | // name, such as "SO_REUSEPORT". 358 | string name = 1; 359 | // The human readable value of this socket option. At least one of value or 360 | // additional will be set. 361 | string value = 2; 362 | // Additional data associated with the socket option. At least one of value 363 | // or additional will be set. 364 | google.protobuf.Any additional = 3; 365 | } 366 | 367 | // For use with SocketOption's additional field. This is primarily used for 368 | // SO_RCVTIMEO and SO_SNDTIMEO 369 | message SocketOptionTimeout { 370 | google.protobuf.Duration duration = 1; 371 | } 372 | 373 | // For use with SocketOption's additional field. This is primarily used for 374 | // SO_LINGER. 375 | message SocketOptionLinger { 376 | // active maps to `struct linger.l_onoff` 377 | bool active = 1; 378 | // duration maps to `struct linger.l_linger` 379 | google.protobuf.Duration duration = 2; 380 | } 381 | 382 | // For use with SocketOption's additional field. Tcp info for 383 | // SOL_TCP and TCP_INFO. 384 | message SocketOptionTcpInfo { 385 | uint32 tcpi_state = 1; 386 | 387 | uint32 tcpi_ca_state = 2; 388 | uint32 tcpi_retransmits = 3; 389 | uint32 tcpi_probes = 4; 390 | uint32 tcpi_backoff = 5; 391 | uint32 tcpi_options = 6; 392 | uint32 tcpi_snd_wscale = 7; 393 | uint32 tcpi_rcv_wscale = 8; 394 | 395 | uint32 tcpi_rto = 9; 396 | uint32 tcpi_ato = 10; 397 | uint32 tcpi_snd_mss = 11; 398 | uint32 tcpi_rcv_mss = 12; 399 | 400 | uint32 tcpi_unacked = 13; 401 | uint32 tcpi_sacked = 14; 402 | uint32 tcpi_lost = 15; 403 | uint32 tcpi_retrans = 16; 404 | uint32 tcpi_fackets = 17; 405 | 406 | uint32 tcpi_last_data_sent = 18; 407 | uint32 tcpi_last_ack_sent = 19; 408 | uint32 tcpi_last_data_recv = 20; 409 | uint32 tcpi_last_ack_recv = 21; 410 | 411 | uint32 tcpi_pmtu = 22; 412 | uint32 tcpi_rcv_ssthresh = 23; 413 | uint32 tcpi_rtt = 24; 414 | uint32 tcpi_rttvar = 25; 415 | uint32 tcpi_snd_ssthresh = 26; 416 | uint32 tcpi_snd_cwnd = 27; 417 | uint32 tcpi_advmss = 28; 418 | uint32 tcpi_reordering = 29; 419 | } 420 | 421 | // Channelz is a service exposed by gRPC servers that provides detailed debug 422 | // information. 423 | service Channelz { 424 | // Gets all root channels (i.e. channels the application has directly 425 | // created). This does not include subchannels nor non-top level channels. 426 | rpc GetTopChannels(GetTopChannelsRequest) returns (GetTopChannelsResponse); 427 | // Gets all servers that exist in the process. 428 | rpc GetServers(GetServersRequest) returns (GetServersResponse); 429 | // Returns a single Server, or else a NOT_FOUND code. 430 | rpc GetServer(GetServerRequest) returns (GetServerResponse); 431 | // Gets all server sockets that exist in the process. 432 | rpc GetServerSockets(GetServerSocketsRequest) returns (GetServerSocketsResponse); 433 | // Returns a single Channel, or else a NOT_FOUND code. 434 | rpc GetChannel(GetChannelRequest) returns (GetChannelResponse); 435 | // Returns a single Subchannel, or else a NOT_FOUND code. 436 | rpc GetSubchannel(GetSubchannelRequest) returns (GetSubchannelResponse); 437 | // Returns a single Socket or else a NOT_FOUND code. 438 | rpc GetSocket(GetSocketRequest) returns (GetSocketResponse); 439 | } 440 | 441 | message GetTopChannelsRequest { 442 | // start_channel_id indicates that only channels at or above this id should be 443 | // included in the results. 444 | // To request the first page, this should be set to 0. To request 445 | // subsequent pages, the client generates this value by adding 1 to 446 | // the highest seen result ID. 447 | int64 start_channel_id = 1; 448 | 449 | // If non-zero, the server will return a page of results containing 450 | // at most this many items. If zero, the server will choose a 451 | // reasonable page size. Must never be negative. 452 | int64 max_results = 2; 453 | } 454 | 455 | message GetTopChannelsResponse { 456 | // list of channels that the connection detail service knows about. Sorted in 457 | // ascending channel_id order. 458 | // Must contain at least 1 result, otherwise 'end' must be true. 459 | repeated Channel channel = 1; 460 | // If set, indicates that the list of channels is the final list. Requesting 461 | // more channels can only return more if they are created after this RPC 462 | // completes. 463 | bool end = 2; 464 | } 465 | 466 | message GetServersRequest { 467 | // start_server_id indicates that only servers at or above this id should be 468 | // included in the results. 469 | // To request the first page, this must be set to 0. To request 470 | // subsequent pages, the client generates this value by adding 1 to 471 | // the highest seen result ID. 472 | int64 start_server_id = 1; 473 | 474 | // If non-zero, the server will return a page of results containing 475 | // at most this many items. If zero, the server will choose a 476 | // reasonable page size. Must never be negative. 477 | int64 max_results = 2; 478 | } 479 | 480 | message GetServersResponse { 481 | // list of servers that the connection detail service knows about. Sorted in 482 | // ascending server_id order. 483 | // Must contain at least 1 result, otherwise 'end' must be true. 484 | repeated Server server = 1; 485 | // If set, indicates that the list of servers is the final list. Requesting 486 | // more servers will only return more if they are created after this RPC 487 | // completes. 488 | bool end = 2; 489 | } 490 | 491 | message GetServerRequest { 492 | // server_id is the identifier of the specific server to get. 493 | int64 server_id = 1; 494 | } 495 | 496 | message GetServerResponse { 497 | // The Server that corresponds to the requested server_id. This field 498 | // should be set. 499 | Server server = 1; 500 | } 501 | 502 | message GetServerSocketsRequest { 503 | int64 server_id = 1; 504 | // start_socket_id indicates that only sockets at or above this id should be 505 | // included in the results. 506 | // To request the first page, this must be set to 0. To request 507 | // subsequent pages, the client generates this value by adding 1 to 508 | // the highest seen result ID. 509 | int64 start_socket_id = 2; 510 | 511 | // If non-zero, the server will return a page of results containing 512 | // at most this many items. If zero, the server will choose a 513 | // reasonable page size. Must never be negative. 514 | int64 max_results = 3; 515 | } 516 | 517 | message GetServerSocketsResponse { 518 | // list of socket refs that the connection detail service knows about. Sorted in 519 | // ascending socket_id order. 520 | // Must contain at least 1 result, otherwise 'end' must be true. 521 | repeated SocketRef socket_ref = 1; 522 | // If set, indicates that the list of sockets is the final list. Requesting 523 | // more sockets will only return more if they are created after this RPC 524 | // completes. 525 | bool end = 2; 526 | } 527 | 528 | message GetChannelRequest { 529 | // channel_id is the identifier of the specific channel to get. 530 | int64 channel_id = 1; 531 | } 532 | 533 | message GetChannelResponse { 534 | // The Channel that corresponds to the requested channel_id. This field 535 | // should be set. 536 | Channel channel = 1; 537 | } 538 | 539 | message GetSubchannelRequest { 540 | // subchannel_id is the identifier of the specific subchannel to get. 541 | int64 subchannel_id = 1; 542 | } 543 | 544 | message GetSubchannelResponse { 545 | // The Subchannel that corresponds to the requested subchannel_id. This 546 | // field should be set. 547 | Subchannel subchannel = 1; 548 | } 549 | 550 | message GetSocketRequest { 551 | // socket_id is the identifier of the specific socket to get. 552 | int64 socket_id = 1; 553 | 554 | // If true, the response will contain only high level information 555 | // that is inexpensive to obtain. Fields that may be omitted are 556 | // documented. 557 | bool summary = 2; 558 | } 559 | 560 | message GetSocketResponse { 561 | // The Socket that corresponds to the requested socket_id. This field 562 | // should be set. 563 | Socket socket = 1; 564 | } 565 | -------------------------------------------------------------------------------- /grpc/core/stats.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2017 gRPC authors. 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 grpc.core; 18 | 19 | message Bucket { 20 | double start = 1; 21 | uint64 count = 2; 22 | } 23 | 24 | message Histogram { 25 | repeated Bucket buckets = 1; 26 | } 27 | 28 | message Metric { 29 | string name = 1; 30 | oneof value { 31 | uint64 count = 10; 32 | Histogram histogram = 11; 33 | } 34 | } 35 | 36 | message Stats { 37 | repeated Metric metrics = 1; 38 | } 39 | -------------------------------------------------------------------------------- /grpc/examples/helloworld.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2015 gRPC authors. 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 | syntax = "proto3"; 15 | 16 | option java_multiple_files = true; 17 | option java_package = "io.grpc.examples.helloworld"; 18 | option java_outer_classname = "HelloWorldProto"; 19 | option objc_class_prefix = "HLW"; 20 | 21 | package helloworld; 22 | 23 | // The greeting service definition. 24 | service Greeter { 25 | // Sends a greeting 26 | rpc SayHello (HelloRequest) returns (HelloReply) {} 27 | } 28 | 29 | // The request message containing the user's name. 30 | message HelloRequest { 31 | string name = 1; 32 | } 33 | 34 | // The response message containing the greetings 35 | message HelloReply { 36 | string message = 1; 37 | } 38 | -------------------------------------------------------------------------------- /grpc/gcp/altscontext.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The gRPC Authors 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 | // The canonical version of this proto can be found at 16 | // https://github.com/grpc/grpc-proto/blob/master/grpc/gcp/altscontext.proto 17 | 18 | syntax = "proto3"; 19 | 20 | package grpc.gcp; 21 | 22 | import "grpc/gcp/transport_security_common.proto"; 23 | 24 | option go_package = "google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp"; 25 | option java_multiple_files = true; 26 | option java_outer_classname = "AltsContextProto"; 27 | option java_package = "io.grpc.alts.internal"; 28 | 29 | message AltsContext { 30 | // The application protocol negotiated for this connection. 31 | string application_protocol = 1; 32 | 33 | // The record protocol negotiated for this connection. 34 | string record_protocol = 2; 35 | 36 | // The security level of the created secure channel. 37 | SecurityLevel security_level = 3; 38 | 39 | // The peer service account. 40 | string peer_service_account = 4; 41 | 42 | // The local service account. 43 | string local_service_account = 5; 44 | 45 | // The RPC protocol versions supported by the peer. 46 | RpcProtocolVersions peer_rpc_versions = 6; 47 | 48 | // Additional attributes of the peer. 49 | map peer_attributes = 7; 50 | } 51 | -------------------------------------------------------------------------------- /grpc/gcp/handshaker.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The gRPC Authors 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 | // The canonical version of this proto can be found at 16 | // https://github.com/grpc/grpc-proto/blob/master/grpc/gcp/handshaker.proto 17 | 18 | syntax = "proto3"; 19 | 20 | package grpc.gcp; 21 | 22 | import "grpc/gcp/transport_security_common.proto"; 23 | 24 | option go_package = "google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp"; 25 | option java_multiple_files = true; 26 | option java_outer_classname = "HandshakerProto"; 27 | option java_package = "io.grpc.alts.internal"; 28 | 29 | enum HandshakeProtocol { 30 | // Default value. 31 | HANDSHAKE_PROTOCOL_UNSPECIFIED = 0; 32 | 33 | // TLS handshake protocol. 34 | TLS = 1; 35 | 36 | // Application Layer Transport Security handshake protocol. 37 | ALTS = 2; 38 | } 39 | 40 | enum NetworkProtocol { 41 | NETWORK_PROTOCOL_UNSPECIFIED = 0; 42 | TCP = 1; 43 | UDP = 2; 44 | } 45 | 46 | message Endpoint { 47 | // IP address. It should contain an IPv4 or IPv6 string literal, e.g. 48 | // "192.168.0.1" or "2001:db8::1". 49 | string ip_address = 1; 50 | 51 | // Port number. 52 | int32 port = 2; 53 | 54 | // Network protocol (e.g., TCP, UDP) associated with this endpoint. 55 | NetworkProtocol protocol = 3; 56 | } 57 | 58 | message Identity { 59 | oneof identity_oneof { 60 | // Service account of a connection endpoint. 61 | string service_account = 1; 62 | 63 | // Hostname of a connection endpoint. 64 | string hostname = 2; 65 | } 66 | 67 | // Additional attributes of the identity. 68 | map attributes = 3; 69 | } 70 | 71 | message StartClientHandshakeReq { 72 | // Handshake security protocol requested by the client. 73 | HandshakeProtocol handshake_security_protocol = 1; 74 | 75 | // The application protocols supported by the client, e.g., "h2" (for http2), 76 | // "grpc". 77 | repeated string application_protocols = 2; 78 | 79 | // The record protocols supported by the client, e.g., 80 | // "ALTSRP_GCM_AES128". 81 | repeated string record_protocols = 3; 82 | 83 | // (Optional) Describes which server identities are acceptable by the client. 84 | // If target identities are provided and none of them matches the peer 85 | // identity of the server, handshake will fail. 86 | repeated Identity target_identities = 4; 87 | 88 | // (Optional) Application may specify a local identity. Otherwise, the 89 | // handshaker chooses a default local identity. 90 | Identity local_identity = 5; 91 | 92 | // (Optional) Local endpoint information of the connection to the server, 93 | // such as local IP address, port number, and network protocol. 94 | Endpoint local_endpoint = 6; 95 | 96 | // (Optional) Endpoint information of the remote server, such as IP address, 97 | // port number, and network protocol. 98 | Endpoint remote_endpoint = 7; 99 | 100 | // (Optional) If target name is provided, a secure naming check is performed 101 | // to verify that the peer authenticated identity is indeed authorized to run 102 | // the target name. 103 | string target_name = 8; 104 | 105 | // (Optional) RPC protocol versions supported by the client. 106 | RpcProtocolVersions rpc_versions = 9; 107 | 108 | // (Optional) Maximum frame size supported by the client. 109 | uint32 max_frame_size = 10; 110 | 111 | // (Optional) An access token created by the caller only intended for use in 112 | // ALTS connections. The access token that should be used to authenticate to 113 | // the peer. The access token MUST be strongly bound to the ALTS credentials 114 | // used to establish the connection that the token is sent over. 115 | string access_token = 11 [ debug_redact = true ]; 116 | 117 | // (Optional) Ordered transport protocol preferences supported by the client. 118 | TransportProtocolPreferences transport_protocol_preferences = 12; 119 | } 120 | 121 | message ServerHandshakeParameters { 122 | // The record protocols supported by the server, e.g., 123 | // "ALTSRP_GCM_AES128". 124 | repeated string record_protocols = 1; 125 | 126 | // (Optional) A list of local identities supported by the server, if 127 | // specified. Otherwise, the handshaker chooses a default local identity. 128 | repeated Identity local_identities = 2; 129 | 130 | // A token created by the caller only intended for use in 131 | // ALTS connections. The token should be used to authenticate to 132 | // the peer. The token MUST be strongly bound to the ALTS credentials 133 | // used to establish the connection that the token is sent over. 134 | optional string token = 3 [ debug_redact = true ]; 135 | } 136 | 137 | message StartServerHandshakeReq { 138 | // The application protocols supported by the server, e.g., "h2" (for http2), 139 | // "grpc". 140 | repeated string application_protocols = 1; 141 | 142 | // Handshake parameters (record protocols and local identities supported by 143 | // the server) mapped by the handshake protocol. Each handshake security 144 | // protocol (e.g., TLS or ALTS) has its own set of record protocols and local 145 | // identities. Since protobuf does not support enum as key to the map, the key 146 | // to handshake_parameters is the integer value of HandshakeProtocol enum. 147 | map handshake_parameters = 2; 148 | 149 | // Bytes in out_frames returned from the peer's HandshakerResp. It is possible 150 | // that the peer's out_frames are split into multiple HandshakeReq messages. 151 | bytes in_bytes = 3; 152 | 153 | // (Optional) Local endpoint information of the connection to the client, 154 | // such as local IP address, port number, and network protocol. 155 | Endpoint local_endpoint = 4; 156 | 157 | // (Optional) Endpoint information of the remote client, such as IP address, 158 | // port number, and network protocol. 159 | Endpoint remote_endpoint = 5; 160 | 161 | // (Optional) RPC protocol versions supported by the server. 162 | RpcProtocolVersions rpc_versions = 6; 163 | 164 | // (Optional) Maximum frame size supported by the server. 165 | uint32 max_frame_size = 7; 166 | 167 | // (Optional) Transport protocol preferences supported by the server. 168 | TransportProtocolPreferences transport_protocol_preferences = 8; 169 | } 170 | 171 | message NextHandshakeMessageReq { 172 | // Bytes in out_frames returned from the peer's HandshakerResp. It is possible 173 | // that the peer's out_frames are split into multiple NextHandshakerMessageReq 174 | // messages. 175 | bytes in_bytes = 1; 176 | 177 | // Number of milliseconds between when the application send the last handshake 178 | // message to the peer and when the application received the current handshake 179 | // message (in the in_bytes field) from the peer. 180 | uint32 network_latency_ms = 2; 181 | } 182 | 183 | message HandshakerReq { 184 | oneof req_oneof { 185 | // The start client handshake request message. 186 | StartClientHandshakeReq client_start = 1; 187 | 188 | // The start server handshake request message. 189 | StartServerHandshakeReq server_start = 2; 190 | 191 | // The next handshake request message. 192 | NextHandshakeMessageReq next = 3; 193 | } 194 | } 195 | 196 | message HandshakerResult { 197 | // The application protocol negotiated for this connection. 198 | string application_protocol = 1; 199 | 200 | // The record protocol negotiated for this connection. 201 | string record_protocol = 2; 202 | 203 | // Cryptographic key data. The key data may be more than the key length 204 | // required for the record protocol, thus the client of the handshaker 205 | // service needs to truncate the key data into the right key length. 206 | bytes key_data = 3; 207 | 208 | // The authenticated identity of the peer. 209 | Identity peer_identity = 4; 210 | 211 | // The local identity used in the handshake. 212 | Identity local_identity = 5; 213 | 214 | // Indicate whether the handshaker service client should keep the channel 215 | // between the handshaker service open, e.g., in order to handle 216 | // post-handshake messages in the future. 217 | bool keep_channel_open = 6; 218 | 219 | // The RPC protocol versions supported by the peer. 220 | RpcProtocolVersions peer_rpc_versions = 7; 221 | 222 | // The maximum frame size of the peer. 223 | uint32 max_frame_size = 8; 224 | 225 | // (Optional) The transport protocol negotiated for this connection. 226 | NegotiatedTransportProtocol transport_protocol = 9; 227 | } 228 | 229 | message HandshakerStatus { 230 | // The status code. This could be the gRPC status code. 231 | uint32 code = 1; 232 | 233 | // The status details. 234 | string details = 2; 235 | } 236 | 237 | message HandshakerResp { 238 | // Frames to be given to the peer for the NextHandshakeMessageReq. May be 239 | // empty if no out_frames have to be sent to the peer or if in_bytes in the 240 | // HandshakerReq are incomplete. All the non-empty out frames must be sent to 241 | // the peer even if the handshaker status is not OK as these frames may 242 | // contain the alert frames. 243 | bytes out_frames = 1; 244 | 245 | // Number of bytes in the in_bytes consumed by the handshaker. It is possible 246 | // that part of in_bytes in HandshakerReq was unrelated to the handshake 247 | // process. 248 | uint32 bytes_consumed = 2; 249 | 250 | // This is set iff the handshake was successful. out_frames may still be set 251 | // to frames that needs to be forwarded to the peer. 252 | HandshakerResult result = 3; 253 | 254 | // Status of the handshaker. 255 | HandshakerStatus status = 4; 256 | } 257 | 258 | service HandshakerService { 259 | // Handshaker service accepts a stream of handshaker request, returning a 260 | // stream of handshaker response. Client is expected to send exactly one 261 | // message with either client_start or server_start followed by one or more 262 | // messages with next. Each time client sends a request, the handshaker 263 | // service expects to respond. Client does not have to wait for service's 264 | // response before sending next request. 265 | rpc DoHandshake(stream HandshakerReq) returns (stream HandshakerResp) {} 266 | } 267 | -------------------------------------------------------------------------------- /grpc/gcp/transport_security_common.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The gRPC Authors 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 | // The canonical version of this proto can be found at 16 | // https://github.com/grpc/grpc-proto/blob/master/grpc/gcp/transport_security_common.proto 17 | 18 | syntax = "proto3"; 19 | 20 | package grpc.gcp; 21 | 22 | option go_package = "google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp"; 23 | option java_multiple_files = true; 24 | option java_outer_classname = "TransportSecurityCommonProto"; 25 | option java_package = "io.grpc.alts.internal"; 26 | 27 | // The security level of the created channel. The list is sorted in increasing 28 | // level of security. This order must always be maintained. 29 | enum SecurityLevel { 30 | SECURITY_NONE = 0; 31 | INTEGRITY_ONLY = 1; 32 | INTEGRITY_AND_PRIVACY = 2; 33 | } 34 | 35 | // Max and min supported RPC protocol versions. 36 | message RpcProtocolVersions { 37 | // RPC version contains a major version and a minor version. 38 | message Version { 39 | uint32 major = 1; 40 | uint32 minor = 2; 41 | } 42 | // Maximum supported RPC version. 43 | Version max_rpc_version = 1; 44 | // Minimum supported RPC version. 45 | Version min_rpc_version = 2; 46 | } 47 | 48 | // The ordered list of protocols that the client wishes to use, or the set 49 | // that the server supports. 50 | message TransportProtocolPreferences { repeated string transport_protocol = 1; } 51 | 52 | // The negotiated transport protocol. 53 | message NegotiatedTransportProtocol { string transport_protocol = 1; } 54 | -------------------------------------------------------------------------------- /grpc/health/v1/health.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The gRPC Authors 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 | // The canonical version of this proto can be found at 16 | // https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto 17 | 18 | syntax = "proto3"; 19 | 20 | package grpc.health.v1; 21 | 22 | option csharp_namespace = "Grpc.Health.V1"; 23 | option go_package = "google.golang.org/grpc/health/grpc_health_v1"; 24 | option java_multiple_files = true; 25 | option java_outer_classname = "HealthProto"; 26 | option java_package = "io.grpc.health.v1"; 27 | option objc_class_prefix = "GrpcHealthV1"; 28 | 29 | message HealthCheckRequest { 30 | string service = 1; 31 | } 32 | 33 | message HealthCheckResponse { 34 | enum ServingStatus { 35 | UNKNOWN = 0; 36 | SERVING = 1; 37 | NOT_SERVING = 2; 38 | SERVICE_UNKNOWN = 3; // Used only by the Watch method. 39 | } 40 | ServingStatus status = 1; 41 | } 42 | 43 | message HealthListRequest {} 44 | 45 | message HealthListResponse { 46 | // statuses contains all the services and their respective status. 47 | map statuses = 1; 48 | } 49 | 50 | // Health is gRPC's mechanism for checking whether a server is able to handle 51 | // RPCs. Its semantics are documented in 52 | // https://github.com/grpc/grpc/blob/master/doc/health-checking.md. 53 | service Health { 54 | // Check gets the health of the specified service. If the requested service 55 | // is unknown, the call will fail with status NOT_FOUND. If the caller does 56 | // not specify a service name, the server should respond with its overall 57 | // health status. 58 | // 59 | // Clients should set a deadline when calling Check, and can declare the 60 | // server unhealthy if they do not receive a timely response. 61 | rpc Check(HealthCheckRequest) returns (HealthCheckResponse); 62 | 63 | // List provides a non-atomic snapshot of the health of all the available 64 | // services. 65 | // 66 | // The server may respond with a RESOURCE_EXHAUSTED error if too many services 67 | // exist. 68 | // 69 | // Clients should set a deadline when calling List, and can declare the server 70 | // unhealthy if they do not receive a timely response. 71 | // 72 | // Clients should keep in mind that the list of health services exposed by an 73 | // application can change over the lifetime of the process. 74 | rpc List(HealthListRequest) returns (HealthListResponse); 75 | 76 | // Performs a watch for the serving status of the requested service. 77 | // The server will immediately send back a message indicating the current 78 | // serving status. It will then subsequently send a new message whenever 79 | // the service's serving status changes. 80 | // 81 | // If the requested service is unknown when the call is received, the 82 | // server will send a message setting the serving status to 83 | // SERVICE_UNKNOWN but will *not* terminate the call. If at some 84 | // future point, the serving status of the service becomes known, the 85 | // server will send a new message with the service's serving status. 86 | // 87 | // If the call terminates with status UNIMPLEMENTED, then clients 88 | // should assume this method is not supported and should not retry the 89 | // call. If the call terminates with any other status (including OK), 90 | // clients should retry the call with appropriate exponential backoff. 91 | rpc Watch(HealthCheckRequest) returns (stream HealthCheckResponse); 92 | } 93 | -------------------------------------------------------------------------------- /grpc/lb/v1/load_balancer.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The gRPC Authors 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 | // This file defines the GRPCLB LoadBalancing protocol. 16 | // 17 | // The canonical version of this proto can be found at 18 | // https://github.com/grpc/grpc-proto/blob/master/grpc/lb/v1/load_balancer.proto 19 | syntax = "proto3"; 20 | 21 | package grpc.lb.v1; 22 | 23 | import "google/protobuf/duration.proto"; 24 | import "google/protobuf/timestamp.proto"; 25 | 26 | option go_package = "google.golang.org/grpc/balancer/grpclb/grpc_lb_v1"; 27 | option java_multiple_files = true; 28 | option java_outer_classname = "LoadBalancerProto"; 29 | option java_package = "io.grpc.lb.v1"; 30 | 31 | service LoadBalancer { 32 | // Bidirectional rpc to get a list of servers. 33 | rpc BalanceLoad(stream LoadBalanceRequest) returns (stream LoadBalanceResponse); 34 | } 35 | 36 | message LoadBalanceRequest { 37 | oneof load_balance_request_type { 38 | // This message should be sent on the first request to the load balancer. 39 | InitialLoadBalanceRequest initial_request = 1; 40 | 41 | // The client stats should be periodically reported to the load balancer 42 | // based on the duration defined in the InitialLoadBalanceResponse. 43 | ClientStats client_stats = 2; 44 | } 45 | } 46 | 47 | message InitialLoadBalanceRequest { 48 | // The name of the load balanced service (e.g., service.googleapis.com). Its 49 | // length should be less than 256 bytes. 50 | // The name might include a port number. How to handle the port number is up 51 | // to the balancer. 52 | string name = 1; 53 | } 54 | 55 | // Contains the number of calls finished for a particular load balance token. 56 | message ClientStatsPerToken { 57 | // See Server.load_balance_token. 58 | string load_balance_token = 1; 59 | 60 | // The total number of RPCs that finished associated with the token. 61 | int64 num_calls = 2; 62 | } 63 | 64 | // Contains client level statistics that are useful to load balancing. Each 65 | // count except the timestamp should be reset to zero after reporting the stats. 66 | message ClientStats { 67 | // The timestamp of generating the report. 68 | google.protobuf.Timestamp timestamp = 1; 69 | 70 | // The total number of RPCs that started. 71 | int64 num_calls_started = 2; 72 | 73 | // The total number of RPCs that finished. 74 | int64 num_calls_finished = 3; 75 | 76 | // The total number of RPCs that failed to reach a server except dropped RPCs. 77 | int64 num_calls_finished_with_client_failed_to_send = 6; 78 | 79 | // The total number of RPCs that finished and are known to have been received 80 | // by a server. 81 | int64 num_calls_finished_known_received = 7; 82 | 83 | // The list of dropped calls. 84 | repeated ClientStatsPerToken calls_finished_with_drop = 8; 85 | 86 | reserved 4, 5; 87 | } 88 | 89 | message LoadBalanceResponse { 90 | oneof load_balance_response_type { 91 | // This message should be sent on the first response to the client. 92 | InitialLoadBalanceResponse initial_response = 1; 93 | 94 | // Contains the list of servers selected by the load balancer. The client 95 | // should send requests to these servers in the specified order. 96 | ServerList server_list = 2; 97 | 98 | // If this field is set, then the client should eagerly enter fallback 99 | // mode (even if there are existing, healthy connections to backends). 100 | FallbackResponse fallback_response = 3; 101 | } 102 | } 103 | 104 | message FallbackResponse {} 105 | 106 | message InitialLoadBalanceResponse { 107 | reserved 1; // never-used load_balancer_delegate 108 | 109 | // This interval defines how often the client should send the client stats 110 | // to the load balancer. Stats should only be reported when the duration is 111 | // positive. 112 | google.protobuf.Duration client_stats_report_interval = 2; 113 | } 114 | 115 | message ServerList { 116 | // Contains a list of servers selected by the load balancer. The list will 117 | // be updated when server resolutions change or as needed to balance load 118 | // across more servers. The client should consume the server list in order 119 | // unless instructed otherwise via the client_config. 120 | repeated Server servers = 1; 121 | 122 | // Was google.protobuf.Duration expiration_interval. 123 | reserved 3; 124 | } 125 | 126 | // Contains server information. When the drop field is not true, use the other 127 | // fields. 128 | message Server { 129 | // A resolved address for the server, serialized in network-byte-order. It may 130 | // either be an IPv4 or IPv6 address. 131 | bytes ip_address = 1; 132 | 133 | // A resolved port number for the server. 134 | int32 port = 2; 135 | 136 | // An opaque but printable token for load reporting. The client must include 137 | // the token of the picked server into the initial metadata when it starts a 138 | // call to that server. The token is used by the server to verify the request 139 | // and to allow the server to report load to the gRPC LB system. The token is 140 | // also used in client stats for reporting dropped calls. 141 | // 142 | // Its length can be variable but must be less than 50 bytes. 143 | string load_balance_token = 3; 144 | 145 | // Indicates whether this particular request should be dropped by the client. 146 | // If the request is dropped, there will be a corresponding entry in 147 | // ClientStats.calls_finished_with_drop. 148 | bool drop = 4; 149 | 150 | reserved 5; 151 | } 152 | -------------------------------------------------------------------------------- /grpc/lb/v1/load_reporter.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2018 gRPC authors. 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 grpc.lb.v1; 18 | 19 | import "google/protobuf/duration.proto"; 20 | 21 | // The LoadReporter service. 22 | service LoadReporter { 23 | // Report load from server to lb. 24 | rpc ReportLoad(stream LoadReportRequest) 25 | returns (stream LoadReportResponse) { 26 | }; 27 | } 28 | 29 | message LoadReportRequest { 30 | // This message should be sent on the first request to the gRPC server. 31 | InitialLoadReportRequest initial_request = 1; 32 | } 33 | 34 | message InitialLoadReportRequest { 35 | // The hostname this load reporter client is requesting load for. 36 | string load_balanced_hostname = 1; 37 | 38 | // Additional information to disambiguate orphaned load: load that should have 39 | // gone to this load reporter client, but was not able to be sent since the 40 | // load reporter client has disconnected. load_key is sent in orphaned load 41 | // reports; see Load.load_key. 42 | bytes load_key = 2; 43 | 44 | // This interval defines how often the server should send load reports to 45 | // the load balancer. 46 | google.protobuf.Duration load_report_interval = 3; 47 | } 48 | 49 | message LoadReportResponse { 50 | // This message should be sent on the first response to the load balancer. 51 | InitialLoadReportResponse initial_response = 1; 52 | 53 | // Reports server-wide statistics for load balancing. 54 | // This should be reported with every response. 55 | LoadBalancingFeedback load_balancing_feedback = 2; 56 | 57 | // A load report for each tuple. This could be considered to be 58 | // a multimap indexed by . It is not strictly necessary to 59 | // aggregate all entries into one entry per tuple, although it 60 | // is preferred to do so. 61 | repeated Load load = 3; 62 | } 63 | 64 | message InitialLoadReportResponse { 65 | // Initial response returns the Load balancer ID. This must be plain text 66 | // (printable ASCII). 67 | string load_balancer_id = 1; 68 | 69 | enum ImplementationIdentifier { 70 | IMPL_UNSPECIFIED = 0; 71 | CPP = 1; // Standard Google C++ implementation. 72 | JAVA = 2; // Standard Google Java implementation. 73 | GO = 3; // Standard Google Go implementation. 74 | } 75 | // Optional identifier of this implementation of the load reporting server. 76 | ImplementationIdentifier implementation_id = 2; 77 | 78 | // Optional server_version should be a value that is modified (and 79 | // monotonically increased) when changes are made to the server 80 | // implementation. 81 | int64 server_version = 3; 82 | } 83 | 84 | message LoadBalancingFeedback { 85 | // Reports the current utilization of the server (typical range [0.0 - 1.0]). 86 | float server_utilization = 1; 87 | 88 | // The total rate of calls handled by this server (including errors). 89 | float calls_per_second = 2; 90 | 91 | // The total rate of error responses sent by this server. 92 | float errors_per_second = 3; 93 | } 94 | 95 | message Load { 96 | // The (plain text) tag used by the calls covered by this load report. The 97 | // tag is that part of the load balancer token after removing the load 98 | // balancer id. Empty is equivalent to non-existent tag. 99 | string load_balance_tag = 1; 100 | 101 | // The user identity authenticated by the calls covered by this load 102 | // report. Empty is equivalent to no known user_id. 103 | string user_id = 3; 104 | 105 | // IP address of the client that sent these requests, serialized in 106 | // network-byte-order. It may either be an IPv4 or IPv6 address. 107 | bytes client_ip_address = 15; 108 | 109 | // The number of calls started (since the last report) with the given tag and 110 | // user_id. 111 | int64 num_calls_started = 4; 112 | 113 | // Indicates whether this load report is an in-progress load report in which 114 | // num_calls_in_progress is the only valid entry. If in_progress_report is not 115 | // set, num_calls_in_progress will be ignored. If in_progress_report is set, 116 | // fields other than num_calls_in_progress and orphaned_load will be ignored. 117 | // TODO(juanlishen): A Load is either an in_progress_report or not. We should 118 | // make this explicit in hierarchy. From the log, I see in_progress_report_ 119 | // has a random num_calls_in_progress_ when not set, which might lead to bug 120 | // when the balancer process the load report. 121 | oneof in_progress_report { 122 | // The number of calls in progress (instantaneously) per load balancer id. 123 | int64 num_calls_in_progress = 5; 124 | } 125 | 126 | // The following values are counts or totals of call statistics that finished 127 | // with the given tag and user_id. 128 | int64 num_calls_finished_without_error = 6; // Calls with status OK. 129 | int64 num_calls_finished_with_error = 7; // Calls with status non-OK. 130 | // Calls that finished with a status that maps to HTTP 5XX (see 131 | // googleapis/google/rpc/code.proto). Note that this is a subset of 132 | // num_calls_finished_with_error. 133 | int64 num_calls_finished_with_server_error = 16; 134 | 135 | // Totals are from calls that with _and_ without error. 136 | int64 total_bytes_sent = 8; 137 | int64 total_bytes_received = 9; 138 | google.protobuf.Duration total_latency = 10; 139 | 140 | // Optional metrics reported for the call(s). Requires that metric_name is 141 | // unique. 142 | repeated CallMetricData metric_data = 11; 143 | 144 | // The following two fields are used for reporting orphaned load: load that 145 | // could not be reported to the originating balancer either since the balancer 146 | // is no longer connected or because the frontend sent an invalid token. These 147 | // fields must not be set with normal (unorphaned) load reports. 148 | oneof orphaned_load { 149 | // Load_key is the load_key from the initial_request from the originating 150 | // balancer. 151 | bytes load_key = 12 [deprecated=true]; 152 | 153 | // If true then this load report is for calls that had an invalid token; the 154 | // user is probably abusing the gRPC protocol. 155 | // TODO(yankaiz): Rename load_key_unknown. 156 | bool load_key_unknown = 13; 157 | 158 | // load_key and balancer_id are included in order to identify orphaned load 159 | // from different origins. 160 | OrphanedLoadIdentifier orphaned_load_identifier = 14; 161 | } 162 | 163 | reserved 2; 164 | } 165 | 166 | message CallMetricData { 167 | // Name of the metric; may be empty. 168 | string metric_name = 1; 169 | 170 | // Number of calls that finished and included this metric. 171 | int64 num_calls_finished_with_metric = 2; 172 | 173 | // Sum of metric values across all calls that finished with this metric. 174 | double total_metric_value = 3; 175 | } 176 | 177 | message OrphanedLoadIdentifier { 178 | // The load_key from the initial_request from the originating balancer. 179 | bytes load_key = 1; 180 | 181 | // The unique ID generated by LoadReporter to identify balancers. Here it 182 | // distinguishes orphaned load with a same load_key. 183 | string load_balancer_id = 2; 184 | } 185 | -------------------------------------------------------------------------------- /grpc/lookup/v1/rls.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The gRPC Authors 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 grpc.lookup.v1; 18 | 19 | import "google/protobuf/any.proto"; 20 | 21 | option go_package = "google.golang.org/grpc/lookup/grpc_lookup_v1"; 22 | option java_multiple_files = true; 23 | option java_package = "io.grpc.lookup.v1"; 24 | option java_outer_classname = "RlsProto"; 25 | 26 | message RouteLookupRequest { 27 | // Target type allows the client to specify what kind of target format it 28 | // would like from RLS to allow it to find the regional server, e.g. "grpc". 29 | string target_type = 3; 30 | // Possible reasons for making a request. 31 | enum Reason { 32 | REASON_UNKNOWN = 0; // Unused 33 | REASON_MISS = 1; // No data available in local cache 34 | REASON_STALE = 2; // Data in local cache is stale 35 | } 36 | // Reason for making this request. 37 | Reason reason = 5; 38 | // For REASON_STALE, the header_data from the stale response, if any. 39 | string stale_header_data = 6; 40 | // Map of key values extracted via key builders for the gRPC or HTTP request. 41 | map key_map = 4; 42 | // Application-specific optional extensions. 43 | repeated google.protobuf.Any extensions = 7; 44 | 45 | reserved 1, 2; 46 | reserved "server", "path"; 47 | } 48 | 49 | message RouteLookupResponse { 50 | // Prioritized list (best one first) of addressable entities to use 51 | // for routing, using syntax requested by the request target_type. 52 | // The targets will be tried in order until a healthy one is found. 53 | repeated string targets = 3; 54 | // Optional header value to pass along to AFE in the X-Google-RLS-Data header. 55 | // Cached with "target" and sent with all requests that match the request key. 56 | // Allows the RLS to pass its work product to the eventual target. 57 | string header_data = 2; 58 | // Application-specific optional extensions. 59 | repeated google.protobuf.Any extensions = 4; 60 | 61 | reserved 1; 62 | reserved "target"; 63 | } 64 | 65 | service RouteLookupService { 66 | // Lookup returns a target for a single key. 67 | rpc RouteLookup(RouteLookupRequest) returns (RouteLookupResponse) {} 68 | } 69 | -------------------------------------------------------------------------------- /grpc/lookup/v1/rls_config.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The gRPC Authors 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 grpc.lookup.v1; 18 | 19 | import "google/protobuf/duration.proto"; 20 | 21 | option go_package = "google.golang.org/grpc/lookup/grpc_lookup_v1"; 22 | option java_multiple_files = true; 23 | option java_package = "io.grpc.lookup.v1"; 24 | option java_outer_classname = "RlsConfigProto"; 25 | 26 | // Extract a key based on a given name (e.g. header name or query parameter 27 | // name). The name must match one of the names listed in the "name" field. If 28 | // the "required_match" field is true, one of the specified names must be 29 | // present for the keybuilder to match. 30 | message NameMatcher { 31 | // The name that will be used in the RLS key_map to refer to this value. 32 | // If required_match is true, you may omit this field or set it to an empty 33 | // string, in which case the matcher will require a match, but won't update 34 | // the key_map. 35 | string key = 1; 36 | 37 | // Ordered list of names (headers or query parameter names) that can supply 38 | // this value; the first one with a non-empty value is used. 39 | repeated string names = 2; 40 | 41 | // If true, make this extraction required; the key builder will not match 42 | // if no value is found. 43 | bool required_match = 3; 44 | } 45 | 46 | // A GrpcKeyBuilder applies to a given gRPC service, name, and headers. 47 | message GrpcKeyBuilder { 48 | // To match, one of the given Name fields must match; the service and method 49 | // fields are specified as fixed strings. The service name is required and 50 | // includes the proto package name. The method name may be omitted, in 51 | // which case any method on the given service is matched. 52 | message Name { 53 | string service = 1; 54 | string method = 2; 55 | } 56 | repeated Name names = 1; 57 | 58 | // If you wish to include the host, service, or method names as keys in the 59 | // generated RouteLookupRequest, specify key names to use in the extra_keys 60 | // submessage. If a key name is empty, no key will be set for that value. 61 | // If this submessage is specified, the normal host/path fields will be left 62 | // unset in the RouteLookupRequest. We are deprecating host/path in the 63 | // RouteLookupRequest, so services should migrate to the ExtraKeys approach. 64 | message ExtraKeys { 65 | string host = 1; 66 | string service = 2; 67 | string method = 3; 68 | } 69 | ExtraKeys extra_keys = 3; 70 | 71 | // Extract keys from all listed headers. 72 | // For gRPC, it is an error to specify "required_match" on the NameMatcher 73 | // protos. 74 | repeated NameMatcher headers = 2; 75 | 76 | // You can optionally set one or more specific key/value pairs to be added to 77 | // the key_map. This can be useful to identify which builder built the key, 78 | // for example if you are suppressing the actual method, but need to 79 | // separately cache and request all the matched methods. 80 | map constant_keys = 4; 81 | } 82 | 83 | // An HttpKeyBuilder applies to a given HTTP URL and headers. 84 | // 85 | // Path and host patterns use the matching syntax from gRPC transcoding to 86 | // extract named key/value pairs from the path and host components of the URL: 87 | // https://github.com/googleapis/googleapis/blob/master/google/api/http.proto 88 | // 89 | // It is invalid to specify the same key name in multiple places in a pattern. 90 | // 91 | // For a service where the project id can be expressed either as a subdomain or 92 | // in the path, separate HttpKeyBuilders must be used: 93 | // host_pattern: 'example.com' path_pattern: '/{id}/{object}/**' 94 | // host_pattern: '{id}.example.com' path_pattern: '/{object}/**' 95 | // If the host is exactly 'example.com', the first path segment will be used as 96 | // the id and the second segment as the object. If the host has a subdomain, the 97 | // subdomain will be used as the id and the first segment as the object. If 98 | // neither pattern matches, no keys will be extracted. 99 | message HttpKeyBuilder { 100 | // host_pattern is an ordered list of host template patterns for the desired 101 | // value. If any host_pattern values are specified, then at least one must 102 | // match, and the last one wins and sets any specified variables. A host 103 | // consists of labels separated by dots. Each label is matched against the 104 | // label in the pattern as follows: 105 | // - "*": Matches any single label. 106 | // - "**": Matches zero or more labels (first or last part of host only). 107 | // - "{=...}": One or more label capture, where "..." can be any 108 | // template that does not include a capture. 109 | // - "{}": A single label capture. Identical to {=*}. 110 | // 111 | // Examples: 112 | // - "example.com": Only applies to the exact host example.com. 113 | // - "*.example.com": Matches subdomains of example.com. 114 | // - "**.example.com": matches example.com, and all levels of subdomains. 115 | // - "{project}.example.com": Extracts the third level subdomain. 116 | // - "{project=**}.example.com": Extracts the third level+ subdomains. 117 | // - "{project=**}": Extracts the entire host. 118 | repeated string host_patterns = 1; 119 | 120 | // path_pattern is an ordered list of path template patterns for the desired 121 | // value. If any path_pattern values are specified, then at least one must 122 | // match, and the last one wins and sets any specified variables. A path 123 | // consists of segments separated by slashes. Each segment is matched against 124 | // the segment in the pattern as follows: 125 | // - "*": Matches any single segment. 126 | // - "**": Matches zero or more segments (first or last part of path only). 127 | // - "{=...}": One or more segment capture, where "..." can be any 128 | // template that does not include a capture. 129 | // - "{}": A single segment capture. Identical to {=*}. 130 | // A custom method may also be specified by appending ":" and the custom 131 | // method name or "*" to indicate any custom method (including no custom 132 | // method). For example, "/*/projects/{project_id}/**:*" extracts 133 | // `{project_id}` for any version, resource and custom method that includes 134 | // it. By default, any custom method will be matched. 135 | // 136 | // Examples: 137 | // - "/v1/{name=messages/*}": extracts a name like "messages/12345". 138 | // - "/v1/messages/{message_id}": extracts a message_id like "12345". 139 | // - "/v1/users/{user_id}/messages/{message_id}": extracts two key values. 140 | repeated string path_patterns = 2; 141 | 142 | // List of query parameter names to try to match. 143 | // For example: ["parent", "name", "resource.name"] 144 | // We extract all the specified query_parameters (case-sensitively). If any 145 | // are marked as "required_match" and are not present, this keybuilder fails 146 | // to match. If a given parameter appears multiple times (?foo=a&foo=b) we 147 | // will report it as a comma-separated string (foo=a,b). 148 | repeated NameMatcher query_parameters = 3; 149 | 150 | // List of headers to try to match. 151 | // We extract all the specified header values (case-insensitively). If any 152 | // are marked as "required_match" and are not present, this keybuilder fails 153 | // to match. If a given header appears multiple times in the request we will 154 | // report it as a comma-separated string, in standard HTTP fashion. 155 | repeated NameMatcher headers = 4; 156 | 157 | // You can optionally set one or more specific key/value pairs to be added to 158 | // the key_map. This can be useful to identify which builder built the key, 159 | // for example if you are suppressing a lot of information from the URL, but 160 | // need to separately cache and request URLs with that content. 161 | map constant_keys = 5; 162 | 163 | // If specified, the HTTP method/verb will be extracted under this key name. 164 | string method = 6; 165 | } 166 | 167 | message RouteLookupConfig { 168 | // Ordered specifications for constructing keys for HTTP requests. Last 169 | // match wins. If no HttpKeyBuilder matches, an empty key_map will be sent to 170 | // the lookup service; it should likely reply with a global default route 171 | // and raise an alert. 172 | repeated HttpKeyBuilder http_keybuilders = 1; 173 | 174 | // Unordered specifications for constructing keys for gRPC requests. All 175 | // GrpcKeyBuilders on this list must have unique "name" fields so that the 176 | // client is free to prebuild a hash map keyed by name. If no GrpcKeyBuilder 177 | // matches, an empty key_map will be sent to the lookup service; it should 178 | // likely reply with a global default route and raise an alert. 179 | repeated GrpcKeyBuilder grpc_keybuilders = 2; 180 | 181 | // The name of the lookup service as a gRPC URI. Typically, this will be 182 | // a subdomain of the target, such as "lookup.datastore.googleapis.com". 183 | string lookup_service = 3; 184 | 185 | // Configure a timeout value for lookup service requests. 186 | // Defaults to 10 seconds if not specified. 187 | google.protobuf.Duration lookup_service_timeout = 4; 188 | 189 | // How long are responses valid for (like HTTP Cache-Control). 190 | // If omitted or zero, the longest valid cache time is used. 191 | // This value is clamped to 5 minutes to avoid unflushable bad responses, 192 | // unless stale_age is specified. 193 | google.protobuf.Duration max_age = 5; 194 | 195 | // After a response has been in the client cache for this amount of time 196 | // and is re-requested, start an asynchronous RPC to re-validate it. 197 | // This value should be less than max_age by at least the length of a 198 | // typical RTT to the Route Lookup Service to fully mask the RTT latency. 199 | // If omitted, keys are only re-requested after they have expired. 200 | // This value is clamped to 5 minutes. 201 | google.protobuf.Duration stale_age = 6; 202 | 203 | // Rough indicator of amount of memory to use for the client cache. Some of 204 | // the data structure overhead is not accounted for, so actual memory consumed 205 | // will be somewhat greater than this value. If this field is omitted or set 206 | // to zero, a client default will be used. The value may be capped to a lower 207 | // amount based on client configuration. 208 | int64 cache_size_bytes = 7; 209 | 210 | // This is a list of all the possible targets that can be returned by the 211 | // lookup service. If a target not on this list is returned, it will be 212 | // treated the same as an unhealthy target. 213 | repeated string valid_targets = 8; 214 | 215 | // This value provides a default target to use if needed. If set, it will be 216 | // used if RLS returns an error, times out, or returns an invalid response. 217 | // Note that requests can be routed only to a subdomain of the original 218 | // target, e.g. "us_east_1.cloudbigtable.googleapis.com". 219 | string default_target = 9; 220 | 221 | reserved 10; 222 | reserved "request_processing_strategy"; 223 | } 224 | 225 | // RouteLookupClusterSpecifier is used in xDS to represent a cluster specifier 226 | // plugin for RLS. 227 | message RouteLookupClusterSpecifier { 228 | // The RLS config for this cluster specifier plugin instance. 229 | RouteLookupConfig route_lookup_config = 1; 230 | } 231 | -------------------------------------------------------------------------------- /grpc/reflection/v1/reflection.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The gRPC Authors 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 | // Service exported by server reflection. A more complete description of how 16 | // server reflection works can be found at 17 | // https://github.com/grpc/grpc/blob/master/doc/server-reflection.md 18 | // 19 | // The canonical version of this proto can be found at 20 | // https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto 21 | 22 | syntax = "proto3"; 23 | 24 | package grpc.reflection.v1; 25 | 26 | option go_package = "google.golang.org/grpc/reflection/grpc_reflection_v1"; 27 | option java_multiple_files = true; 28 | option java_package = "io.grpc.reflection.v1"; 29 | option java_outer_classname = "ServerReflectionProto"; 30 | 31 | service ServerReflection { 32 | // The reflection service is structured as a bidirectional stream, ensuring 33 | // all related requests go to a single server. 34 | rpc ServerReflectionInfo(stream ServerReflectionRequest) 35 | returns (stream ServerReflectionResponse); 36 | } 37 | 38 | // The message sent by the client when calling ServerReflectionInfo method. 39 | message ServerReflectionRequest { 40 | string host = 1; 41 | // To use reflection service, the client should set one of the following 42 | // fields in message_request. The server distinguishes requests by their 43 | // defined field and then handles them using corresponding methods. 44 | oneof message_request { 45 | // Find a proto file by the file name. 46 | string file_by_filename = 3; 47 | 48 | // Find the proto file that declares the given fully-qualified symbol name. 49 | // This field should be a fully-qualified symbol name 50 | // (e.g. .[.] or .). 51 | string file_containing_symbol = 4; 52 | 53 | // Find the proto file which defines an extension extending the given 54 | // message type with the given field number. 55 | ExtensionRequest file_containing_extension = 5; 56 | 57 | // Finds the tag numbers used by all known extensions of the given message 58 | // type, and appends them to ExtensionNumberResponse in an undefined order. 59 | // Its corresponding method is best-effort: it's not guaranteed that the 60 | // reflection service will implement this method, and it's not guaranteed 61 | // that this method will provide all extensions. Returns 62 | // StatusCode::UNIMPLEMENTED if it's not implemented. 63 | // This field should be a fully-qualified type name. The format is 64 | // . 65 | string all_extension_numbers_of_type = 6; 66 | 67 | // List the full names of registered services. The content will not be 68 | // checked. 69 | string list_services = 7; 70 | } 71 | } 72 | 73 | // The type name and extension number sent by the client when requesting 74 | // file_containing_extension. 75 | message ExtensionRequest { 76 | // Fully-qualified type name. The format should be . 77 | string containing_type = 1; 78 | int32 extension_number = 2; 79 | } 80 | 81 | // The message sent by the server to answer ServerReflectionInfo method. 82 | message ServerReflectionResponse { 83 | string valid_host = 1; 84 | ServerReflectionRequest original_request = 2; 85 | // The server sets one of the following fields according to the message_request 86 | // in the request. 87 | oneof message_response { 88 | // This message is used to answer file_by_filename, file_containing_symbol, 89 | // file_containing_extension requests with transitive dependencies. 90 | // As the repeated label is not allowed in oneof fields, we use a 91 | // FileDescriptorResponse message to encapsulate the repeated fields. 92 | // The reflection service is allowed to avoid sending FileDescriptorProtos 93 | // that were previously sent in response to earlier requests in the stream. 94 | FileDescriptorResponse file_descriptor_response = 4; 95 | 96 | // This message is used to answer all_extension_numbers_of_type requests. 97 | ExtensionNumberResponse all_extension_numbers_response = 5; 98 | 99 | // This message is used to answer list_services requests. 100 | ListServiceResponse list_services_response = 6; 101 | 102 | // This message is used when an error occurs. 103 | ErrorResponse error_response = 7; 104 | } 105 | } 106 | 107 | // Serialized FileDescriptorProto messages sent by the server answering 108 | // a file_by_filename, file_containing_symbol, or file_containing_extension 109 | // request. 110 | message FileDescriptorResponse { 111 | // Serialized FileDescriptorProto messages. We avoid taking a dependency on 112 | // descriptor.proto, which uses proto2 only features, by making them opaque 113 | // bytes instead. 114 | repeated bytes file_descriptor_proto = 1; 115 | } 116 | 117 | // A list of extension numbers sent by the server answering 118 | // all_extension_numbers_of_type request. 119 | message ExtensionNumberResponse { 120 | // Full name of the base type, including the package name. The format 121 | // is . 122 | string base_type_name = 1; 123 | repeated int32 extension_number = 2; 124 | } 125 | 126 | // A list of ServiceResponse sent by the server answering list_services request. 127 | message ListServiceResponse { 128 | // The information of each service may be expanded in the future, so we use 129 | // ServiceResponse message to encapsulate it. 130 | repeated ServiceResponse service = 1; 131 | } 132 | 133 | // The information of a single service used by ListServiceResponse to answer 134 | // list_services request. 135 | message ServiceResponse { 136 | // Full name of a registered service, including its package name. The format 137 | // is . 138 | string name = 1; 139 | } 140 | 141 | // The error code and error message sent by the server when an error occurs. 142 | message ErrorResponse { 143 | // This field uses the error codes defined in grpc::StatusCode. 144 | int32 error_code = 1; 145 | string error_message = 2; 146 | } 147 | 148 | -------------------------------------------------------------------------------- /grpc/reflection/v1alpha/reflection.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The gRPC Authors 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 | // Service exported by server reflection 15 | 16 | 17 | // Warning: this entire file is deprecated. Use this instead: 18 | // https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto 19 | 20 | syntax = "proto3"; 21 | 22 | package grpc.reflection.v1alpha; 23 | 24 | option deprecated = true; 25 | option go_package = "google.golang.org/grpc/reflection/grpc_reflection_v1alpha"; 26 | option java_multiple_files = true; 27 | option java_package = "io.grpc.reflection.v1alpha"; 28 | option java_outer_classname = "ServerReflectionProto"; 29 | 30 | service ServerReflection { 31 | // The reflection service is structured as a bidirectional stream, ensuring 32 | // all related requests go to a single server. 33 | rpc ServerReflectionInfo(stream ServerReflectionRequest) 34 | returns (stream ServerReflectionResponse); 35 | } 36 | 37 | // The message sent by the client when calling ServerReflectionInfo method. 38 | message ServerReflectionRequest { 39 | string host = 1; 40 | // To use reflection service, the client should set one of the following 41 | // fields in message_request. The server distinguishes requests by their 42 | // defined field and then handles them using corresponding methods. 43 | oneof message_request { 44 | // Find a proto file by the file name. 45 | string file_by_filename = 3; 46 | 47 | // Find the proto file that declares the given fully-qualified symbol name. 48 | // This field should be a fully-qualified symbol name 49 | // (e.g. .[.] or .). 50 | string file_containing_symbol = 4; 51 | 52 | // Find the proto file which defines an extension extending the given 53 | // message type with the given field number. 54 | ExtensionRequest file_containing_extension = 5; 55 | 56 | // Finds the tag numbers used by all known extensions of extendee_type, and 57 | // appends them to ExtensionNumberResponse in an undefined order. 58 | // Its corresponding method is best-effort: it's not guaranteed that the 59 | // reflection service will implement this method, and it's not guaranteed 60 | // that this method will provide all extensions. Returns 61 | // StatusCode::UNIMPLEMENTED if it's not implemented. 62 | // This field should be a fully-qualified type name. The format is 63 | // . 64 | string all_extension_numbers_of_type = 6; 65 | 66 | // List the full names of registered services. The content will not be 67 | // checked. 68 | string list_services = 7; 69 | } 70 | } 71 | 72 | // The type name and extension number sent by the client when requesting 73 | // file_containing_extension. 74 | message ExtensionRequest { 75 | // Fully-qualified type name. The format should be . 76 | string containing_type = 1; 77 | int32 extension_number = 2; 78 | } 79 | 80 | // The message sent by the server to answer ServerReflectionInfo method. 81 | message ServerReflectionResponse { 82 | string valid_host = 1; 83 | ServerReflectionRequest original_request = 2; 84 | // The server set one of the following fields according to the message_request 85 | // in the request. 86 | oneof message_response { 87 | // This message is used to answer file_by_filename, file_containing_symbol, 88 | // file_containing_extension requests with transitive dependencies. As 89 | // the repeated label is not allowed in oneof fields, we use a 90 | // FileDescriptorResponse message to encapsulate the repeated fields. 91 | // The reflection service is allowed to avoid sending FileDescriptorProtos 92 | // that were previously sent in response to earlier requests in the stream. 93 | FileDescriptorResponse file_descriptor_response = 4; 94 | 95 | // This message is used to answer all_extension_numbers_of_type request. 96 | ExtensionNumberResponse all_extension_numbers_response = 5; 97 | 98 | // This message is used to answer list_services request. 99 | ListServiceResponse list_services_response = 6; 100 | 101 | // This message is used when an error occurs. 102 | ErrorResponse error_response = 7; 103 | } 104 | } 105 | 106 | // Serialized FileDescriptorProto messages sent by the server answering 107 | // a file_by_filename, file_containing_symbol, or file_containing_extension 108 | // request. 109 | message FileDescriptorResponse { 110 | // Serialized FileDescriptorProto messages. We avoid taking a dependency on 111 | // descriptor.proto, which uses proto2 only features, by making them opaque 112 | // bytes instead. 113 | repeated bytes file_descriptor_proto = 1; 114 | } 115 | 116 | // A list of extension numbers sent by the server answering 117 | // all_extension_numbers_of_type request. 118 | message ExtensionNumberResponse { 119 | // Full name of the base type, including the package name. The format 120 | // is . 121 | string base_type_name = 1; 122 | repeated int32 extension_number = 2; 123 | } 124 | 125 | // A list of ServiceResponse sent by the server answering list_services request. 126 | message ListServiceResponse { 127 | // The information of each service may be expanded in the future, so we use 128 | // ServiceResponse message to encapsulate it. 129 | repeated ServiceResponse service = 1; 130 | } 131 | 132 | // The information of a single service used by ListServiceResponse to answer 133 | // list_services request. 134 | message ServiceResponse { 135 | // Full name of a registered service, including its package name. The format 136 | // is . 137 | string name = 1; 138 | } 139 | 140 | // The error code and error message sent by the server when an error occurs. 141 | message ErrorResponse { 142 | // This field uses the error codes defined in grpc::StatusCode. 143 | int32 error_code = 1; 144 | string error_message = 2; 145 | } 146 | -------------------------------------------------------------------------------- /grpc/service_config/service_config.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The gRPC Authors 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 | // A ServiceConfig is supplied when a service is deployed. It mostly contains 16 | // parameters for how clients that connect to the service should behave (for 17 | // example, the load balancing policy to use to pick between service replicas). 18 | // 19 | // The configuration options provided here act as overrides to automatically 20 | // chosen option values. Service owners should be conservative in specifying 21 | // options as the system is likely to choose better values for these options in 22 | // the vast majority of cases. In other words, please specify a configuration 23 | // option only if you really have to, and avoid copy-paste inclusion of configs. 24 | // 25 | // Note that gRPC uses the service config in JSON form, not in protobuf 26 | // form. This proto definition is intended to help document the schema but 27 | // will not actually be used directly by gRPC. 28 | 29 | syntax = "proto3"; 30 | 31 | package grpc.service_config; 32 | 33 | import "google/protobuf/duration.proto"; 34 | import "google/protobuf/struct.proto"; 35 | import "google/protobuf/wrappers.proto"; 36 | import "google/rpc/code.proto"; 37 | import "grpc/lookup/v1/rls_config.proto"; 38 | 39 | option java_package = "io.grpc.serviceconfig"; 40 | option java_multiple_files = true; 41 | option java_outer_classname = "ServiceConfigProto"; 42 | 43 | // Configuration for a method. 44 | message MethodConfig { 45 | // The names of the methods to which this configuration applies. 46 | // - MethodConfig without names (empty list) will be skipped. 47 | // - Each name entry must be unique across the entire ServiceConfig. 48 | // - If the 'method' field is empty, this MethodConfig specifies the defaults 49 | // for all methods for the specified service. 50 | // - If the 'service' field is empty, the 'method' field must be empty, and 51 | // this MethodConfig specifies the default for all methods (it's the default 52 | // config). 53 | // 54 | // When determining which MethodConfig to use for a given RPC, the most 55 | // specific match wins. For example, let's say that the service config 56 | // contains the following MethodConfig entries: 57 | // 58 | // method_config { name { } ... } 59 | // method_config { name { service: "MyService" } ... } 60 | // method_config { name { service: "MyService" method: "Foo" } ... } 61 | // 62 | // MyService/Foo will use the third entry, because it exactly matches the 63 | // service and method name. MyService/Bar will use the second entry, because 64 | // it provides the default for all methods of MyService. AnotherService/Baz 65 | // will use the first entry, because it doesn't match the other two. 66 | // 67 | // In JSON representation, value "", value `null`, and not present are the 68 | // same. The following are the same Name: 69 | // - { "service": "s" } 70 | // - { "service": "s", "method": null } 71 | // - { "service": "s", "method": "" } 72 | message Name { 73 | string service = 1; // Required. Includes proto package name. 74 | string method = 2; 75 | } 76 | repeated Name name = 1; 77 | 78 | // Whether RPCs sent to this method should wait until the connection is 79 | // ready by default. If false, the RPC will abort immediately if there is 80 | // a transient failure connecting to the server. Otherwise, gRPC will 81 | // attempt to connect until the deadline is exceeded. 82 | // 83 | // The value specified via the gRPC client API will override the value 84 | // set here. However, note that setting the value in the client API will 85 | // also affect transient errors encountered during name resolution, which 86 | // cannot be caught by the value here, since the service config is 87 | // obtained by the gRPC client via name resolution. 88 | google.protobuf.BoolValue wait_for_ready = 2; 89 | 90 | // The default timeout in seconds for RPCs sent to this method. This can be 91 | // overridden in code. If no reply is received in the specified amount of 92 | // time, the request is aborted and a DEADLINE_EXCEEDED error status 93 | // is returned to the caller. 94 | // 95 | // The actual deadline used will be the minimum of the value specified here 96 | // and the value set by the application via the gRPC client API. If either 97 | // one is not set, then the other will be used. If neither is set, then the 98 | // request has no deadline. 99 | google.protobuf.Duration timeout = 3; 100 | 101 | // The maximum allowed payload size for an individual request or object in a 102 | // stream (client->server) in bytes. The size which is measured is the 103 | // serialized payload after per-message compression (but before stream 104 | // compression) in bytes. This applies both to streaming and non-streaming 105 | // requests. 106 | // 107 | // The actual value used is the minimum of the value specified here and the 108 | // value set by the application via the gRPC client API. If either one is 109 | // not set, then the other will be used. If neither is set, then the 110 | // built-in default is used. 111 | // 112 | // If a client attempts to send an object larger than this value, it will not 113 | // be sent and the client will see a ClientError. 114 | // Note that 0 is a valid value, meaning that the request message 115 | // must be empty. 116 | google.protobuf.UInt32Value max_request_message_bytes = 4; 117 | 118 | // The maximum allowed payload size for an individual response or object in a 119 | // stream (server->client) in bytes. The size which is measured is the 120 | // serialized payload after per-message compression (but before stream 121 | // compression) in bytes. This applies both to streaming and non-streaming 122 | // requests. 123 | // 124 | // The actual value used is the minimum of the value specified here and the 125 | // value set by the application via the gRPC client API. If either one is 126 | // not set, then the other will be used. If neither is set, then the 127 | // built-in default is used. 128 | // 129 | // If a server attempts to send an object larger than this value, it will not 130 | // be sent, and a ServerError will be sent to the client instead. 131 | // Note that 0 is a valid value, meaning that the response message 132 | // must be empty. 133 | google.protobuf.UInt32Value max_response_message_bytes = 5; 134 | 135 | // The retry policy for outgoing RPCs. 136 | message RetryPolicy { 137 | // The maximum number of RPC attempts, including the original attempt. 138 | // 139 | // This field is required and must be greater than 1. 140 | // Any value greater than 5 will be treated as if it were 5. 141 | uint32 max_attempts = 1; 142 | 143 | // Exponential backoff parameters. The initial retry attempt will occur at 144 | // random(0, initial_backoff). In general, the nth attempt will occur at 145 | // random(0, 146 | // min(initial_backoff*backoff_multiplier**(n-1), max_backoff)). 147 | // Required. Must be greater than zero. 148 | google.protobuf.Duration initial_backoff = 2; 149 | // Required. Must be greater than zero. 150 | google.protobuf.Duration max_backoff = 3; 151 | float backoff_multiplier = 4; // Required. Must be greater than zero. 152 | 153 | // The set of status codes which may be retried. 154 | // 155 | // This field is required and must be non-empty. 156 | repeated google.rpc.Code retryable_status_codes = 5; 157 | } 158 | 159 | // The hedging policy for outgoing RPCs. Hedged RPCs may execute more than 160 | // once on the server, so only idempotent methods should specify a hedging 161 | // policy. 162 | message HedgingPolicy { 163 | // The hedging policy will send up to max_requests RPCs. 164 | // This number represents the total number of all attempts, including 165 | // the original attempt. 166 | // 167 | // This field is required and must be greater than 1. 168 | // Any value greater than 5 will be treated as if it were 5. 169 | uint32 max_attempts = 1; 170 | 171 | // The first RPC will be sent immediately, but the max_requests-1 subsequent 172 | // hedged RPCs will be sent at intervals of every hedging_delay. Set this 173 | // to 0 to immediately send all max_requests RPCs. 174 | google.protobuf.Duration hedging_delay = 2; 175 | 176 | // The set of status codes which indicate other hedged RPCs may still 177 | // succeed. If a non-fatal status code is returned by the server, hedged 178 | // RPCs will continue. Otherwise, outstanding requests will be canceled and 179 | // the error returned to the client application layer. 180 | // 181 | // This field is optional. 182 | repeated google.rpc.Code non_fatal_status_codes = 3; 183 | } 184 | 185 | // Only one of retry_policy or hedging_policy may be set. If neither is set, 186 | // RPCs will not be retried or hedged. 187 | oneof retry_or_hedging_policy { 188 | RetryPolicy retry_policy = 6; 189 | HedgingPolicy hedging_policy = 7; 190 | } 191 | } 192 | 193 | // Configuration for pick_first LB policy. 194 | message PickFirstConfig { 195 | // If set to true, instructs the LB policy to randomly shuffle the list of 196 | // addresses received from the name resolver before attempting to connect to 197 | // them. 198 | bool shuffle_address_list = 1; 199 | } 200 | 201 | // Configuration for round_robin LB policy. 202 | message RoundRobinConfig {} 203 | 204 | // Configuration for weighted_round_robin LB policy. 205 | message WeightedRoundRobinLbConfig { 206 | // Whether to enable out-of-band utilization reporting collection from 207 | // the endpoints. By default, per-request utilization reporting is used. 208 | google.protobuf.BoolValue enable_oob_load_report = 1; 209 | 210 | // Load reporting interval to request from the server. Note that the 211 | // server may not provide reports as frequently as the client requests. 212 | // Used only when enable_oob_load_report is true. Default is 10 seconds. 213 | google.protobuf.Duration oob_reporting_period = 2; 214 | 215 | // A given endpoint must report load metrics continuously for at least 216 | // this long before the endpoint weight will be used. This avoids 217 | // churn when the set of endpoint addresses changes. Takes effect 218 | // both immediately after we establish a connection to an endpoint and 219 | // after weight_expiration_period has caused us to stop using the most 220 | // recent load metrics. Default is 10 seconds. 221 | google.protobuf.Duration blackout_period = 3; 222 | 223 | // If a given endpoint has not reported load metrics in this long, 224 | // then we stop using the reported weight. This ensures that we do 225 | // not continue to use very stale weights. Once we stop using a stale 226 | // value, if we later start seeing fresh reports again, the 227 | // blackout_period applies. Defaults to 3 minutes. 228 | google.protobuf.Duration weight_expiration_period = 4; 229 | 230 | // How often endpoint weights are recalculated. Values less than 100ms are 231 | // capped at 100ms. Default is 1 second. 232 | google.protobuf.Duration weight_update_period = 5; 233 | 234 | // The multiplier used to adjust endpoint weights with the error rate 235 | // calculated as eps/qps. Configuration is rejected if this value is negative. 236 | // Default is 1.0. 237 | google.protobuf.FloatValue error_utilization_penalty = 6; 238 | } 239 | 240 | // Configuration for outlier_detection LB policy 241 | message OutlierDetectionLoadBalancingConfig { 242 | // The time interval between ejection analysis sweeps. This can result in 243 | // both new ejections as well as addresses being returned to service. Defaults 244 | // to 10000ms or 10s. 245 | google.protobuf.Duration interval = 1; 246 | 247 | // The base time that as address is ejected for. The real time is equal to the 248 | // base time multiplied by the number of times the address has been ejected. 249 | // Defaults to 30000ms or 30s. 250 | google.protobuf.Duration base_ejection_time = 2; 251 | 252 | // The maximum time that an address is ejected for. If not specified, the default value (300000ms or 300s) or 253 | // the base_ejection_time value is applied, whatever is larger. 254 | google.protobuf.Duration max_ejection_time = 3; 255 | 256 | // The maximum % of an address list that can be ejected due to outlier 257 | // detection. Defaults to 10% but will eject at least one address regardless of the value. 258 | google.protobuf.UInt32Value max_ejection_percent = 4; 259 | 260 | // Parameters for the success rate ejection algorithm. 261 | // This algorithm monitors the request success rate for all endpoints and 262 | // ejects individual endpoints whose success rates are statistical outliers. 263 | message SuccessRateEjection { 264 | // This factor is used to determine the ejection threshold for success rate 265 | // outlier ejection. The ejection threshold is the difference between the 266 | // mean success rate, and the product of this factor and the standard 267 | // deviation of the mean success rate: mean - (stdev * 268 | // success_rate_stdev_factor). This factor is divided by a thousand to get a 269 | // double. That is, if the desired factor is 1.9, the runtime value should 270 | // be 1900. Defaults to 1900. 271 | google.protobuf.UInt32Value stdev_factor = 1; 272 | 273 | // The % chance that an address will be actually ejected when an outlier status 274 | // is detected through success rate statistics. This setting can be used to 275 | // disable ejection or to ramp it up slowly. Defaults to 100. 276 | google.protobuf.UInt32Value enforcement_percentage = 2; 277 | 278 | // The number of addresses that must have enough request volume to 279 | // detect success rate outliers. If the number of addresses is less than this 280 | // setting, outlier detection via success rate statistics is not performed 281 | // for any addresses. Defaults to 5. 282 | google.protobuf.UInt32Value minimum_hosts = 3; 283 | 284 | // The minimum number of total requests that must be collected in one 285 | // interval (as defined by the interval duration above) to include this address 286 | // in success rate based outlier detection. If the volume is lower than this 287 | // setting, outlier detection via success rate statistics is not performed 288 | // for that address. Defaults to 100. 289 | google.protobuf.UInt32Value request_volume = 4; 290 | } 291 | 292 | // Parameters for the failure percentage algorithm. 293 | // This algorithm ejects individual endpoints whose failure rate is greater than 294 | // some threshold, independently of any other endpoint. 295 | message FailurePercentageEjection { 296 | // The failure percentage to use when determining failure percentage-based outlier detection. If 297 | // the failure percentage of a given address is greater than or equal to this value, it will be 298 | // ejected. Defaults to 85. 299 | google.protobuf.UInt32Value threshold = 1; 300 | 301 | // The % chance that an address will be actually ejected when an outlier status is detected through 302 | // failure percentage statistics. This setting can be used to disable ejection or to ramp it up 303 | // slowly. Defaults to 100. 304 | google.protobuf.UInt32Value enforcement_percentage = 2; 305 | 306 | // The minimum number of addresses in order to perform failure percentage-based ejection. 307 | // If the total number of addresses is less than this value, failure percentage-based 308 | // ejection will not be performed. Defaults to 5. 309 | google.protobuf.UInt32Value minimum_hosts = 3; 310 | 311 | // The minimum number of total requests that must be collected in one interval (as defined by the 312 | // interval duration above) to perform failure percentage-based ejection for this address. If the 313 | // volume is lower than this setting, failure percentage-based ejection will not be performed for 314 | // this host. Defaults to 50. 315 | google.protobuf.UInt32Value request_volume = 4; 316 | } 317 | 318 | // If set, success rate ejections will be performed 319 | SuccessRateEjection success_rate_ejection = 5; 320 | 321 | // If set, failure rate ejections will be performed 322 | FailurePercentageEjection failure_percentage_ejection = 6; 323 | 324 | // The config for the child policy 325 | repeated LoadBalancingConfig child_policy = 13; 326 | } 327 | 328 | // Configuration for grpclb LB policy. 329 | message GrpcLbConfig { 330 | // Optional. What LB policy to use for routing between the backend 331 | // addresses. If unset, defaults to round_robin. 332 | // Currently, the only supported values are round_robin and pick_first. 333 | // Note that this will be used both in balancer mode and in fallback mode. 334 | // Multiple LB policies can be specified; clients will iterate through 335 | // the list in order and stop at the first policy that they support. 336 | repeated LoadBalancingConfig child_policy = 1; 337 | // Optional. If specified, overrides the name of the service to be sent to 338 | // the balancer. 339 | string service_name = 2; 340 | // Optional. The timeout in seconds for receiving the server list from the LB 341 | // server. Defaults to 10s. 342 | google.protobuf.Duration initial_fallback_timeout = 3; 343 | } 344 | 345 | // Configuration for priority LB policy. 346 | message PriorityLoadBalancingPolicyConfig { 347 | // A map of name to child policy configuration. 348 | // The names are used to allow the priority policy to update 349 | // existing child policies instead of creating new ones every 350 | // time it receives a config update. 351 | message Child { 352 | repeated LoadBalancingConfig config = 1; 353 | 354 | // If true, will ignore reresolution requests from this child. 355 | bool ignore_reresolution_requests = 2; 356 | } 357 | map children = 1; 358 | 359 | // A list of child names in decreasing priority order 360 | // (i.e., first element is the highest priority). 361 | repeated string priorities = 2; 362 | } 363 | 364 | // Configuration for weighted_target LB policy. 365 | message WeightedTargetLoadBalancingPolicyConfig { 366 | message Target { 367 | uint32 weight = 1; 368 | repeated LoadBalancingConfig child_policy = 2; 369 | } 370 | map targets = 1; 371 | } 372 | 373 | // Config for RLS LB policy. 374 | message RlsLoadBalancingPolicyConfig { 375 | grpc.lookup.v1.RouteLookupConfig route_lookup_config = 1; 376 | 377 | // Service config to use for the RLS channel. 378 | ServiceConfig route_lookup_channel_service_config = 2; 379 | 380 | repeated LoadBalancingConfig child_policy = 3; 381 | // Field name to add to child policy config to contain the target name. 382 | string child_policy_config_target_field_name = 4; 383 | } 384 | 385 | // Configuration for xds_cluster_manager_experimental LB policy. 386 | message XdsClusterManagerLoadBalancingPolicyConfig { 387 | message Child { 388 | repeated LoadBalancingConfig child_policy = 1; 389 | } 390 | map children = 1; 391 | } 392 | 393 | // Configuration for the cds LB policy. 394 | message CdsConfig { 395 | string cluster = 1; // Required. 396 | 397 | // If true, a dynamic subscription will be started for the cluster. 398 | bool is_dynamic = 2; 399 | } 400 | 401 | // Configuration for xds_cluster_impl LB policy. 402 | message XdsClusterImplLoadBalancingPolicyConfig { 403 | // Cluster name. Required. 404 | string cluster = 1; 405 | 406 | // Child policy. 407 | repeated LoadBalancingConfig child_policy = 6; 408 | 409 | // REMAINING FIELDS ARE DEPRECATED. 410 | 411 | // EDS service name. 412 | // Not set if cluster is not an EDS cluster or if it does not 413 | // specify an EDS service name. 414 | string eds_service_name = 2 [deprecated = true]; 415 | 416 | // Server to send load reports to. 417 | // If unset, no load reporting is done. 418 | // If set to empty string, load reporting will be sent to the same 419 | // server as we are getting xds data from. 420 | // DEPRECATED: Use new lrs_load_reporting_server field instead. 421 | google.protobuf.StringValue lrs_load_reporting_server_name = 3 422 | [deprecated=true]; 423 | 424 | // LRS server to send load reports to. 425 | // If not present, load reporting will be disabled. 426 | // Supercedes lrs_load_reporting_server_name field. 427 | XdsServer lrs_load_reporting_server = 7 [deprecated = true]; 428 | 429 | // Maximum number of outstanding requests can be made to the upstream cluster. 430 | // Default is 1024. 431 | google.protobuf.UInt32Value max_concurrent_requests = 4 [deprecated = true]; 432 | 433 | // Drop configuration. 434 | message DropCategory { 435 | string category = 1; 436 | uint32 requests_per_million = 2; 437 | } 438 | repeated DropCategory drop_categories = 5 [deprecated = true]; 439 | 440 | // Telemetry labels associated with this cluster 441 | map telemetry_labels = 8 [deprecated = true]; 442 | } 443 | 444 | // Configuration for ring_hash LB policy. 445 | message RingHashLoadBalancingConfig { 446 | // A client-side option will cap these values to 4096. If either of these 447 | // values are greater than the client-side cap, they will be treated 448 | // as the client-side cap value. 449 | uint64 min_ring_size = 1; // Optional, defaults to 1024, max 8M. 450 | uint64 max_ring_size = 2; // Optional, defaults to 4096, max 8M. 451 | string request_hash_header = 3; // Optional, see gRFC A76. 452 | } 453 | 454 | // Configuration for the xds_wrr_locality load balancing policy. 455 | message XdsWrrLocalityLoadBalancingPolicyConfig { 456 | repeated LoadBalancingConfig child_policy = 1; 457 | } 458 | 459 | // Configuration for the least_request LB policy. 460 | message LeastRequestLocalityLoadBalancingPolicyConfig { 461 | uint64 choice_count = 1; 462 | } 463 | 464 | // Configuration for the xds_override_host LB policy. 465 | message OverrideHostLoadBalancingPolicyConfig { 466 | string cluster_name = 3; 467 | repeated LoadBalancingConfig child_policy = 2; 468 | 469 | enum HealthStatus { 470 | UNKNOWN = 0; 471 | HEALTHY = 1; 472 | DRAINING = 3; 473 | } 474 | // valid health status for hosts that are considered when using 475 | // xds_override_host_experimental policy. 476 | // Default is [UNKNOWN, HEALTHY] 477 | repeated HealthStatus override_host_status = 1 [deprecated = true]; 478 | } 479 | 480 | // Selects LB policy and provides corresponding configuration. 481 | // 482 | // In general, all instances of this field should be repeated. Clients will 483 | // iterate through the list in order and stop at the first policy that they 484 | // support. This allows the service config to specify custom policies that may 485 | // not be known to all clients. 486 | // 487 | // - If the config for the first supported policy is invalid, the whole service 488 | // config is invalid. 489 | // - If the list doesn't contain any supported policy, the whole service config 490 | // is invalid. 491 | message LoadBalancingConfig { 492 | // Exactly one LB policy may be configured. 493 | oneof policy { 494 | // For each new LB policy supported by gRPC, a new field must be added 495 | // here. The field's name must be the LB policy name and its type is a 496 | // message that provides whatever configuration parameters are needed 497 | // by the LB policy. The configuration message will be passed to the 498 | // LB policy when it is instantiated on the client. 499 | // 500 | // If the LB policy does not require any configuration parameters, the 501 | // message for that LB policy may be empty. 502 | // 503 | // Note that if an LB policy contains another nested LB policy 504 | // (e.g., a gslb policy picks the cluster and then delegates to 505 | // a round_robin policy to pick the backend within that cluster), its 506 | // configuration message may include a nested instance of the 507 | // LoadBalancingConfig message to configure the nested LB policy. 508 | 509 | PickFirstConfig pick_first = 4 [json_name = "pick_first"]; 510 | 511 | RoundRobinConfig round_robin = 1 [json_name = "round_robin"]; 512 | 513 | WeightedRoundRobinLbConfig weighted_round_robin = 20 514 | [json_name = "weighted_round_robin"]; 515 | 516 | // gRPC lookaside load balancing. 517 | // This will eventually be deprecated by the new xDS-based local 518 | // balancing policy. 519 | GrpcLbConfig grpclb = 3; 520 | 521 | // REMAINING POLICIES ARE EXPERIMENTAL -- DO NOT USE 522 | 523 | PriorityLoadBalancingPolicyConfig priority_experimental = 9 524 | [json_name = "priority_experimental"]; 525 | WeightedTargetLoadBalancingPolicyConfig weighted_target_experimental = 10 526 | [json_name = "weighted_target_experimental"]; 527 | OutlierDetectionLoadBalancingConfig outlier_detection = 15 528 | [json_name = "outlier_detection_experimental"]; 529 | RlsLoadBalancingPolicyConfig rls = 19 [json_name = "rls_experimental"]; 530 | 531 | // xDS-based load balancing. 532 | XdsClusterManagerLoadBalancingPolicyConfig xds_cluster_manager_experimental 533 | = 14 [json_name = "xds_cluster_manager_experimental"]; 534 | CdsConfig cds_experimental = 6 [json_name = "cds_experimental"]; 535 | XdsClusterImplLoadBalancingPolicyConfig xds_cluster_impl_experimental = 12 536 | [json_name = "xds_cluster_impl_experimental"]; 537 | OverrideHostLoadBalancingPolicyConfig override_host_experimental = 18 538 | [json_name = "override_host_experimental"]; 539 | XdsWrrLocalityLoadBalancingPolicyConfig xds_wrr_locality_experimental = 16 540 | [json_name = "xds_wrr_locality_experimental"]; 541 | RingHashLoadBalancingConfig ring_hash_experimental = 13 542 | [json_name = "ring_hash_experimental"]; 543 | LeastRequestLocalityLoadBalancingPolicyConfig least_request_experimental = 544 | 17 [json_name = "least_request_experimental"]; 545 | 546 | // Deprecated xDS-related policies. 547 | XdsClusterResolverLoadBalancingPolicyConfig 548 | xds_cluster_resolver_experimental = 11 549 | [json_name = "xds_cluster_resolver_experimental", deprecated = true]; 550 | LrsLoadBalancingPolicyConfig lrs_experimental = 8 551 | [json_name = "lrs_experimental", deprecated = true]; 552 | EdsLoadBalancingPolicyConfig eds_experimental = 7 553 | [json_name = "eds_experimental", deprecated = true]; 554 | XdsConfig xds = 2 [deprecated = true]; 555 | XdsConfig xds_experimental = 5 [json_name = "xds_experimental", 556 | deprecated = true]; 557 | 558 | // Next available ID: 21 559 | } 560 | } 561 | 562 | // A ServiceConfig represents information about a service but is not specific to 563 | // any name resolver. 564 | message ServiceConfig { 565 | // Load balancing policy. 566 | // 567 | // Note that load_balancing_policy is deprecated in favor of 568 | // load_balancing_config; the former will be used only if the latter 569 | // is unset. 570 | // 571 | // If no LB policy is configured here, then the default is pick_first. 572 | // If the policy name is set via the client API, that value overrides 573 | // the value specified here. 574 | // 575 | // If the deprecated load_balancing_policy field is used, note that if the 576 | // resolver returns at least one balancer address (as opposed to backend 577 | // addresses), gRPC will use grpclb (see 578 | // https://github.com/grpc/grpc/blob/master/doc/load-balancing.md), 579 | // regardless of what policy is configured here. However, if the resolver 580 | // returns at least one backend address in addition to the balancer 581 | // address(es), the client may fall back to the requested policy if it 582 | // is unable to reach any of the grpclb load balancers. 583 | enum LoadBalancingPolicy { 584 | UNSPECIFIED = 0; 585 | ROUND_ROBIN = 1; 586 | } 587 | LoadBalancingPolicy load_balancing_policy = 1 [deprecated = true]; 588 | // Multiple LB policies can be specified; clients will iterate through 589 | // the list in order and stop at the first policy that they support. If none 590 | // are supported, the service config is considered invalid. 591 | repeated LoadBalancingConfig load_balancing_config = 4; 592 | 593 | // Per-method configuration. 594 | repeated MethodConfig method_config = 2; 595 | 596 | // If a RetryThrottlingPolicy is provided, gRPC will automatically throttle 597 | // retry attempts and hedged RPCs when the client's ratio of failures to 598 | // successes exceeds a threshold. 599 | // 600 | // For each server name, the gRPC client will maintain a token_count which is 601 | // initially set to max_tokens. Every outgoing RPC (regardless of service or 602 | // method invoked) will change token_count as follows: 603 | // 604 | // - Every failed RPC will decrement the token_count by 1. 605 | // - Every successful RPC will increment the token_count by token_ratio. 606 | // 607 | // If token_count is less than or equal to max_tokens / 2, then RPCs will not 608 | // be retried and hedged RPCs will not be sent. 609 | message RetryThrottlingPolicy { 610 | // The number of tokens starts at max_tokens. The token_count will always be 611 | // between 0 and max_tokens. 612 | // 613 | // This field is required and must be greater than zero. 614 | uint32 max_tokens = 1; 615 | 616 | // The amount of tokens to add on each successful RPC. Typically this will 617 | // be some number between 0 and 1, e.g., 0.1. 618 | // 619 | // This field is required and must be greater than zero. Up to 3 decimal 620 | // places are supported. 621 | float token_ratio = 2; 622 | } 623 | RetryThrottlingPolicy retry_throttling = 3; 624 | 625 | message HealthCheckConfig { 626 | // Service name to use in the health-checking request. 627 | google.protobuf.StringValue service_name = 1; 628 | } 629 | HealthCheckConfig health_check_config = 5; 630 | 631 | // next available tag: 6 632 | } 633 | 634 | // 635 | // DEPRECATED MESSAGES -- DO NOT USE 636 | // 637 | 638 | // Represents an xDS server. 639 | // Deprecated. 640 | message XdsServer { 641 | string server_uri = 1 [json_name = "server_uri"]; // Required. 642 | 643 | message ChannelCredentials { 644 | string type = 1; // Required. 645 | google.protobuf.Struct config = 2; // Optional JSON config. 646 | } 647 | // A list of channel creds to use. The first supported type will be used. 648 | repeated ChannelCredentials channel_creds = 2 [json_name = "channel_creds"]; 649 | 650 | // A repeated list of server features. 651 | repeated google.protobuf.Value server_features = 3 652 | [json_name = "server_features"]; 653 | } 654 | 655 | // Configuration for xds_cluster_resolver LB policy. 656 | // Deprecated. 657 | message XdsClusterResolverLoadBalancingPolicyConfig { 658 | // Describes a discovery mechanism instance. 659 | // For EDS or LOGICAL_DNS clusters, there will be exactly one 660 | // DiscoveryMechanism, which will describe the cluster of the parent 661 | // CDS policy. 662 | // For aggregate clusters, there will be one DiscoveryMechanism for each 663 | // underlying cluster. 664 | message DiscoveryMechanism { 665 | // Cluster name. 666 | string cluster = 1; 667 | 668 | // LRS server to send load reports to. 669 | // If not present, load reporting will be disabled. 670 | // If set to the empty string, load reporting will be sent to the same 671 | // server that we obtained CDS data from. 672 | // DEPRECATED: Use new lrs_load_reporting_server field instead. 673 | google.protobuf.StringValue lrs_load_reporting_server_name = 2 674 | [deprecated=true]; 675 | 676 | // LRS server to send load reports to. 677 | // If not present, load reporting will be disabled. 678 | // Supercedes lrs_load_reporting_server_name field. 679 | XdsServer lrs_load_reporting_server = 7; 680 | 681 | // Maximum number of outstanding requests can be made to the upstream 682 | // cluster. Default is 1024. 683 | google.protobuf.UInt32Value max_concurrent_requests = 3; 684 | 685 | enum Type { 686 | UNKNOWN = 0; 687 | EDS = 1; 688 | LOGICAL_DNS = 2; 689 | }; 690 | Type type = 4; 691 | 692 | // For type EDS only. 693 | // EDS service name, as returned in CDS. 694 | // May be unset if not specified in CDS. 695 | string eds_service_name = 5; 696 | 697 | // For type LOGICAL_DNS only. 698 | // DNS name to resolve in "host:port" form. 699 | string dns_hostname = 6; 700 | 701 | // The configuration for outlier_detection child policies 702 | // Within this message, the child_policy field will be ignored 703 | OutlierDetectionLoadBalancingConfig outlier_detection = 8; 704 | 705 | // The configuration for xds_override_host child policy 706 | repeated OverrideHostLoadBalancingPolicyConfig.HealthStatus override_host_status = 9; 707 | 708 | // Telemetry labels associated with this cluster 709 | map telemetry_labels = 10; 710 | } 711 | 712 | // Ordered list of discovery mechanisms. 713 | // Must have at least one element. 714 | // Results from each discovery mechanism are concatenated together in 715 | // successive priorities. 716 | repeated DiscoveryMechanism discovery_mechanisms = 1; 717 | 718 | // xDS LB policy. Will be used as the child config of the xds_cluster_impl LB policy. 719 | repeated LoadBalancingConfig xds_lb_policy = 2; 720 | } 721 | 722 | // Configuration for lrs LB policy. 723 | // Deprecated. 724 | message LrsLoadBalancingPolicyConfig { 725 | // Cluster name. Required. 726 | string cluster_name = 1; 727 | 728 | // EDS service name, as returned in CDS. 729 | // May be unset if not specified in CDS. 730 | string eds_service_name = 2; 731 | 732 | // Server to send load reports to. Required. 733 | // If set to empty string, load reporting will be sent to the same 734 | // server as we are getting xds data from. 735 | string lrs_load_reporting_server_name = 3; 736 | 737 | // The locality for which this policy will report load. Required. 738 | message Locality { 739 | string region = 1; 740 | string zone = 2; 741 | string subzone = 3; 742 | } 743 | Locality locality = 4; 744 | 745 | // Endpoint-picking policy. 746 | repeated LoadBalancingConfig child_policy = 5; 747 | } 748 | 749 | // Configuration for eds LB policy. 750 | // Deprecated. 751 | message EdsLoadBalancingPolicyConfig { 752 | // Cluster name. Required. 753 | string cluster = 1; 754 | 755 | // EDS service name, as returned in CDS. 756 | // May be unset if not specified in CDS. 757 | string eds_service_name = 2; 758 | 759 | // Server to send load reports to. 760 | // If unset, no load reporting is done. 761 | // If set to empty string, load reporting will be sent to the same 762 | // server as we are getting xds data from. 763 | google.protobuf.StringValue lrs_load_reporting_server_name = 3; 764 | 765 | // Locality-picking policy. 766 | // This policy's config is expected to be in the format used 767 | // by the weighted_target policy. Note that the config should include 768 | // an empty value for the "targets" field; that empty value will be 769 | // replaced by one that is dynamically generated based on the EDS data. 770 | // Optional; defaults to "weighted_target". 771 | repeated LoadBalancingConfig locality_picking_policy = 4; 772 | 773 | // Endpoint-picking policy. 774 | // This will be configured as the policy for each child in the 775 | // locality-policy's config. 776 | // Optional; defaults to "round_robin". 777 | repeated LoadBalancingConfig endpoint_picking_policy = 5; 778 | } 779 | 780 | // Configuration for xds LB policy. 781 | // Deprecated. 782 | message XdsConfig { 783 | // Name of balancer to connect to. 784 | string balancer_name = 1 [deprecated = true]; 785 | // Optional. What LB policy to use for intra-locality routing. 786 | // If unset, will use whatever algorithm is specified by the balancer. 787 | // Multiple LB policies can be specified; clients will iterate through 788 | // the list in order and stop at the first policy that they support. 789 | repeated LoadBalancingConfig child_policy = 2; 790 | // Optional. What LB policy to use in fallback mode. If not 791 | // specified, defaults to round_robin. 792 | // Multiple LB policies can be specified; clients will iterate through 793 | // the list in order and stop at the first policy that they support. 794 | repeated LoadBalancingConfig fallback_policy = 3; 795 | // Optional. Name to use in EDS query. If not present, defaults to 796 | // the server name from the target URI. 797 | string eds_service_name = 4; 798 | // LRS server to send load reports to. 799 | // If not present, load reporting will be disabled. 800 | // If set to the empty string, load reporting will be sent to the same 801 | // server that we obtained CDS data from. 802 | google.protobuf.StringValue lrs_load_reporting_server_name = 5; 803 | } 804 | -------------------------------------------------------------------------------- /grpc/testing/benchmark_service.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2015 gRPC authors. 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 | // An integration test service that covers all the method signature permutations 16 | // of unary/streaming requests/responses. 17 | syntax = "proto3"; 18 | 19 | import "grpc/testing/messages.proto"; 20 | 21 | package grpc.testing; 22 | 23 | option java_multiple_files = true; 24 | option java_package = "io.grpc.testing"; 25 | option java_outer_classname = "BenchmarkServiceProto"; 26 | 27 | service BenchmarkService { 28 | // One request followed by one response. 29 | // The server returns the client payload as-is. 30 | rpc UnaryCall(SimpleRequest) returns (SimpleResponse); 31 | 32 | // Repeated sequence of one request followed by one response. 33 | // Should be called streaming ping-pong 34 | // The server returns the client payload as-is on each response 35 | rpc StreamingCall(stream SimpleRequest) returns (stream SimpleResponse); 36 | 37 | // Single-sided unbounded streaming from client to server 38 | // The server returns the client payload as-is once the client does WritesDone 39 | rpc StreamingFromClient(stream SimpleRequest) returns (SimpleResponse); 40 | 41 | // Single-sided unbounded streaming from server to client 42 | // The server repeatedly returns the client payload as-is 43 | rpc StreamingFromServer(SimpleRequest) returns (stream SimpleResponse); 44 | 45 | // Two-sided unbounded streaming between server to client 46 | // Both sides send the content of their own choice to the other 47 | rpc StreamingBothWays(stream SimpleRequest) returns (stream SimpleResponse); 48 | } 49 | -------------------------------------------------------------------------------- /grpc/testing/control.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2015 gRPC authors. 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 | import "grpc/testing/payloads.proto"; 18 | import "grpc/testing/stats.proto"; 19 | import "google/protobuf/timestamp.proto"; 20 | 21 | package grpc.testing; 22 | 23 | option java_multiple_files = true; 24 | option java_package = "io.grpc.testing"; 25 | option java_outer_classname = "ControlProto"; 26 | 27 | enum ClientType { 28 | // Many languages support a basic distinction between using 29 | // sync or async client, and this allows the specification 30 | SYNC_CLIENT = 0; 31 | ASYNC_CLIENT = 1; 32 | OTHER_CLIENT = 2; // used for some language-specific variants 33 | CALLBACK_CLIENT = 3; 34 | } 35 | 36 | enum ServerType { 37 | SYNC_SERVER = 0; 38 | ASYNC_SERVER = 1; 39 | ASYNC_GENERIC_SERVER = 2; 40 | OTHER_SERVER = 3; // used for some language-specific variants 41 | CALLBACK_SERVER = 4; 42 | } 43 | 44 | enum RpcType { 45 | UNARY = 0; 46 | STREAMING = 1; 47 | STREAMING_FROM_CLIENT = 2; 48 | STREAMING_FROM_SERVER = 3; 49 | STREAMING_BOTH_WAYS = 4; 50 | } 51 | 52 | // Parameters of poisson process distribution, which is a good representation 53 | // of activity coming in from independent identical stationary sources. 54 | message PoissonParams { 55 | // The rate of arrivals (a.k.a. lambda parameter of the exp distribution). 56 | double offered_load = 1; 57 | } 58 | 59 | // Once an RPC finishes, immediately start a new one. 60 | // No configuration parameters needed. 61 | message ClosedLoopParams {} 62 | 63 | message LoadParams { 64 | oneof load { 65 | ClosedLoopParams closed_loop = 1; 66 | PoissonParams poisson = 2; 67 | }; 68 | } 69 | 70 | // presence of SecurityParams implies use of TLS 71 | message SecurityParams { 72 | bool use_test_ca = 1; 73 | string server_host_override = 2; 74 | string cred_type = 3; 75 | } 76 | 77 | message ChannelArg { 78 | string name = 1; 79 | oneof value { 80 | string str_value = 2; 81 | int32 int_value = 3; 82 | } 83 | } 84 | 85 | message ClientConfig { 86 | // List of targets to connect to. At least one target needs to be specified. 87 | repeated string server_targets = 1; 88 | ClientType client_type = 2; 89 | SecurityParams security_params = 3; 90 | // How many concurrent RPCs to start for each channel. 91 | // For synchronous client, use a separate thread for each outstanding RPC. 92 | int32 outstanding_rpcs_per_channel = 4; 93 | // Number of independent client channels to create. 94 | // i-th channel will connect to server_target[i % server_targets.size()] 95 | int32 client_channels = 5; 96 | // Only for async client. Number of threads to use to start/manage RPCs. 97 | int32 async_client_threads = 7; 98 | RpcType rpc_type = 8; 99 | // The requested load for the entire client (aggregated over all the threads). 100 | LoadParams load_params = 10; 101 | PayloadConfig payload_config = 11; 102 | HistogramParams histogram_params = 12; 103 | 104 | // Specify the cores we should run the client on, if desired 105 | repeated int32 core_list = 13; 106 | int32 core_limit = 14; 107 | 108 | // If we use an OTHER_CLIENT client_type, this string gives more detail 109 | string other_client_api = 15; 110 | 111 | repeated ChannelArg channel_args = 16; 112 | 113 | // Number of threads that share each completion queue 114 | int32 threads_per_cq = 17; 115 | 116 | // Number of messages on a stream before it gets finished/restarted 117 | int32 messages_per_stream = 18; 118 | 119 | // Use coalescing API when possible. 120 | bool use_coalesce_api = 19; 121 | 122 | // If 0, disabled. Else, specifies the period between gathering latency 123 | // medians in milliseconds. 124 | int32 median_latency_collection_interval_millis = 20; 125 | 126 | // Number of client processes. 0 indicates no restriction. 127 | int32 client_processes = 21; 128 | } 129 | 130 | message ClientStatus { ClientStats stats = 1; } 131 | 132 | // Request current stats 133 | message Mark { 134 | // if true, the stats will be reset after taking their snapshot. 135 | bool reset = 1; 136 | } 137 | 138 | message ClientArgs { 139 | oneof argtype { 140 | ClientConfig setup = 1; 141 | Mark mark = 2; 142 | } 143 | } 144 | 145 | message ServerConfig { 146 | ServerType server_type = 1; 147 | SecurityParams security_params = 2; 148 | // Port on which to listen. Zero means pick unused port. 149 | int32 port = 4; 150 | // Only for async server. Number of threads used to serve the requests. 151 | int32 async_server_threads = 7; 152 | // Specify the number of cores to limit server to, if desired 153 | int32 core_limit = 8; 154 | // payload config, used in generic server. 155 | // Note this must NOT be used in proto (non-generic) servers. For proto servers, 156 | // 'response sizes' must be configured from the 'response_size' field of the 157 | // 'SimpleRequest' objects in RPC requests. 158 | PayloadConfig payload_config = 9; 159 | 160 | // Specify the cores we should run the server on, if desired 161 | repeated int32 core_list = 10; 162 | 163 | // If we use an OTHER_SERVER client_type, this string gives more detail 164 | string other_server_api = 11; 165 | 166 | // Number of threads that share each completion queue 167 | int32 threads_per_cq = 12; 168 | 169 | // c++-only options (for now) -------------------------------- 170 | 171 | // Buffer pool size (no buffer pool specified if unset) 172 | int32 resource_quota_size = 1001; 173 | repeated ChannelArg channel_args = 1002; 174 | 175 | // Number of server processes. 0 indicates no restriction. 176 | int32 server_processes = 21; 177 | } 178 | 179 | message ServerArgs { 180 | oneof argtype { 181 | ServerConfig setup = 1; 182 | Mark mark = 2; 183 | } 184 | } 185 | 186 | message ServerStatus { 187 | ServerStats stats = 1; 188 | // the port bound by the server 189 | int32 port = 2; 190 | // Number of cores available to the server 191 | int32 cores = 3; 192 | } 193 | 194 | message CoreRequest { 195 | } 196 | 197 | message CoreResponse { 198 | // Number of cores available on the server 199 | int32 cores = 1; 200 | } 201 | 202 | message Void { 203 | } 204 | 205 | // A single performance scenario: input to qps_json_driver 206 | message Scenario { 207 | // Human readable name for this scenario 208 | string name = 1; 209 | // Client configuration 210 | ClientConfig client_config = 2; 211 | // Number of clients to start for the test 212 | int32 num_clients = 3; 213 | // Server configuration 214 | ServerConfig server_config = 4; 215 | // Number of servers to start for the test 216 | int32 num_servers = 5; 217 | // Warmup period, in seconds 218 | int32 warmup_seconds = 6; 219 | // Benchmark time, in seconds 220 | int32 benchmark_seconds = 7; 221 | // Number of workers to spawn locally (usually zero) 222 | int32 spawn_local_worker_count = 8; 223 | } 224 | 225 | // A set of scenarios to be run with qps_json_driver 226 | message Scenarios { 227 | repeated Scenario scenarios = 1; 228 | } 229 | 230 | // Basic summary that can be computed from ClientStats and ServerStats 231 | // once the scenario has finished. 232 | message ScenarioResultSummary 233 | { 234 | // Total number of operations per second over all clients. What is counted as 1 'operation' depends on the benchmark scenarios: 235 | // For unary benchmarks, an operation is processing of a single unary RPC. 236 | // For streaming benchmarks, an operation is processing of a single ping pong of request and response. 237 | double qps = 1; 238 | // QPS per server core. 239 | double qps_per_server_core = 2; 240 | // The total server cpu load based on system time across all server processes, expressed as percentage of a single cpu core. 241 | // For example, 85 implies 85% of a cpu core, 125 implies 125% of a cpu core. Since we are accumulating the cpu load across all the server 242 | // processes, the value could > 100 when there are multiple servers or a single server using multiple threads and cores. 243 | // Same explanation for the total client cpu load below. 244 | double server_system_time = 3; 245 | // The total server cpu load based on user time across all server processes, expressed as percentage of a single cpu core. (85 => 85%, 125 => 125%) 246 | double server_user_time = 4; 247 | // The total client cpu load based on system time across all client processes, expressed as percentage of a single cpu core. (85 => 85%, 125 => 125%) 248 | double client_system_time = 5; 249 | // The total client cpu load based on user time across all client processes, expressed as percentage of a single cpu core. (85 => 85%, 125 => 125%) 250 | double client_user_time = 6; 251 | 252 | // X% latency percentiles (in nanoseconds) 253 | double latency_50 = 7; 254 | double latency_90 = 8; 255 | double latency_95 = 9; 256 | double latency_99 = 10; 257 | double latency_999 = 11; 258 | 259 | // server cpu usage percentage 260 | double server_cpu_usage = 12; 261 | 262 | // Number of requests that succeeded/failed 263 | double successful_requests_per_second = 13; 264 | double failed_requests_per_second = 14; 265 | 266 | // Number of polls called inside completion queue per request 267 | double client_polls_per_request = 15; 268 | double server_polls_per_request = 16; 269 | 270 | // Queries per CPU-sec over all servers or clients 271 | double server_queries_per_cpu_sec = 17; 272 | double client_queries_per_cpu_sec = 18; 273 | 274 | 275 | // Start and end time for the test scenario 276 | google.protobuf.Timestamp start_time = 19; 277 | google.protobuf.Timestamp end_time =20; 278 | } 279 | 280 | // Results of a single benchmark scenario. 281 | message ScenarioResult { 282 | // Inputs used to run the scenario. 283 | Scenario scenario = 1; 284 | // Histograms from all clients merged into one histogram. 285 | HistogramData latencies = 2; 286 | // Client stats for each client 287 | repeated ClientStats client_stats = 3; 288 | // Server stats for each server 289 | repeated ServerStats server_stats = 4; 290 | // Number of cores available to each server 291 | repeated int32 server_cores = 5; 292 | // An after-the-fact computed summary 293 | ScenarioResultSummary summary = 6; 294 | // Information on success or failure of each worker 295 | repeated bool client_success = 7; 296 | repeated bool server_success = 8; 297 | // Number of failed requests (one row per status code seen) 298 | repeated RequestResultCount request_results = 9; 299 | } 300 | -------------------------------------------------------------------------------- /grpc/testing/empty.proto: -------------------------------------------------------------------------------- 1 | 2 | // Copyright 2015 gRPC authors. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | syntax = "proto3"; 17 | 18 | package grpc.testing; 19 | 20 | option java_package = "io.grpc.testing.integration"; 21 | option java_outer_classname = "EmptyProtos"; 22 | 23 | // An empty message that you can re-use to avoid defining duplicated empty 24 | // messages in your project. A typical example is to use it as argument or the 25 | // return value of a service API. For instance: 26 | // 27 | // service Foo { 28 | // rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { }; 29 | // }; 30 | // 31 | message Empty {} 32 | -------------------------------------------------------------------------------- /grpc/testing/messages.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2016 gRPC authors. 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 | // Message definitions to be used by integration test service definitions. 16 | 17 | syntax = "proto3"; 18 | 19 | package grpc.testing; 20 | 21 | option java_package = "io.grpc.testing.integration"; 22 | 23 | // TODO(dgq): Go back to using well-known types once 24 | // https://github.com/grpc/grpc/issues/6980 has been fixed. 25 | // import "google/protobuf/wrappers.proto"; 26 | message BoolValue { 27 | // The bool value. 28 | bool value = 1; 29 | } 30 | 31 | // The type of payload that should be returned. 32 | enum PayloadType { 33 | // Compressable text format. 34 | COMPRESSABLE = 0; 35 | } 36 | 37 | // A block of data, to simply increase gRPC message size. 38 | message Payload { 39 | // The type of data in body. 40 | PayloadType type = 1; 41 | // Primary contents of payload. 42 | bytes body = 2; 43 | } 44 | 45 | // A protobuf representation for grpc status. This is used by test 46 | // clients to specify a status that the server should attempt to return. 47 | message EchoStatus { 48 | int32 code = 1; 49 | string message = 2; 50 | } 51 | 52 | // The type of route that a client took to reach a server w.r.t. gRPCLB. 53 | // The server must fill in "fallback" if it detects that the RPC reached 54 | // the server via the "gRPCLB fallback" path, and "backend" if it detects 55 | // that the RPC reached the server via "gRPCLB backend" path (i.e. if it got 56 | // the address of this server from the gRPCLB server BalanceLoad RPC). Exactly 57 | // how this detection is done is context and server dependent. 58 | enum GrpclbRouteType { 59 | // Server didn't detect the route that a client took to reach it. 60 | GRPCLB_ROUTE_TYPE_UNKNOWN = 0; 61 | // Indicates that a client reached a server via gRPCLB fallback. 62 | GRPCLB_ROUTE_TYPE_FALLBACK = 1; 63 | // Indicates that a client reached a server as a gRPCLB-given backend. 64 | GRPCLB_ROUTE_TYPE_BACKEND = 2; 65 | } 66 | 67 | // Unary request. 68 | message SimpleRequest { 69 | // Desired payload type in the response from the server. 70 | // If response_type is RANDOM, server randomly chooses one from other formats. 71 | PayloadType response_type = 1; 72 | 73 | // Desired payload size in the response from the server. 74 | int32 response_size = 2; 75 | 76 | // Optional input payload sent along with the request. 77 | Payload payload = 3; 78 | 79 | // Whether SimpleResponse should include username. 80 | bool fill_username = 4; 81 | 82 | // Whether SimpleResponse should include OAuth scope. 83 | bool fill_oauth_scope = 5; 84 | 85 | // Whether to request the server to compress the response. This field is 86 | // "nullable" in order to interoperate seamlessly with clients not able to 87 | // implement the full compression tests by introspecting the call to verify 88 | // the response's compression status. 89 | BoolValue response_compressed = 6; 90 | 91 | // Whether server should return a given status 92 | EchoStatus response_status = 7; 93 | 94 | // Whether the server should expect this request to be compressed. 95 | BoolValue expect_compressed = 8; 96 | 97 | // Whether SimpleResponse should include server_id. 98 | bool fill_server_id = 9; 99 | 100 | // Whether SimpleResponse should include grpclb_route_type. 101 | bool fill_grpclb_route_type = 10; 102 | 103 | // If set the server should record this metrics report data for the current RPC. 104 | TestOrcaReport orca_per_query_report = 11; 105 | } 106 | 107 | // Unary response, as configured by the request. 108 | message SimpleResponse { 109 | // Payload to increase message size. 110 | Payload payload = 1; 111 | // The user the request came from, for verifying authentication was 112 | // successful when the client expected it. 113 | string username = 2; 114 | // OAuth scope. 115 | string oauth_scope = 3; 116 | 117 | // Server ID. This must be unique among different server instances, 118 | // but the same across all RPC's made to a particular server instance. 119 | string server_id = 4; 120 | // gRPCLB Path. 121 | GrpclbRouteType grpclb_route_type = 5; 122 | 123 | // Server hostname. 124 | string hostname = 6; 125 | } 126 | 127 | // Client-streaming request. 128 | message StreamingInputCallRequest { 129 | // Optional input payload sent along with the request. 130 | Payload payload = 1; 131 | 132 | // Whether the server should expect this request to be compressed. This field 133 | // is "nullable" in order to interoperate seamlessly with servers not able to 134 | // implement the full compression tests by introspecting the call to verify 135 | // the request's compression status. 136 | BoolValue expect_compressed = 2; 137 | 138 | // Not expecting any payload from the response. 139 | } 140 | 141 | // Client-streaming response. 142 | message StreamingInputCallResponse { 143 | // Aggregated size of payloads received from the client. 144 | int32 aggregated_payload_size = 1; 145 | } 146 | 147 | // Configuration for a particular response. 148 | message ResponseParameters { 149 | // Desired payload sizes in responses from the server. 150 | int32 size = 1; 151 | 152 | // Desired interval between consecutive responses in the response stream in 153 | // microseconds. 154 | int32 interval_us = 2; 155 | 156 | // Whether to request the server to compress the response. This field is 157 | // "nullable" in order to interoperate seamlessly with clients not able to 158 | // implement the full compression tests by introspecting the call to verify 159 | // the response's compression status. 160 | BoolValue compressed = 3; 161 | } 162 | 163 | // Server-streaming request. 164 | message StreamingOutputCallRequest { 165 | // Desired payload type in the response from the server. 166 | // If response_type is RANDOM, the payload from each response in the stream 167 | // might be of different types. This is to simulate a mixed type of payload 168 | // stream. 169 | PayloadType response_type = 1; 170 | 171 | // Configuration for each expected response message. 172 | repeated ResponseParameters response_parameters = 2; 173 | 174 | // Optional input payload sent along with the request. 175 | Payload payload = 3; 176 | 177 | // Whether server should return a given status 178 | EchoStatus response_status = 7; 179 | 180 | // If set the server should update this metrics report data at the OOB server. 181 | TestOrcaReport orca_oob_report = 8; 182 | } 183 | 184 | // Server-streaming response, as configured by the request and parameters. 185 | message StreamingOutputCallResponse { 186 | // Payload to increase response size. 187 | Payload payload = 1; 188 | } 189 | 190 | // For reconnect interop test only. 191 | // Client tells server what reconnection parameters it used. 192 | message ReconnectParams { 193 | int32 max_reconnect_backoff_ms = 1; 194 | } 195 | 196 | // For reconnect interop test only. 197 | // Server tells client whether its reconnects are following the spec and the 198 | // reconnect backoffs it saw. 199 | message ReconnectInfo { 200 | bool passed = 1; 201 | repeated int32 backoff_ms = 2; 202 | } 203 | 204 | message LoadBalancerStatsRequest { 205 | // Request stats for the next num_rpcs sent by client. 206 | int32 num_rpcs = 1; 207 | // If num_rpcs have not completed within timeout_sec, return partial results. 208 | int32 timeout_sec = 2; 209 | // Response header + trailer metadata entries we want the values of. 210 | // Matching of the keys is case-insensitive as per rfc7540#section-8.1.2 211 | // * (asterisk) is a special value that will return all metadata entries 212 | repeated string metadata_keys = 3; 213 | } 214 | 215 | message LoadBalancerStatsResponse { 216 | enum MetadataType { 217 | UNKNOWN = 0; 218 | INITIAL = 1; 219 | TRAILING = 2; 220 | } 221 | message MetadataEntry { 222 | // Key, exactly as received from the server. Case may be different from what 223 | // was requested in the LoadBalancerStatsRequest) 224 | string key = 1; 225 | // Value, exactly as received from the server. 226 | string value = 2; 227 | // Metadata type 228 | MetadataType type = 3; 229 | } 230 | message RpcMetadata { 231 | // metadata values for each rpc for the keys specified in 232 | // LoadBalancerStatsRequest.metadata_keys. 233 | repeated MetadataEntry metadata = 1; 234 | } 235 | message MetadataByPeer { 236 | // List of RpcMetadata in for each RPC with a given peer 237 | repeated RpcMetadata rpc_metadata = 1; 238 | } 239 | message RpcsByPeer { 240 | // The number of completed RPCs for each peer. 241 | map rpcs_by_peer = 1; 242 | } 243 | // The number of completed RPCs for each peer. 244 | map rpcs_by_peer = 1; 245 | // The number of RPCs that failed to record a remote peer. 246 | int32 num_failures = 2; 247 | map rpcs_by_method = 3; 248 | // All the metadata of all RPCs for each peer. 249 | map metadatas_by_peer = 4; 250 | } 251 | 252 | // Request for retrieving a test client's accumulated stats. 253 | message LoadBalancerAccumulatedStatsRequest {} 254 | 255 | // Accumulated stats for RPCs sent by a test client. 256 | message LoadBalancerAccumulatedStatsResponse { 257 | // The total number of RPCs have ever issued for each type. 258 | // Deprecated: use stats_per_method.rpcs_started instead. 259 | map num_rpcs_started_by_method = 1 [deprecated = true]; 260 | // The total number of RPCs have ever completed successfully for each type. 261 | // Deprecated: use stats_per_method.result instead. 262 | map num_rpcs_succeeded_by_method = 2 [deprecated = true]; 263 | // The total number of RPCs have ever failed for each type. 264 | // Deprecated: use stats_per_method.result instead. 265 | map num_rpcs_failed_by_method = 3 [deprecated = true]; 266 | 267 | message MethodStats { 268 | // The number of RPCs that were started for this method. 269 | int32 rpcs_started = 1; 270 | 271 | // The number of RPCs that completed with each status for this method. The 272 | // key is the integral value of a google.rpc.Code; the value is the count. 273 | map result = 2; 274 | } 275 | 276 | // Per-method RPC statistics. The key is the RpcType in string form; e.g. 277 | // 'EMPTY_CALL' or 'UNARY_CALL' 278 | map stats_per_method = 4; 279 | } 280 | 281 | // Configurations for a test client. 282 | message ClientConfigureRequest { 283 | // Type of RPCs to send. 284 | enum RpcType { 285 | EMPTY_CALL = 0; 286 | UNARY_CALL = 1; 287 | } 288 | 289 | // Metadata to be attached for the given type of RPCs. 290 | message Metadata { 291 | RpcType type = 1; 292 | string key = 2; 293 | string value = 3; 294 | } 295 | 296 | // The types of RPCs the client sends. 297 | repeated RpcType types = 1; 298 | // The collection of custom metadata to be attached to RPCs sent by the client. 299 | repeated Metadata metadata = 2; 300 | // The deadline to use, in seconds, for all RPCs. If unset or zero, the 301 | // client will use the default from the command-line. 302 | int32 timeout_sec = 3; 303 | } 304 | 305 | // Response for updating a test client's configuration. 306 | message ClientConfigureResponse {} 307 | 308 | message MemorySize { 309 | int64 rss = 1; 310 | } 311 | 312 | // Metrics data the server will update and send to the client. It mirrors orca load report 313 | // https://github.com/cncf/xds/blob/eded343319d09f30032952beda9840bbd3dcf7ac/xds/data/orca/v3/orca_load_report.proto#L15, 314 | // but avoids orca dependency. Used by both per-query and out-of-band reporting tests. 315 | message TestOrcaReport { 316 | double cpu_utilization = 1; 317 | double memory_utilization = 2; 318 | map request_cost = 3; 319 | map utilization = 4; 320 | } 321 | 322 | // Status that will be return to callers of the Hook method 323 | message SetReturnStatusRequest { 324 | int32 grpc_code_to_return = 1; 325 | string grpc_status_description = 2; 326 | } 327 | 328 | message HookRequest { 329 | enum HookRequestCommand { 330 | // Default value 331 | UNSPECIFIED = 0; 332 | // Start the HTTP endpoint 333 | START = 1; 334 | // Stop 335 | STOP = 2; 336 | // Return from HTTP GET/POST 337 | RETURN = 3; 338 | } 339 | HookRequestCommand command = 1; 340 | int32 grpc_code_to_return = 2; 341 | string grpc_status_description = 3; 342 | // Server port to listen to 343 | int32 server_port = 4; 344 | } 345 | 346 | message HookResponse { 347 | } 348 | -------------------------------------------------------------------------------- /grpc/testing/payloads.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2015 gRPC authors. 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 grpc.testing; 18 | 19 | option java_multiple_files = true; 20 | option java_package = "io.grpc.testing"; 21 | option java_outer_classname = "PayloadsProto"; 22 | 23 | message ByteBufferParams { 24 | int32 req_size = 1; 25 | int32 resp_size = 2; 26 | } 27 | 28 | message SimpleProtoParams { 29 | int32 req_size = 1; 30 | int32 resp_size = 2; 31 | } 32 | 33 | message ComplexProtoParams { 34 | // TODO (vpai): Fill this in once the details of complex, representative 35 | // protos are decided 36 | } 37 | 38 | message PayloadConfig { 39 | oneof payload { 40 | ByteBufferParams bytebuf_params = 1; 41 | SimpleProtoParams simple_params = 2; 42 | ComplexProtoParams complex_params = 3; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /grpc/testing/report_qps_scenario_service.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2015 gRPC authors. 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 | // An integration test service that covers all the method signature permutations 16 | // of unary/streaming requests/responses. 17 | syntax = "proto3"; 18 | 19 | import "grpc/testing/control.proto"; 20 | 21 | package grpc.testing; 22 | 23 | option java_multiple_files = true; 24 | option java_package = "io.grpc.testing"; 25 | option java_outer_classname = "ReportQpsScenarioServiceProto"; 26 | 27 | service ReportQpsScenarioService { 28 | // Report results of a QPS test benchmark scenario. 29 | rpc ReportScenario(ScenarioResult) returns (Void); 30 | } 31 | -------------------------------------------------------------------------------- /grpc/testing/stats.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2015 gRPC authors. 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 grpc.testing; 18 | 19 | import "grpc/core/stats.proto"; 20 | 21 | option java_multiple_files = true; 22 | option java_package = "io.grpc.testing"; 23 | option java_outer_classname = "StatsProto"; 24 | 25 | message ServerStats { 26 | // wall clock time change in seconds since last reset 27 | double time_elapsed = 1; 28 | 29 | // change in user time (in seconds) used by the server since last reset 30 | double time_user = 2; 31 | 32 | // change in server time (in seconds) used by the server process and all 33 | // threads since last reset 34 | double time_system = 3; 35 | 36 | // change in total cpu time of the server (data from proc/stat) 37 | uint64 total_cpu_time = 4; 38 | 39 | // change in idle time of the server (data from proc/stat) 40 | uint64 idle_cpu_time = 5; 41 | 42 | // Number of polls called inside completion queue 43 | uint64 cq_poll_count = 6; 44 | 45 | // Core library stats 46 | grpc.core.Stats core_stats = 7; 47 | } 48 | 49 | // Histogram params based on grpc/support/histogram.c 50 | message HistogramParams { 51 | double resolution = 1; // first bucket is [0, 1 + resolution) 52 | double max_possible = 2; // use enough buckets to allow this value 53 | } 54 | 55 | // Histogram data based on grpc/support/histogram.c 56 | message HistogramData { 57 | repeated uint32 bucket = 1; 58 | double min_seen = 2; 59 | double max_seen = 3; 60 | double sum = 4; 61 | double sum_of_squares = 5; 62 | double count = 6; 63 | } 64 | 65 | message RequestResultCount { 66 | int32 status_code = 1; 67 | int64 count = 2; 68 | } 69 | 70 | message ClientStats { 71 | // Latency histogram. Data points are in nanoseconds. 72 | HistogramData latencies = 1; 73 | 74 | // See ServerStats for details. 75 | double time_elapsed = 2; 76 | double time_user = 3; 77 | double time_system = 4; 78 | 79 | // Number of failed requests (one row per status code seen) 80 | repeated RequestResultCount request_results = 5; 81 | 82 | // Number of polls called inside completion queue 83 | uint64 cq_poll_count = 6; 84 | 85 | // Core library stats 86 | grpc.core.Stats core_stats = 7; 87 | } 88 | -------------------------------------------------------------------------------- /grpc/testing/test.proto: -------------------------------------------------------------------------------- 1 | 2 | // Copyright 2015-2016 gRPC authors. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | // An integration test service that covers all the method signature permutations 17 | // of unary/streaming requests/responses. 18 | 19 | syntax = "proto3"; 20 | 21 | import "grpc/testing/empty.proto"; 22 | import "grpc/testing/messages.proto"; 23 | 24 | package grpc.testing; 25 | 26 | option java_package = "io.grpc.testing.integration"; 27 | 28 | // A simple service to test the various types of RPCs and experiment with 29 | // performance with various types of payload. 30 | service TestService { 31 | // One empty request followed by one empty response. 32 | rpc EmptyCall(grpc.testing.Empty) returns (grpc.testing.Empty); 33 | 34 | // One request followed by one response. 35 | rpc UnaryCall(SimpleRequest) returns (SimpleResponse); 36 | 37 | // One request followed by one response. Response has cache control 38 | // headers set such that a caching HTTP proxy (such as GFE) can 39 | // satisfy subsequent requests. 40 | rpc CacheableUnaryCall(SimpleRequest) returns (SimpleResponse); 41 | 42 | // One request followed by a sequence of responses (streamed download). 43 | // The server returns the payload with client desired type and sizes. 44 | rpc StreamingOutputCall(StreamingOutputCallRequest) 45 | returns (stream StreamingOutputCallResponse); 46 | 47 | // A sequence of requests followed by one response (streamed upload). 48 | // The server returns the aggregated size of client payload as the result. 49 | rpc StreamingInputCall(stream StreamingInputCallRequest) 50 | returns (StreamingInputCallResponse); 51 | 52 | // A sequence of requests with each request served by the server immediately. 53 | // As one request could lead to multiple responses, this interface 54 | // demonstrates the idea of full duplexing. 55 | rpc FullDuplexCall(stream StreamingOutputCallRequest) 56 | returns (stream StreamingOutputCallResponse); 57 | 58 | // A sequence of requests followed by a sequence of responses. 59 | // The server buffers all the client requests and then serves them in order. A 60 | // stream of responses are returned to the client when the server starts with 61 | // first request. 62 | rpc HalfDuplexCall(stream StreamingOutputCallRequest) 63 | returns (stream StreamingOutputCallResponse); 64 | 65 | // The test server will not implement this method. It will be used 66 | // to test the behavior when clients call unimplemented methods. 67 | rpc UnimplementedCall(grpc.testing.Empty) returns (grpc.testing.Empty); 68 | } 69 | 70 | // A simple service NOT implemented at servers so clients can test for 71 | // that case. 72 | service UnimplementedService { 73 | // A call that no server should implement 74 | rpc UnimplementedCall(grpc.testing.Empty) returns (grpc.testing.Empty); 75 | } 76 | 77 | // A service used to control reconnect server. 78 | service ReconnectService { 79 | rpc Start(grpc.testing.ReconnectParams) returns (grpc.testing.Empty); 80 | rpc Stop(grpc.testing.Empty) returns (grpc.testing.ReconnectInfo); 81 | } 82 | 83 | // A service used to obtain stats for verifying LB behavior. 84 | service LoadBalancerStatsService { 85 | // Gets the backend distribution for RPCs sent by a test client. 86 | rpc GetClientStats(LoadBalancerStatsRequest) 87 | returns (LoadBalancerStatsResponse) {} 88 | 89 | // Gets the accumulated stats for RPCs sent by a test client. 90 | rpc GetClientAccumulatedStats(LoadBalancerAccumulatedStatsRequest) 91 | returns (LoadBalancerAccumulatedStatsResponse) {} 92 | } 93 | 94 | // Hook service. Used to keep Kubernetes from shutting the pod down. 95 | service HookService { 96 | // Sends a request that will "hang" until the return status is set by a call 97 | // to a SetReturnStatus 98 | rpc Hook(grpc.testing.Empty) returns (grpc.testing.Empty); 99 | // Sets a return status for pending and upcoming calls to Hook 100 | rpc SetReturnStatus(SetReturnStatusRequest) returns (grpc.testing.Empty); 101 | // Clears the return status. Incoming calls to Hook will "hang" 102 | rpc ClearReturnStatus(grpc.testing.Empty) returns (grpc.testing.Empty); 103 | } 104 | 105 | // A service to remotely control health status of an xDS test server. 106 | service XdsUpdateHealthService { 107 | rpc SetServing(grpc.testing.Empty) returns (grpc.testing.Empty); 108 | rpc SetNotServing(grpc.testing.Empty) returns (grpc.testing.Empty); 109 | rpc SendHookRequest(HookRequest) returns (HookResponse); 110 | } 111 | 112 | // A service to dynamically update the configuration of an xDS test client. 113 | service XdsUpdateClientConfigureService { 114 | // Update the tes client's configuration. 115 | rpc Configure(ClientConfigureRequest) returns (ClientConfigureResponse); 116 | } 117 | -------------------------------------------------------------------------------- /grpc/testing/worker_service.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2015 gRPC authors. 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 | // An integration test service that covers all the method signature permutations 16 | // of unary/streaming requests/responses. 17 | syntax = "proto3"; 18 | 19 | import "grpc/testing/control.proto"; 20 | 21 | package grpc.testing; 22 | 23 | option java_multiple_files = true; 24 | option java_package = "io.grpc.testing"; 25 | option java_outer_classname = "WorkerServiceProto"; 26 | 27 | service WorkerService { 28 | // Start server with specified workload. 29 | // First request sent specifies the ServerConfig followed by ServerStatus 30 | // response. After that, a "Mark" can be sent anytime to request the latest 31 | // stats. Closing the stream will initiate shutdown of the test server 32 | // and once the shutdown has finished, the OK status is sent to terminate 33 | // this RPC. 34 | rpc RunServer(stream ServerArgs) returns (stream ServerStatus); 35 | 36 | // Start client with specified workload. 37 | // First request sent specifies the ClientConfig followed by ClientStatus 38 | // response. After that, a "Mark" can be sent anytime to request the latest 39 | // stats. Closing the stream will initiate shutdown of the test client 40 | // and once the shutdown has finished, the OK status is sent to terminate 41 | // this RPC. 42 | rpc RunClient(stream ClientArgs) returns (stream ClientStatus); 43 | 44 | // Just return the core count - unary call 45 | rpc CoreCount(CoreRequest) returns (CoreResponse); 46 | 47 | // Quit this worker 48 | rpc QuitWorker(Void) returns (Void); 49 | } 50 | -------------------------------------------------------------------------------- /grpc/testing/xdsconfig/xdsconfig.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2024 gRPC authors. 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 grpc.testing.xdsconfig; 18 | 19 | option go_package = "grpc/interop/grpc_testing/xdsconfig"; 20 | 21 | import "google/protobuf/any.proto"; 22 | 23 | // Request the server to stop on recieving request for the resource with 24 | // provided type and name 25 | message StopOnRequestRequest { 26 | string type_url = 1; 27 | string name = 2; 28 | }; 29 | 30 | // Response to a request to stop server on specific resource request. Contains 31 | // a list of resources would cause the server to stop 32 | message StopOnRequestResponse { 33 | message ResourceFilter { 34 | string type_url = 1; 35 | string name = 2; 36 | }; 37 | 38 | repeated ResourceFilter filters = 1; 39 | }; 40 | 41 | // Request to set one or more resources. 42 | message SetResourcesRequest { 43 | message ResourceToSet { 44 | // Resource type 45 | string type_url = 1; 46 | // Resource name 47 | string name = 2; 48 | // Optional resource contents. Resource is removed if not provided. 49 | optional google.protobuf.Any body = 3; 50 | }; 51 | repeated ResourceToSet resources = 1; 52 | } 53 | 54 | // Response to request to set resource. Contains all xDS resources from the 55 | // server 56 | message SetResourcesResponse { 57 | repeated google.protobuf.Any resource = 1; 58 | }; 59 | 60 | // Service to control the control plane from the test script 61 | service XdsConfigControlService { 62 | // Instructs the server to exit when given resource is requested 63 | rpc StopOnRequest(StopOnRequestRequest) returns (StopOnRequestResponse); 64 | // A generic way to set xDS resources 65 | rpc SetResources(SetResourcesRequest) returns (SetResourcesResponse); 66 | }; 67 | --------------------------------------------------------------------------------