xref: /aosp_15_r20/external/grpc-grpc-java/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/config_source.proto (revision e07d83d3ffcef9ecfc9f7f475418ec639ff0e5fe)
1syntax = "proto3";
2
3package envoy.api.v2.core;
4
5import "envoy/api/v2/core/grpc_service.proto";
6
7import "google/protobuf/duration.proto";
8import "google/protobuf/wrappers.proto";
9
10import "envoy/annotations/deprecation.proto";
11import "udpa/annotations/migrate.proto";
12import "udpa/annotations/status.proto";
13import "validate/validate.proto";
14
15option java_package = "io.envoyproxy.envoy.api.v2.core";
16option java_outer_classname = "ConfigSourceProto";
17option java_multiple_files = true;
18option go_package = "github.com/envoyproxy/go-control-plane/envoy/api/v2/core";
19option (udpa.annotations.file_migrate).move_to_package = "envoy.config.core.v3";
20option (udpa.annotations.file_status).package_version_status = FROZEN;
21
22// [#protodoc-title: Configuration sources]
23
24// xDS API version. This is used to describe both resource and transport
25// protocol versions (in distinct configuration fields).
26enum ApiVersion {
27  // When not specified, we assume v2, to ease migration to Envoy's stable API
28  // versioning. If a client does not support v2 (e.g. due to deprecation), this
29  // is an invalid value.
30  AUTO = 0 [deprecated = true];
31
32  // Use xDS v2 API.
33  V2 = 1 [deprecated = true];
34
35  // Use xDS v3 API.
36  V3 = 2;
37}
38
39// API configuration source. This identifies the API type and cluster that Envoy
40// will use to fetch an xDS API.
41// [#next-free-field: 9]
42message ApiConfigSource {
43  // APIs may be fetched via either REST or gRPC.
44  enum ApiType {
45    // Ideally this would be 'reserved 0' but one can't reserve the default
46    // value. Instead we throw an exception if this is ever used.
47    UNSUPPORTED_REST_LEGACY = 0
48        [deprecated = true, (envoy.annotations.disallowed_by_default_enum) = true];
49
50    // REST-JSON v2 API. The `canonical JSON encoding
51    // <https://developers.google.com/protocol-buffers/docs/proto3#json>`_ for
52    // the v2 protos is used.
53    REST = 1;
54
55    // gRPC v2 API.
56    GRPC = 2;
57
58    // Using the delta xDS gRPC service, i.e. DeltaDiscovery{Request,Response}
59    // rather than Discovery{Request,Response}. Rather than sending Envoy the entire state
60    // with every update, the xDS server only sends what has changed since the last update.
61    DELTA_GRPC = 3;
62  }
63
64  // API type (gRPC, REST, delta gRPC)
65  ApiType api_type = 1 [(validate.rules).enum = {defined_only: true}];
66
67  // API version for xDS transport protocol. This describes the xDS gRPC/REST
68  // endpoint and version of [Delta]DiscoveryRequest/Response used on the wire.
69  ApiVersion transport_api_version = 8 [(validate.rules).enum = {defined_only: true}];
70
71  // Cluster names should be used only with REST. If > 1
72  // cluster is defined, clusters will be cycled through if any kind of failure
73  // occurs.
74  //
75  // .. note::
76  //
77  //  The cluster with name ``cluster_name`` must be statically defined and its
78  //  type must not be ``EDS``.
79  repeated string cluster_names = 2;
80
81  // Multiple gRPC services be provided for GRPC. If > 1 cluster is defined,
82  // services will be cycled through if any kind of failure occurs.
83  repeated GrpcService grpc_services = 4;
84
85  // For REST APIs, the delay between successive polls.
86  google.protobuf.Duration refresh_delay = 3;
87
88  // For REST APIs, the request timeout. If not set, a default value of 1s will be used.
89  google.protobuf.Duration request_timeout = 5 [(validate.rules).duration = {gt {}}];
90
91  // For GRPC APIs, the rate limit settings. If present, discovery requests made by Envoy will be
92  // rate limited.
93  RateLimitSettings rate_limit_settings = 6;
94
95  // Skip the node identifier in subsequent discovery requests for streaming gRPC config types.
96  bool set_node_on_first_message_only = 7;
97}
98
99// Aggregated Discovery Service (ADS) options. This is currently empty, but when
100// set in :ref:`ConfigSource <envoy_api_msg_core.ConfigSource>` can be used to
101// specify that ADS is to be used.
102message AggregatedConfigSource {
103}
104
105// [#not-implemented-hide:]
106// Self-referencing config source options. This is currently empty, but when
107// set in :ref:`ConfigSource <envoy_api_msg_core.ConfigSource>` can be used to
108// specify that other data can be obtained from the same server.
109message SelfConfigSource {
110  // API version for xDS transport protocol. This describes the xDS gRPC/REST
111  // endpoint and version of [Delta]DiscoveryRequest/Response used on the wire.
112  ApiVersion transport_api_version = 1 [(validate.rules).enum = {defined_only: true}];
113}
114
115// Rate Limit settings to be applied for discovery requests made by Envoy.
116message RateLimitSettings {
117  // Maximum number of tokens to be used for rate limiting discovery request calls. If not set, a
118  // default value of 100 will be used.
119  google.protobuf.UInt32Value max_tokens = 1;
120
121  // Rate at which tokens will be filled per second. If not set, a default fill rate of 10 tokens
122  // per second will be used.
123  google.protobuf.DoubleValue fill_rate = 2 [(validate.rules).double = {gt: 0.0}];
124}
125
126// Configuration for :ref:`listeners <config_listeners>`, :ref:`clusters
127// <config_cluster_manager>`, :ref:`routes
128// <envoy_api_msg_RouteConfiguration>`, :ref:`endpoints
129// <arch_overview_service_discovery>` etc. may either be sourced from the
130// filesystem or from an xDS API source. Filesystem configs are watched with
131// inotify for updates.
132// [#next-free-field: 7]
133message ConfigSource {
134  oneof config_source_specifier {
135    option (validate.required) = true;
136
137    // Path on the filesystem to source and watch for configuration updates.
138    // When sourcing configuration for :ref:`secret <envoy_api_msg_auth.Secret>`,
139    // the certificate and key files are also watched for updates.
140    //
141    // .. note::
142    //
143    //  The path to the source must exist at config load time.
144    //
145    // .. note::
146    //
147    //   Envoy will only watch the file path for *moves.* This is because in general only moves
148    //   are atomic. The same method of swapping files as is demonstrated in the
149    //   :ref:`runtime documentation <config_runtime_symbolic_link_swap>` can be used here also.
150    string path = 1;
151
152    // API configuration source.
153    ApiConfigSource api_config_source = 2;
154
155    // When set, ADS will be used to fetch resources. The ADS API configuration
156    // source in the bootstrap configuration is used.
157    AggregatedConfigSource ads = 3;
158
159    // [#not-implemented-hide:]
160    // When set, the client will access the resources from the same server it got the
161    // ConfigSource from, although not necessarily from the same stream. This is similar to the
162    // :ref:`ads<envoy_api_field.ConfigSource.ads>` field, except that the client may use a
163    // different stream to the same server. As a result, this field can be used for things
164    // like LRS that cannot be sent on an ADS stream. It can also be used to link from (e.g.)
165    // LDS to RDS on the same server without requiring the management server to know its name
166    // or required credentials.
167    // [#next-major-version: In xDS v3, consider replacing the ads field with this one, since
168    // this field can implicitly mean to use the same stream in the case where the ConfigSource
169    // is provided via ADS and the specified data can also be obtained via ADS.]
170    SelfConfigSource self = 5;
171  }
172
173  // When this timeout is specified, Envoy will wait no longer than the specified time for first
174  // config response on this xDS subscription during the :ref:`initialization process
175  // <arch_overview_initialization>`. After reaching the timeout, Envoy will move to the next
176  // initialization phase, even if the first config is not delivered yet. The timer is activated
177  // when the xDS API subscription starts, and is disarmed on first config update or on error. 0
178  // means no timeout - Envoy will wait indefinitely for the first xDS config (unless another
179  // timeout applies). The default is 15s.
180  google.protobuf.Duration initial_fetch_timeout = 4;
181
182  // API version for xDS resources. This implies the type URLs that the client
183  // will request for resources and the resource type that the client will in
184  // turn expect to be delivered.
185  ApiVersion resource_api_version = 6 [(validate.rules).enum = {defined_only: true}];
186}
187