Skip to content

Commit 3c1afe3

Browse files
docs: clean up discovery docs and make it consistent (#39913)
## Description This PR have some cleanup in Discovery Proto for consistency. We are using the backticks inconsistently throughout right now and there are many places where we could convert the items in a list format rather than keeping it in the form of a paragraph. --- **Commit Message:** docs: clean up discovery docs and make it consistent **Additional Description:** Minor clean up for added clarity on the discovery docs. **Risk Level:** N/A **Testing:** N/A **Docs Changes:** N/A **Release Notes:** N/A Signed-off-by: Rohit Agrawal <[email protected]> Mirrored from https://github.com/envoyproxy/envoy @ 51184341e5abf0a6e5f6b531f88425729226a506
1 parent 911014e commit 3c1afe3

File tree

1 file changed

+99
-71
lines changed

1 file changed

+99
-71
lines changed

envoy/service/discovery/v3/discovery.proto

Lines changed: 99 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ message ResourceError {
5858
message DiscoveryRequest {
5959
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.DiscoveryRequest";
6060

61-
// The version_info provided in the request messages will be the version_info
61+
// The ``version_info`` provided in the request messages will be the ``version_info``
6262
// received with the most recent successfully processed response or empty on
6363
// the first request. It is expected that no new request is sent after a
6464
// response is received until the Envoy instance is ready to ACK/NACK the new
6565
// configuration. ACK/NACK takes place by returning the new API config version
66-
// as applied or the previous API config version respectively. Each type_url
66+
// as applied or the previous API config version respectively. Each ``type_url``
6767
// (see below) has an independent version associated with it.
6868
string version_info = 1;
6969

@@ -72,32 +72,38 @@ message DiscoveryRequest {
7272

7373
// List of resources to subscribe to, e.g. list of cluster names or a route
7474
// configuration name. If this is empty, all resources for the API are
75-
// returned. LDS/CDS may have empty resource_names, which will cause all
75+
// returned. LDS/CDS may have empty ``resource_names``, which will cause all
7676
// resources for the Envoy instance to be returned. The LDS and CDS responses
7777
// will then imply a number of resources that need to be fetched via EDS/RDS,
78-
// which will be explicitly enumerated in resource_names.
78+
// which will be explicitly enumerated in ``resource_names``.
7979
repeated string resource_names = 3;
8080

8181
// [#not-implemented-hide:]
8282
// Alternative to ``resource_names`` field that allows specifying dynamic
8383
// parameters along with each resource name. Clients that populate this
8484
// field must be able to handle responses from the server where resources
8585
// are wrapped in a Resource message.
86-
// Note that it is legal for a request to have some resources listed
87-
// in ``resource_names`` and others in ``resource_locators``.
86+
//
87+
// .. note::
88+
// It is legal for a request to have some resources listed
89+
// in ``resource_names`` and others in ``resource_locators``.
90+
//
8891
repeated ResourceLocator resource_locators = 7;
8992

9093
// Type of the resource that is being requested, e.g.
91-
// "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". This is implicit
94+
// ``type.googleapis.com/envoy.api.v2.ClusterLoadAssignment``. This is implicit
9295
// in requests made via singleton xDS APIs such as CDS, LDS, etc. but is
9396
// required for ADS.
9497
string type_url = 4;
9598

96-
// nonce corresponding to DiscoveryResponse being ACK/NACKed. See above
97-
// discussion on version_info and the DiscoveryResponse nonce comment. This
98-
// may be empty only if 1) this is a non-persistent-stream xDS such as HTTP,
99-
// or 2) the client has not yet accepted an update in this xDS stream (unlike
100-
// delta, where it is populated only for new explicit ACKs).
99+
// nonce corresponding to ``DiscoveryResponse`` being ACK/NACKed. See above
100+
// discussion on ``version_info`` and the ``DiscoveryResponse`` nonce comment. This
101+
// may be empty only if:
102+
//
103+
// * This is a non-persistent-stream xDS such as HTTP, or
104+
// * The client has not yet accepted an update in this xDS stream (unlike
105+
// delta, where it is populated only for new explicit ACKs).
106+
//
101107
string response_nonce = 5;
102108

103109
// This is populated when the previous :ref:`DiscoveryResponse <envoy_v3_api_msg_service.discovery.v3.DiscoveryResponse>`
@@ -120,30 +126,34 @@ message DiscoveryResponse {
120126
// [#not-implemented-hide:]
121127
// Canary is used to support two Envoy command line flags:
122128
//
123-
// * --terminate-on-canary-transition-failure. When set, Envoy is able to
129+
// * ``--terminate-on-canary-transition-failure``. When set, Envoy is able to
124130
// terminate if it detects that configuration is stuck at canary. Consider
125131
// this example sequence of updates:
126-
// - Management server applies a canary config successfully.
127-
// - Management server rolls back to a production config.
128-
// - Envoy rejects the new production config.
132+
//
133+
// * Management server applies a canary config successfully.
134+
// * Management server rolls back to a production config.
135+
// * Envoy rejects the new production config.
136+
//
129137
// Since there is no sensible way to continue receiving configuration
130138
// updates, Envoy will then terminate and apply production config from a
131139
// clean slate.
132-
// * --dry-run-canary. When set, a canary response will never be applied, only
140+
//
141+
// * ``--dry-run-canary``. When set, a canary response will never be applied, only
133142
// validated via a dry run.
143+
//
134144
bool canary = 3;
135145

136146
// Type URL for resources. Identifies the xDS API when muxing over ADS.
137-
// Must be consistent with the type_url in the 'resources' repeated Any (if non-empty).
147+
// Must be consistent with the ``type_url`` in the 'resources' repeated Any (if non-empty).
138148
string type_url = 4;
139149

140150
// For gRPC based subscriptions, the nonce provides a way to explicitly ack a
141-
// specific DiscoveryResponse in a following DiscoveryRequest. Additional
151+
// specific ``DiscoveryResponse`` in a following ``DiscoveryRequest``. Additional
142152
// messages may have been sent by Envoy to the management server for the
143-
// previous version on the stream prior to this DiscoveryResponse, that were
153+
// previous version on the stream prior to this ``DiscoveryResponse``, that were
144154
// unprocessed at response send time. The nonce allows the management server
145-
// to ignore any further DiscoveryRequests for the previous version until a
146-
// DiscoveryRequest bearing the nonce. The nonce is optional and is not
155+
// to ignore any further ``DiscoveryRequests`` for the previous version until a
156+
// ``DiscoveryRequest`` bearing the nonce. The nonce is optional and is not
147157
// required for non-stream based xDS implementations.
148158
string nonce = 5;
149159

@@ -171,25 +181,28 @@ message DiscoveryResponse {
171181
// connected to it.
172182
//
173183
// In Delta xDS the nonce field is required and used to pair
174-
// DeltaDiscoveryResponse to a DeltaDiscoveryRequest ACK or NACK.
175-
// Optionally, a response message level system_version_info is present for
184+
// ``DeltaDiscoveryResponse`` to a ``DeltaDiscoveryRequest`` ACK or NACK.
185+
// Optionally, a response message level ``system_version_info`` is present for
176186
// debugging purposes only.
177187
//
178-
// DeltaDiscoveryRequest plays two independent roles. Any DeltaDiscoveryRequest
179-
// can be either or both of: [1] informing the server of what resources the
180-
// client has gained/lost interest in (using resource_names_subscribe and
181-
// resource_names_unsubscribe), or [2] (N)ACKing an earlier resource update from
182-
// the server (using response_nonce, with presence of error_detail making it a NACK).
183-
// Additionally, the first message (for a given type_url) of a reconnected gRPC stream
188+
// ``DeltaDiscoveryRequest`` plays two independent roles. Any ``DeltaDiscoveryRequest``
189+
// can be either or both of:
190+
//
191+
// * Informing the server of what resources the client has gained/lost interest in
192+
// (using ``resource_names_subscribe`` and ``resource_names_unsubscribe``), or
193+
// * (N)ACKing an earlier resource update from the server (using ``response_nonce``,
194+
// with presence of ``error_detail`` making it a NACK).
195+
//
196+
// Additionally, the first message (for a given ``type_url``) of a reconnected gRPC stream
184197
// has a third role: informing the server of the resources (and their versions)
185-
// that the client already possesses, using the initial_resource_versions field.
198+
// that the client already possesses, using the ``initial_resource_versions`` field.
186199
//
187200
// As with state-of-the-world, when multiple resource types are multiplexed (ADS),
188-
// all requests/acknowledgments/updates are logically walled off by type_url:
201+
// all requests/acknowledgments/updates are logically walled off by ``type_url``:
189202
// a Cluster ACK exists in a completely separate world from a prior Route NACK.
190-
// In particular, initial_resource_versions being sent at the "start" of every
191-
// gRPC stream actually entails a message for each type_url, each with its own
192-
// initial_resource_versions.
203+
// In particular, ``initial_resource_versions`` being sent at the "start" of every
204+
// gRPC stream actually entails a message for each ``type_url``, each with its own
205+
// ``initial_resource_versions``.
193206
// [#next-free-field: 10]
194207
message DeltaDiscoveryRequest {
195208
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.DeltaDiscoveryRequest";
@@ -205,23 +218,24 @@ message DeltaDiscoveryRequest {
205218

206219
// DeltaDiscoveryRequests allow the client to add or remove individual
207220
// resources to the set of tracked resources in the context of a stream.
208-
// All resource names in the resource_names_subscribe list are added to the
209-
// set of tracked resources and all resource names in the resource_names_unsubscribe
221+
// All resource names in the ``resource_names_subscribe`` list are added to the
222+
// set of tracked resources and all resource names in the ``resource_names_unsubscribe``
210223
// list are removed from the set of tracked resources.
211224
//
212-
// *Unlike* state-of-the-world xDS, an empty resource_names_subscribe or
213-
// resource_names_unsubscribe list simply means that no resources are to be
225+
// *Unlike* state-of-the-world xDS, an empty ``resource_names_subscribe`` or
226+
// ``resource_names_unsubscribe`` list simply means that no resources are to be
214227
// added or removed to the resource list.
215228
// *Like* state-of-the-world xDS, the server must send updates for all tracked
216229
// resources, but can also send updates for resources the client has not subscribed to.
217230
//
218-
// NOTE: the server must respond with all resources listed in resource_names_subscribe,
219-
// even if it believes the client has the most recent version of them. The reason:
220-
// the client may have dropped them, but then regained interest before it had a chance
221-
// to send the unsubscribe message. See DeltaSubscriptionStateTest.RemoveThenAdd.
231+
// .. note::
232+
// The server must respond with all resources listed in ``resource_names_subscribe``,
233+
// even if it believes the client has the most recent version of them. The reason:
234+
// the client may have dropped them, but then regained interest before it had a chance
235+
// to send the unsubscribe message. See DeltaSubscriptionStateTest.RemoveThenAdd.
222236
//
223-
// These two fields can be set in any DeltaDiscoveryRequest, including ACKs
224-
// and initial_resource_versions.
237+
// These two fields can be set in any ``DeltaDiscoveryRequest``, including ACKs
238+
// and ``initial_resource_versions``.
225239
//
226240
// A list of Resource names to add to the list of tracked resources.
227241
repeated string resource_names_subscribe = 3;
@@ -232,31 +246,40 @@ message DeltaDiscoveryRequest {
232246
// [#not-implemented-hide:]
233247
// Alternative to ``resource_names_subscribe`` field that allows specifying dynamic parameters
234248
// along with each resource name.
235-
// Note that it is legal for a request to have some resources listed
236-
// in ``resource_names_subscribe`` and others in ``resource_locators_subscribe``.
249+
//
250+
// .. note::
251+
// It is legal for a request to have some resources listed
252+
// in ``resource_names_subscribe`` and others in ``resource_locators_subscribe``.
253+
//
237254
repeated ResourceLocator resource_locators_subscribe = 8;
238255

239256
// [#not-implemented-hide:]
240257
// Alternative to ``resource_names_unsubscribe`` field that allows specifying dynamic parameters
241258
// along with each resource name.
242-
// Note that it is legal for a request to have some resources listed
243-
// in ``resource_names_unsubscribe`` and others in ``resource_locators_unsubscribe``.
259+
//
260+
// .. note::
261+
// It is legal for a request to have some resources listed
262+
// in ``resource_names_unsubscribe`` and others in ``resource_locators_unsubscribe``.
263+
//
244264
repeated ResourceLocator resource_locators_unsubscribe = 9;
245265

246266
// Informs the server of the versions of the resources the xDS client knows of, to enable the
247267
// client to continue the same logical xDS session even in the face of gRPC stream reconnection.
248-
// It will not be populated: [1] in the very first stream of a session, since the client will
249-
// not yet have any resources, [2] in any message after the first in a stream (for a given
250-
// type_url), since the server will already be correctly tracking the client's state.
251-
// (In ADS, the first message *of each type_url* of a reconnected stream populates this map.)
268+
// It will not be populated:
269+
//
270+
// * In the very first stream of a session, since the client will not yet have any resources.
271+
// * In any message after the first in a stream (for a given ``type_url``), since the server will
272+
// already be correctly tracking the client's state.
273+
//
274+
// (In ADS, the first message ``of each type_url`` of a reconnected stream populates this map.)
252275
// The map's keys are names of xDS resources known to the xDS client.
253276
// The map's values are opaque resource versions.
254277
map<string, string> initial_resource_versions = 5;
255278

256-
// When the DeltaDiscoveryRequest is a ACK or NACK message in response
257-
// to a previous DeltaDiscoveryResponse, the response_nonce must be the
258-
// nonce in the DeltaDiscoveryResponse.
259-
// Otherwise (unlike in DiscoveryRequest) response_nonce must be omitted.
279+
// When the ``DeltaDiscoveryRequest`` is a ACK or NACK message in response
280+
// to a previous ``DeltaDiscoveryResponse``, the ``response_nonce`` must be the
281+
// nonce in the ``DeltaDiscoveryResponse``.
282+
// Otherwise (unlike in ``DiscoveryRequest``) ``response_nonce`` must be omitted.
260283
string response_nonce = 6;
261284

262285
// This is populated when the previous :ref:`DiscoveryResponse <envoy_v3_api_msg_service.discovery.v3.DiscoveryResponse>`
@@ -274,44 +297,46 @@ message DeltaDiscoveryResponse {
274297
string system_version_info = 1;
275298

276299
// The response resources. These are typed resources, whose types must match
277-
// the type_url field.
300+
// the ``type_url`` field.
278301
repeated Resource resources = 2;
279302

280303
// field id 3 IS available!
281304

282305
// Type URL for resources. Identifies the xDS API when muxing over ADS.
283-
// Must be consistent with the type_url in the Any within 'resources' if 'resources' is non-empty.
306+
// Must be consistent with the ``type_url`` in the Any within 'resources' if 'resources' is non-empty.
284307
string type_url = 4;
285308

286-
// Resources names of resources that have be deleted and to be removed from the xDS Client.
309+
// Resource names of resources that have been deleted and to be removed from the xDS Client.
287310
// Removed resources for missing resources can be ignored.
288311
repeated string removed_resources = 6;
289312

290-
// Alternative to removed_resources that allows specifying which variant of
313+
// Alternative to ``removed_resources`` that allows specifying which variant of
291314
// a resource is being removed. This variant must be used for any resource
292315
// for which dynamic parameter constraints were sent to the client.
293316
repeated ResourceName removed_resource_names = 8;
294317

295-
// The nonce provides a way for DeltaDiscoveryRequests to uniquely
296-
// reference a DeltaDiscoveryResponse when (N)ACKing. The nonce is required.
318+
// The nonce provides a way for ``DeltaDiscoveryRequests`` to uniquely
319+
// reference a ``DeltaDiscoveryResponse`` when (N)ACKing. The nonce is required.
297320
string nonce = 5;
298321

299322
// [#not-implemented-hide:]
300323
// The control plane instance that sent the response.
301324
config.core.v3.ControlPlane control_plane = 7;
302325

303326
// [#not-implemented-hide:]
304-
// Errors associated with specific resources. Note that a resource in
305-
// this field with a status of NOT_FOUND should be treated the same as
306-
// a resource listed in the 'removed_resources' or 'removed_resource_names'
307-
// fields.
327+
// Errors associated with specific resources.
328+
//
329+
// .. note::
330+
// A resource in this field with a status of NOT_FOUND should be treated the same as
331+
// a resource listed in the ``removed_resources`` or ``removed_resource_names`` fields.
332+
//
308333
repeated ResourceError resource_errors = 9;
309334
}
310335

311336
// A set of dynamic parameter constraints associated with a variant of an individual xDS resource.
312337
// These constraints determine whether the resource matches a subscription based on the set of
313338
// dynamic parameters in the subscription, as specified in the
314-
// :ref:`ResourceLocator.dynamic_parameters<envoy_v3_api_field_service.discovery.v3.ResourceLocator.dynamic_parameters>`
339+
// :ref:`ResourceLocator.dynamic_parameters <envoy_v3_api_field_service.discovery.v3.ResourceLocator.dynamic_parameters>`
315340
// field. This allows xDS implementations (clients, servers, and caching proxies) to determine
316341
// which variant of a resource is appropriate for a given client.
317342
message DynamicParameterConstraints {
@@ -365,8 +390,11 @@ message Resource {
365390
// [#not-implemented-hide:]
366391
message CacheControl {
367392
// If true, xDS proxies may not cache this resource.
368-
// Note that this does not apply to clients other than xDS proxies, which must cache resources
369-
// for their own use, regardless of the value of this field.
393+
//
394+
// .. note::
395+
// This does not apply to clients other than xDS proxies, which must cache resources
396+
// for their own use, regardless of the value of this field.
397+
//
370398
bool do_not_cache = 1;
371399
}
372400

@@ -396,7 +424,7 @@ message Resource {
396424
// configuration for the resource will be removed.
397425
//
398426
// The TTL can be refreshed or changed by sending a response that doesn't change the resource
399-
// version. In this case the resource field does not need to be populated, which allows for
427+
// version. In this case the ``resource`` field does not need to be populated, which allows for
400428
// light-weight "heartbeat" updates to keep a resource with a TTL alive.
401429
//
402430
// The TTL feature is meant to support configurations that should be removed in the event of

0 commit comments

Comments
 (0)