From the course: gRPC in Python
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Adding reflection
- [Instructor] We are going to add reflection to our server, which means that external clients can query the server about the available methods and types. Let's have a look. You will need to install the grpcio-reflection package. And now, in our code, we import reflection from grpcio_reflection.v1aplha. And then, in our code, once we create the server, we define the names, which is the descriptor from the generated protocol buffers for the service rides, and the reflection service name. And then we say, reflection.enable_server_reflection, we give it the names and the server. Now we can run our code. And now we would like to query the server. To do that, I'm going to use the grpcurl tool. You can install it either from your packager manager or from the releases section in the repository. You can verify that the grpcurl is installed by running grpcurl--version. I have 1.8.6. Now I'm going to do grpcurl. And then I'm…