reflectionV1Alpha.proto 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. // Warning: this entire file is deprecated. Use this instead:
  16. // https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto
  17. syntax = "proto3";
  18. package grpc.reflection.v1alpha;
  19. option deprecated = true;
  20. option java_multiple_files = true;
  21. option java_package = "io.grpc.reflection.v1alpha";
  22. option java_outer_classname = "ServerReflectionProto";
  23. service ServerReflection {
  24. // The reflection service is structured as a bidirectional stream, ensuring
  25. // all related requests go to a single server.
  26. rpc ServerReflectionInfo(stream ServerReflectionRequest)
  27. returns (stream ServerReflectionResponse);
  28. }
  29. // The message sent by the client when calling ServerReflectionInfo method.
  30. message ServerReflectionRequest {
  31. string host = 1;
  32. // To use reflection service, the client should set one of the following
  33. // fields in message_request. The server distinguishes requests by their
  34. // defined field and then handles them using corresponding methods.
  35. oneof message_request {
  36. // Find a proto file by the file name.
  37. string file_by_filename = 3;
  38. // Find the proto file that declares the given fully-qualified symbol name.
  39. // This field should be a fully-qualified symbol name
  40. // (e.g. <package>.<service>[.<method>] or <package>.<type>).
  41. string file_containing_symbol = 4;
  42. // Find the proto file which defines an extension extending the given
  43. // message type with the given field number.
  44. ExtensionRequest file_containing_extension = 5;
  45. // Finds the tag numbers used by all known extensions of extendee_type, and
  46. // appends them to ExtensionNumberResponse in an undefined order.
  47. // Its corresponding method is best-effort: it's not guaranteed that the
  48. // reflection service will implement this method, and it's not guaranteed
  49. // that this method will provide all extensions. Returns
  50. // StatusCode::UNIMPLEMENTED if it's not implemented.
  51. // This field should be a fully-qualified type name. The format is
  52. // <package>.<type>
  53. string all_extension_numbers_of_type = 6;
  54. // List the full names of registered services. The content will not be
  55. // checked.
  56. string list_services = 7;
  57. }
  58. }
  59. // The type name and extension number sent by the client when requesting
  60. // file_containing_extension.
  61. message ExtensionRequest {
  62. // Fully-qualified type name. The format should be <package>.<type>
  63. string containing_type = 1;
  64. int32 extension_number = 2;
  65. }
  66. // The message sent by the server to answer ServerReflectionInfo method.
  67. message ServerReflectionResponse {
  68. string valid_host = 1;
  69. ServerReflectionRequest original_request = 2;
  70. // The server set one of the following fields accroding to the message_request
  71. // in the request.
  72. oneof message_response {
  73. // This message is used to answer file_by_filename, file_containing_symbol,
  74. // file_containing_extension requests with transitive dependencies. As
  75. // the repeated label is not allowed in oneof fields, we use a
  76. // FileDescriptorResponse message to encapsulate the repeated fields.
  77. // The reflection service is allowed to avoid sending FileDescriptorProtos
  78. // that were previously sent in response to earlier requests in the stream.
  79. FileDescriptorResponse file_descriptor_response = 4;
  80. // This message is used to answer all_extension_numbers_of_type requst.
  81. ExtensionNumberResponse all_extension_numbers_response = 5;
  82. // This message is used to answer list_services request.
  83. ListServiceResponse list_services_response = 6;
  84. // This message is used when an error occurs.
  85. ErrorResponse error_response = 7;
  86. }
  87. }
  88. // Serialized FileDescriptorProto messages sent by the server answering
  89. // a file_by_filename, file_containing_symbol, or file_containing_extension
  90. // request.
  91. message FileDescriptorResponse {
  92. // Serialized FileDescriptorProto messages. We avoid taking a dependency on
  93. // descriptor.proto, which uses proto2 only features, by making them opaque
  94. // bytes instead.
  95. repeated bytes file_descriptor_proto = 1;
  96. }
  97. // A list of extension numbers sent by the server answering
  98. // all_extension_numbers_of_type request.
  99. message ExtensionNumberResponse {
  100. // Full name of the base type, including the package name. The format
  101. // is <package>.<type>
  102. string base_type_name = 1;
  103. repeated int32 extension_number = 2;
  104. }
  105. // A list of ServiceResponse sent by the server answering list_services request.
  106. message ListServiceResponse {
  107. // The information of each service may be expanded in the future, so we use
  108. // ServiceResponse message to encapsulate it.
  109. repeated ServiceResponse service = 1;
  110. }
  111. // The information of a single service used by ListServiceResponse to answer
  112. // list_services request.
  113. message ServiceResponse {
  114. // Full name of a registered service, including its package name. The format
  115. // is <package>.<service>
  116. string name = 1;
  117. }
  118. // The error code and error message sent by the server when an error occurs.
  119. message ErrorResponse {
  120. // This field uses the error codes defined in grpc::StatusCode.
  121. int32 error_code = 1;
  122. string error_message = 2;
  123. }