• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15// Local copy of Envoy xDS proto file, used for testing only.
16
17syntax = "proto3";
18
19package envoy.service.discovery.v3;
20
21import "src/proto/grpc/testing/xds/v3/base.proto";
22
23import "google/protobuf/any.proto";
24
25message Status {
26  // The status code, which should be an enum value of [google.rpc.Code][].
27  int32 code = 1;
28
29  // A developer-facing error message, which should be in English. Any
30  // user-facing error message should be localized and sent in the
31  // [google.rpc.Status.details][] field, or localized by the client.
32  string message = 2;
33
34  // A list of messages that carry the error details.  There is a common set of
35  // message types for APIs to use.
36  repeated google.protobuf.Any details = 3;
37}
38
39// [#protodoc-title: Common discovery API components]
40
41// A DiscoveryRequest requests a set of versioned resources of the same type for
42// a given Envoy node on some API.
43// [#next-free-field: 7]
44message DiscoveryRequest {
45  // The version_info provided in the request messages will be the version_info
46  // received with the most recent successfully processed response or empty on
47  // the first request. It is expected that no new request is sent after a
48  // response is received until the Envoy instance is ready to ACK/NACK the new
49  // configuration. ACK/NACK takes place by returning the new API config version
50  // as applied or the previous API config version respectively. Each type_url
51  // (see below) has an independent version associated with it.
52  string version_info = 1;
53
54  // The node making the request.
55  config.core.v3.Node node = 2;
56
57  // List of resources to subscribe to, e.g. list of cluster names or a route
58  // configuration name. If this is empty, all resources for the API are
59  // returned. LDS/CDS may have empty resource_names, which will cause all
60  // resources for the Envoy instance to be returned. The LDS and CDS responses
61  // will then imply a number of resources that need to be fetched via EDS/RDS,
62  // which will be explicitly enumerated in resource_names.
63  repeated string resource_names = 3;
64
65  // Type of the resource that is being requested, e.g.
66  // "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". This is implicit
67  // in requests made via singleton xDS APIs such as CDS, LDS, etc. but is
68  // required for ADS.
69  string type_url = 4;
70
71  // nonce corresponding to DiscoveryResponse being ACK/NACKed. See above
72  // discussion on version_info and the DiscoveryResponse nonce comment. This
73  // may be empty only if 1) this is a non-persistent-stream xDS such as HTTP,
74  // or 2) the client has not yet accepted an update in this xDS stream (unlike
75  // delta, where it is populated only for new explicit ACKs).
76  string response_nonce = 5;
77
78  // This is populated when the previous :ref:`DiscoveryResponse <envoy_api_msg_service.discovery.v3.DiscoveryResponse>`
79  // failed to update configuration. The *message* field in *error_details* provides the Envoy
80  // internal exception related to the failure. It is only intended for consumption during manual
81  // debugging, the string provided is not guaranteed to be stable across Envoy versions.
82  Status error_detail = 6;
83}
84
85// [#next-free-field: 7]
86message DiscoveryResponse {
87  // The version of the response data.
88  string version_info = 1;
89
90  // The response resources. These resources are typed and depend on the API being called.
91  repeated google.protobuf.Any resources = 2;
92
93  // [#not-implemented-hide:]
94  // Canary is used to support two Envoy command line flags:
95  //
96  // * --terminate-on-canary-transition-failure. When set, Envoy is able to
97  //   terminate if it detects that configuration is stuck at canary. Consider
98  //   this example sequence of updates:
99  //   - Management server applies a canary config successfully.
100  //   - Management server rolls back to a production config.
101  //   - Envoy rejects the new production config.
102  //   Since there is no sensible way to continue receiving configuration
103  //   updates, Envoy will then terminate and apply production config from a
104  //   clean slate.
105  // * --dry-run-canary. When set, a canary response will never be applied, only
106  //   validated via a dry run.
107  bool canary = 3;
108
109  // Type URL for resources. Identifies the xDS API when muxing over ADS.
110  // Must be consistent with the type_url in the 'resources' repeated Any (if non-empty).
111  string type_url = 4;
112
113  // For gRPC based subscriptions, the nonce provides a way to explicitly ack a
114  // specific DiscoveryResponse in a following DiscoveryRequest. Additional
115  // messages may have been sent by Envoy to the management server for the
116  // previous version on the stream prior to this DiscoveryResponse, that were
117  // unprocessed at response send time. The nonce allows the management server
118  // to ignore any further DiscoveryRequests for the previous version until a
119  // DiscoveryRequest bearing the nonce. The nonce is optional and is not
120  // required for non-stream based xDS implementations.
121  string nonce = 5;
122}
123