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