Skip to content

Commit e0fbf28

Browse files
committed
Add health and reflection proto
1 parent 9f15588 commit e0fbf28

File tree

30 files changed

+262
-204
lines changed

30 files changed

+262
-204
lines changed

examples/python/debug/asyncio_get_stats.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,8 @@
1818
import logging
1919

2020
import grpc
21-
22-
# Bazel build uses another path.
23-
try:
24-
import channelz_pb2
25-
import channelz_pb2_grpc
26-
except ImportError:
27-
from grpc_channelz.v1 import channelz_pb2
28-
from grpc_channelz.v1 import channelz_pb2_grpc
21+
from grpc_channelz.v1 import channelz_pb2
22+
from grpc_channelz.v1 import channelz_pb2_grpc
2923

3024

3125
async def run(addr: str) -> None:

examples/python/debug/get_stats.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,8 @@
2121
import logging
2222

2323
import grpc
24-
25-
# Bazel build uses another path.
26-
try:
27-
import channelz_pb2
28-
import channelz_pb2_grpc
29-
except ImportError:
30-
from grpc_channelz.v1 import channelz_pb2
31-
from grpc_channelz.v1 import channelz_pb2_grpc
24+
from grpc_channelz.v1 import channelz_pb2
25+
from grpc_channelz.v1 import channelz_pb2_grpc
3226

3327

3428
def run(addr):

examples/python/health_checking/greeter_client.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,11 @@
1717
from time import sleep
1818

1919
import grpc
20+
from grpc_health.v1 import health_pb2
21+
from grpc_health.v1 import health_pb2_grpc
2022
import helloworld_pb2
2123
import helloworld_pb2_grpc
2224

23-
# Bazel build uses another path.
24-
try:
25-
import health_pb2
26-
import health_pb2_grpc
27-
except ImportError:
28-
from grpc_health.v1 import health_pb2
29-
from grpc_health.v1 import health_pb2_grpc
30-
3125

3226
def unary_call(stub: helloworld_pb2_grpc.GreeterStub, message: str):
3327
response = stub.SayHello(

examples/python/health_checking/greeter_server.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,11 @@
2020

2121
import grpc
2222
from grpc_health.v1 import health
23+
from grpc_health.v1 import health_pb2
24+
from grpc_health.v1 import health_pb2_grpc
2325
import helloworld_pb2
2426
import helloworld_pb2_grpc
2527

26-
# Bazel build uses another path.
27-
# pylint: disable=ungrouped-imports
28-
try:
29-
import health_pb2
30-
import health_pb2_grpc
31-
except ImportError:
32-
from grpc_health.v1 import health_pb2
33-
from grpc_health.v1 import health_pb2_grpc
34-
# pylint: enable=ungrouped-imports
35-
3628

3729
class Greeter(helloworld_pb2_grpc.GreeterServicer):
3830
def SayHello(self, request, context):

examples/python/xds/server.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,12 @@
2020

2121
import grpc
2222
from grpc_health.v1 import health
23+
from grpc_health.v1 import health_pb2
24+
from grpc_health.v1 import health_pb2_grpc
2325
from grpc_reflection.v1alpha import reflection
2426
import helloworld_pb2
2527
import helloworld_pb2_grpc
2628

27-
# Bazel build uses another path.
28-
# pylint: disable=ungrouped-imports
29-
try:
30-
import health_pb2
31-
import health_pb2_grpc
32-
except ImportError:
33-
from grpc_health.v1 import health_pb2
34-
from grpc_health.v1 import health_pb2_grpc
35-
# pylint: enable=ungrouped-imports
36-
37-
3829
_DESCRIPTION = "A general purpose phony server."
3930

4031
_LISTEN_HOST = "0.0.0.0"

src/proto/grpc/health/v1/BUILD

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
load("//bazel:grpc_build_system.bzl", "grpc_cc_grpc_library", "grpc_cc_proto_library", "grpc_internal_proto_library", "grpc_package")
16-
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
1716

1817
licenses(["notice"])
1918

@@ -39,12 +38,6 @@ grpc_cc_grpc_library(
3938
deps = ["health_cc_proto"],
4039
)
4140

42-
proto_library(
43-
name = "health_proto_descriptor",
44-
srcs = ["health.proto"],
45-
strip_import_prefix = "/src/proto/grpc/health/v1",
46-
)
47-
4841
filegroup(
4942
name = "health_proto_file",
5043
srcs = [

src/proto/grpc/reflection/v1/BUILD

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
load("//bazel:grpc_build_system.bzl", "grpc_package", "grpc_proto_library")
16-
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
1716

1817
licenses(["notice"])
1918

@@ -30,12 +29,6 @@ grpc_proto_library(
3029
srcs = ["reflection.proto"],
3130
)
3231

33-
proto_library(
34-
name = "reflection_proto_descriptor",
35-
srcs = ["reflection.proto"],
36-
strip_import_prefix = "/src/proto/grpc/reflection/v1",
37-
)
38-
3932
filegroup(
4033
name = "reflection_proto_file",
4134
srcs = [

src/proto/grpc/reflection/v1alpha/BUILD

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
load("//bazel:grpc_build_system.bzl", "grpc_package", "grpc_proto_library")
16-
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
1716

1817
licenses(["notice"])
1918

@@ -30,12 +29,6 @@ grpc_proto_library(
3029
srcs = ["reflection.proto"],
3130
)
3231

33-
proto_library(
34-
name = "reflection_proto_descriptor",
35-
srcs = ["reflection.proto"],
36-
strip_import_prefix = "/src/proto/grpc/reflection/v1alpha",
37-
)
38-
3932
filegroup(
4033
name = "reflection_proto_file",
4134
srcs = [

src/python/grpcio_channelz/grpc_channelz/v1/_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
from grpc.experimental import aio
1717
from grpc_channelz.v1._servicer import ChannelzServicer as _SyncChannelzServicer
18+
import grpc_channelz.v1.channelz_pb2 as _channelz_pb2
19+
import grpc_channelz.v1.channelz_pb2_grpc as _channelz_pb2_grpc
1820

19-
from grpc_channelz.v1 import channelz_pb2 as _channelz_pb2
20-
from grpc_channelz.v1 import channelz_pb2_grpc as _channelz_pb2_grpc
2121

2222
class ChannelzServicer(_channelz_pb2_grpc.ChannelzServicer):
2323
"""AsyncIO servicer for handling RPCs for service statuses."""

src/python/grpcio_channelz/grpc_channelz/v1/_servicer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
from google.protobuf import json_format
1717
import grpc
1818
from grpc._cython import cygrpc
19+
import grpc_channelz.v1.channelz_pb2 as _channelz_pb2
20+
import grpc_channelz.v1.channelz_pb2_grpc as _channelz_pb2_grpc
1921

20-
from grpc_channelz.v1 import channelz_pb2 as _channelz_pb2
21-
from grpc_channelz.v1 import channelz_pb2_grpc as _channelz_pb2_grpc
2222

2323
class ChannelzServicer(_channelz_pb2_grpc.ChannelzServicer):
2424
"""Servicer handling RPCs for service statuses."""

0 commit comments

Comments
 (0)