rls.proto 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. syntax = "proto3";
  15. package grpc.lookup.v1;
  16. import "google/protobuf/any.proto";
  17. option go_package = "google.golang.org/grpc/lookup/grpc_lookup_v1";
  18. option java_multiple_files = true;
  19. option java_package = "io.grpc.lookup.v1";
  20. option java_outer_classname = "RlsProto";
  21. message RouteLookupRequest {
  22. // Target type allows the client to specify what kind of target format it
  23. // would like from RLS to allow it to find the regional server, e.g. "grpc".
  24. string target_type = 3;
  25. // Possible reasons for making a request.
  26. enum Reason {
  27. REASON_UNKNOWN = 0; // Unused
  28. REASON_MISS = 1; // No data available in local cache
  29. REASON_STALE = 2; // Data in local cache is stale
  30. }
  31. // Reason for making this request.
  32. Reason reason = 5;
  33. // For REASON_STALE, the header_data from the stale response, if any.
  34. string stale_header_data = 6;
  35. // Map of key values extracted via key builders for the gRPC or HTTP request.
  36. map<string, string> key_map = 4;
  37. // Application-specific optional extensions.
  38. repeated google.protobuf.Any extensions = 7;
  39. reserved 1, 2;
  40. reserved "server", "path";
  41. }
  42. message RouteLookupResponse {
  43. // Prioritized list (best one first) of addressable entities to use
  44. // for routing, using syntax requested by the request target_type.
  45. // The targets will be tried in order until a healthy one is found.
  46. repeated string targets = 3;
  47. // Optional header value to pass along to AFE in the X-Google-RLS-Data header.
  48. // Cached with "target" and sent with all requests that match the request key.
  49. // Allows the RLS to pass its work product to the eventual target.
  50. string header_data = 2;
  51. // Application-specific optional extensions.
  52. repeated google.protobuf.Any extensions = 4;
  53. reserved 1;
  54. reserved "target";
  55. }
  56. service RouteLookupService {
  57. // Lookup returns a target for a single key.
  58. rpc RouteLookup(RouteLookupRequest) returns (RouteLookupResponse) {}
  59. }