From 3003dbea52a9c78ae78292b874ee4677f4667010 Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Wed, 12 Oct 2022 13:47:53 -0700 Subject: [PATCH 1/2] grpc-js-xds: Delete generated code for xDS v2 --- packages/grpc-js-xds/package.json | 3 +- packages/grpc-js-xds/src/generated/ads.ts | 57 ----- .../envoy/api/v2/DeltaDiscoveryRequest.ts | 202 ------------------ .../envoy/api/v2/DeltaDiscoveryResponse.ts | 63 ------ .../envoy/api/v2/DiscoveryRequest.ts | 110 ---------- .../envoy/api/v2/DiscoveryResponse.ts | 108 ---------- .../src/generated/envoy/api/v2/Resource.ts | 43 ---- .../generated/envoy/api/v2/core/Address.ts | 26 --- .../envoy/api/v2/core/AsyncDataSource.ts | 34 --- .../envoy/api/v2/core/BackoffStrategy.ts | 43 ---- .../generated/envoy/api/v2/core/BindConfig.ts | 49 ----- .../envoy/api/v2/core/BuildVersion.ts | 36 ---- .../generated/envoy/api/v2/core/CidrRange.ts | 33 --- .../envoy/api/v2/core/ControlPlane.ts | 26 --- .../generated/envoy/api/v2/core/DataSource.ts | 40 ---- .../generated/envoy/api/v2/core/Extension.ts | 75 ------- .../generated/envoy/api/v2/core/HeaderMap.ts | 17 -- .../envoy/api/v2/core/HeaderValue.ts | 38 ---- .../envoy/api/v2/core/HeaderValueOption.ts | 34 --- .../generated/envoy/api/v2/core/HttpUri.ts | 79 ------- .../generated/envoy/api/v2/core/Locality.ts | 56 ----- .../generated/envoy/api/v2/core/Metadata.ts | 67 ------ .../src/generated/envoy/api/v2/core/Node.ts | 173 --------------- .../src/generated/envoy/api/v2/core/Pipe.ts | 30 --- .../envoy/api/v2/core/RemoteDataSource.ts | 40 ---- .../envoy/api/v2/core/RequestMethod.ts | 17 -- .../envoy/api/v2/core/RetryPolicy.ts | 38 ---- .../envoy/api/v2/core/RoutingPriority.ts | 15 -- .../envoy/api/v2/core/RuntimeDouble.ts | 30 --- .../envoy/api/v2/core/RuntimeFeatureFlag.ts | 35 --- .../api/v2/core/RuntimeFractionalPercent.ts | 49 ----- .../envoy/api/v2/core/RuntimeUInt32.ts | 30 --- .../envoy/api/v2/core/SocketAddress.ts | 97 --------- .../envoy/api/v2/core/SocketOption.ts | 90 -------- .../envoy/api/v2/core/TcpKeepalive.ts | 43 ---- .../envoy/api/v2/core/TrafficDirection.ts | 19 -- .../envoy/api/v2/core/TransportSocket.ts | 46 ---- .../envoy/api/v2/endpoint/ClusterStats.ts | 117 ---------- .../v2/endpoint/EndpointLoadMetricStats.ts | 41 ---- .../api/v2/endpoint/UpstreamEndpointStats.ts | 106 --------- .../api/v2/endpoint/UpstreamLocalityStats.ts | 108 ---------- .../envoy/service/discovery/v2/AdsDummy.ts | 16 -- .../v2/AggregatedDiscoveryService.ts | 58 ----- .../load_stats/v2/LoadReportingService.ts | 113 ---------- .../service/load_stats/v2/LoadStatsRequest.ts | 34 --- .../load_stats/v2/LoadStatsResponse.ts | 71 ------ .../generated/envoy/type/FractionalPercent.ts | 68 ------ .../src/generated/envoy/type/Percent.ts | 16 -- .../generated/envoy/type/SemanticVersion.ts | 24 --- packages/grpc-js-xds/src/generated/lrs.ts | 51 ----- 50 files changed, 1 insertion(+), 2813 deletions(-) delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/DeltaDiscoveryRequest.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/DeltaDiscoveryResponse.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/DiscoveryRequest.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/DiscoveryResponse.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/Resource.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/Address.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/AsyncDataSource.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/BackoffStrategy.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/BindConfig.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/BuildVersion.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/CidrRange.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/ControlPlane.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/DataSource.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/Extension.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/HeaderMap.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/HeaderValue.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/HeaderValueOption.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/HttpUri.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/Locality.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/Metadata.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/Node.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/Pipe.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/RemoteDataSource.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/RequestMethod.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/RetryPolicy.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/RoutingPriority.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/RuntimeDouble.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/RuntimeFeatureFlag.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/RuntimeFractionalPercent.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/RuntimeUInt32.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/SocketAddress.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/SocketOption.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/TcpKeepalive.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/TrafficDirection.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/core/TransportSocket.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/endpoint/ClusterStats.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/endpoint/EndpointLoadMetricStats.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/endpoint/UpstreamEndpointStats.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/api/v2/endpoint/UpstreamLocalityStats.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/service/discovery/v2/AdsDummy.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/service/discovery/v2/AggregatedDiscoveryService.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/service/load_stats/v2/LoadReportingService.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/service/load_stats/v2/LoadStatsRequest.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/service/load_stats/v2/LoadStatsResponse.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/type/FractionalPercent.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/type/Percent.ts delete mode 100644 packages/grpc-js-xds/src/generated/envoy/type/SemanticVersion.ts diff --git a/packages/grpc-js-xds/package.json b/packages/grpc-js-xds/package.json index fcb9279f0..124c3ed7d 100644 --- a/packages/grpc-js-xds/package.json +++ b/packages/grpc-js-xds/package.json @@ -12,7 +12,7 @@ "prepare": "npm run compile", "pretest": "npm run compile", "posttest": "npm run check", - "generate-types": "proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs deps/envoy-api/ deps/xds/ deps/googleapis/ deps/protoc-gen-validate/ -O src/generated/ --grpcLib @grpc/grpc-js envoy/service/discovery/v2/ads.proto envoy/service/load_stats/v2/lrs.proto envoy/service/discovery/v3/ads.proto envoy/service/load_stats/v3/lrs.proto envoy/config/listener/v3/listener.proto envoy/config/route/v3/route.proto envoy/config/cluster/v3/cluster.proto envoy/config/endpoint/v3/endpoint.proto envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto udpa/type/v1/typed_struct.proto xds/type/v3/typed_struct.proto envoy/extensions/filters/http/fault/v3/fault.proto envoy/service/status/v3/csds.proto", + "generate-types": "proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs deps/envoy-api/ deps/xds/ deps/googleapis/ deps/protoc-gen-validate/ -O src/generated/ --grpcLib @grpc/grpc-js envoy/service/discovery/v3/ads.proto envoy/service/load_stats/v3/lrs.proto envoy/config/listener/v3/listener.proto envoy/config/route/v3/route.proto envoy/config/cluster/v3/cluster.proto envoy/config/endpoint/v3/endpoint.proto envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto udpa/type/v1/typed_struct.proto xds/type/v3/typed_struct.proto envoy/extensions/filters/http/fault/v3/fault.proto envoy/service/status/v3/csds.proto", "generate-interop-types": "proto-loader-gen-types --keep-case --longs String --enums String --defaults --oneofs --json --includeComments --includeDirs proto/ -O interop/generated --grpcLib @grpc/grpc-js grpc/testing/test.proto" }, "repository": { @@ -56,7 +56,6 @@ "src/**/*.ts", "build/src/**/*.{js,d.ts,js.map}", "deps/envoy-api/envoy/admin/v3/**/*.proto", - "deps/envoy-api/envoy/api/v2/**/*.proto", "deps/envoy-api/envoy/config/**/*.proto", "deps/envoy-api/envoy/service/**/*.proto", "deps/envoy-api/envoy/type/**/*.proto", diff --git a/packages/grpc-js-xds/src/generated/ads.ts b/packages/grpc-js-xds/src/generated/ads.ts index e0e46bb25..228f6f1d4 100644 --- a/packages/grpc-js-xds/src/generated/ads.ts +++ b/packages/grpc-js-xds/src/generated/ads.ts @@ -1,7 +1,6 @@ import type * as grpc from '@grpc/grpc-js'; import type { EnumTypeDefinition, MessageTypeDefinition } from '@grpc/proto-loader'; -import type { AggregatedDiscoveryServiceClient as _envoy_service_discovery_v2_AggregatedDiscoveryServiceClient, AggregatedDiscoveryServiceDefinition as _envoy_service_discovery_v2_AggregatedDiscoveryServiceDefinition } from './envoy/service/discovery/v2/AggregatedDiscoveryService'; import type { AggregatedDiscoveryServiceClient as _envoy_service_discovery_v3_AggregatedDiscoveryServiceClient, AggregatedDiscoveryServiceDefinition as _envoy_service_discovery_v3_AggregatedDiscoveryServiceDefinition } from './envoy/service/discovery/v3/AggregatedDiscoveryService'; type SubtypeConstructor any, Subtype> = { @@ -12,47 +11,6 @@ export interface ProtoGrpcType { envoy: { annotations: { } - api: { - v2: { - DeltaDiscoveryRequest: MessageTypeDefinition - DeltaDiscoveryResponse: MessageTypeDefinition - DiscoveryRequest: MessageTypeDefinition - DiscoveryResponse: MessageTypeDefinition - Resource: MessageTypeDefinition - core: { - Address: MessageTypeDefinition - AsyncDataSource: MessageTypeDefinition - BackoffStrategy: MessageTypeDefinition - BindConfig: MessageTypeDefinition - BuildVersion: MessageTypeDefinition - CidrRange: MessageTypeDefinition - ControlPlane: MessageTypeDefinition - DataSource: MessageTypeDefinition - Extension: MessageTypeDefinition - HeaderMap: MessageTypeDefinition - HeaderValue: MessageTypeDefinition - HeaderValueOption: MessageTypeDefinition - HttpUri: MessageTypeDefinition - Locality: MessageTypeDefinition - Metadata: MessageTypeDefinition - Node: MessageTypeDefinition - Pipe: MessageTypeDefinition - RemoteDataSource: MessageTypeDefinition - RequestMethod: EnumTypeDefinition - RetryPolicy: MessageTypeDefinition - RoutingPriority: EnumTypeDefinition - RuntimeDouble: MessageTypeDefinition - RuntimeFeatureFlag: MessageTypeDefinition - RuntimeFractionalPercent: MessageTypeDefinition - RuntimeUInt32: MessageTypeDefinition - SocketAddress: MessageTypeDefinition - SocketOption: MessageTypeDefinition - TcpKeepalive: MessageTypeDefinition - TrafficDirection: EnumTypeDefinition - TransportSocket: MessageTypeDefinition - } - } - } config: { core: { v3: { @@ -95,18 +53,6 @@ export interface ProtoGrpcType { } service: { discovery: { - v2: { - AdsDummy: MessageTypeDefinition - /** - * See https://github.com/lyft/envoy-api#apis for a description of the role of - * ADS and how it is intended to be used by a management server. ADS requests - * have the same structure as their singleton xDS counterparts, but can - * multiplex many resource types on a single stream. The type_url in the - * DiscoveryRequest/DiscoveryResponse provides sufficient information to recover - * the multiplexed singleton APIs at the Envoy instance and management server. - */ - AggregatedDiscoveryService: SubtypeConstructor & { service: _envoy_service_discovery_v2_AggregatedDiscoveryServiceDefinition } - } v3: { AdsDummy: MessageTypeDefinition /** @@ -127,9 +73,6 @@ export interface ProtoGrpcType { } } type: { - FractionalPercent: MessageTypeDefinition - Percent: MessageTypeDefinition - SemanticVersion: MessageTypeDefinition v3: { FractionalPercent: MessageTypeDefinition Percent: MessageTypeDefinition diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/DeltaDiscoveryRequest.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/DeltaDiscoveryRequest.ts deleted file mode 100644 index 20ddb1b14..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/DeltaDiscoveryRequest.ts +++ /dev/null @@ -1,202 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/discovery.proto - -import type { Node as _envoy_api_v2_core_Node, Node__Output as _envoy_api_v2_core_Node__Output } from '../../../envoy/api/v2/core/Node'; -import type { Status as _google_rpc_Status, Status__Output as _google_rpc_Status__Output } from '../../../google/rpc/Status'; - -/** - * DeltaDiscoveryRequest and DeltaDiscoveryResponse are used in a new gRPC - * endpoint for Delta xDS. - * - * With Delta xDS, the DeltaDiscoveryResponses do not need to include a full - * snapshot of the tracked resources. Instead, DeltaDiscoveryResponses are a - * diff to the state of a xDS client. - * In Delta XDS there are per-resource versions, which allow tracking state at - * the resource granularity. - * An xDS Delta session is always in the context of a gRPC bidirectional - * stream. This allows the xDS server to keep track of the state of xDS clients - * connected to it. - * - * In Delta xDS the nonce field is required and used to pair - * DeltaDiscoveryResponse to a DeltaDiscoveryRequest ACK or NACK. - * Optionally, a response message level system_version_info is present for - * debugging purposes only. - * - * DeltaDiscoveryRequest plays two independent roles. Any DeltaDiscoveryRequest - * can be either or both of: [1] informing the server of what resources the - * client has gained/lost interest in (using resource_names_subscribe and - * resource_names_unsubscribe), or [2] (N)ACKing an earlier resource update from - * the server (using response_nonce, with presence of error_detail making it a NACK). - * Additionally, the first message (for a given type_url) of a reconnected gRPC stream - * has a third role: informing the server of the resources (and their versions) - * that the client already possesses, using the initial_resource_versions field. - * - * As with state-of-the-world, when multiple resource types are multiplexed (ADS), - * all requests/acknowledgments/updates are logically walled off by type_url: - * a Cluster ACK exists in a completely separate world from a prior Route NACK. - * In particular, initial_resource_versions being sent at the "start" of every - * gRPC stream actually entails a message for each type_url, each with its own - * initial_resource_versions. - * [#next-free-field: 8] - */ -export interface DeltaDiscoveryRequest { - /** - * The node making the request. - */ - 'node'?: (_envoy_api_v2_core_Node | null); - /** - * Type of the resource that is being requested, e.g. - * "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". - */ - 'type_url'?: (string); - /** - * DeltaDiscoveryRequests allow the client to add or remove individual - * resources to the set of tracked resources in the context of a stream. - * All resource names in the resource_names_subscribe list are added to the - * set of tracked resources and all resource names in the resource_names_unsubscribe - * list are removed from the set of tracked resources. - * - * *Unlike* state-of-the-world xDS, an empty resource_names_subscribe or - * resource_names_unsubscribe list simply means that no resources are to be - * added or removed to the resource list. - * *Like* state-of-the-world xDS, the server must send updates for all tracked - * resources, but can also send updates for resources the client has not subscribed to. - * - * NOTE: the server must respond with all resources listed in resource_names_subscribe, - * even if it believes the client has the most recent version of them. The reason: - * the client may have dropped them, but then regained interest before it had a chance - * to send the unsubscribe message. See DeltaSubscriptionStateTest.RemoveThenAdd. - * - * These two fields can be set in any DeltaDiscoveryRequest, including ACKs - * and initial_resource_versions. - * - * A list of Resource names to add to the list of tracked resources. - */ - 'resource_names_subscribe'?: (string)[]; - /** - * A list of Resource names to remove from the list of tracked resources. - */ - 'resource_names_unsubscribe'?: (string)[]; - /** - * Informs the server of the versions of the resources the xDS client knows of, to enable the - * client to continue the same logical xDS session even in the face of gRPC stream reconnection. - * It will not be populated: [1] in the very first stream of a session, since the client will - * not yet have any resources, [2] in any message after the first in a stream (for a given - * type_url), since the server will already be correctly tracking the client's state. - * (In ADS, the first message *of each type_url* of a reconnected stream populates this map.) - * The map's keys are names of xDS resources known to the xDS client. - * The map's values are opaque resource versions. - */ - 'initial_resource_versions'?: ({[key: string]: string}); - /** - * When the DeltaDiscoveryRequest is a ACK or NACK message in response - * to a previous DeltaDiscoveryResponse, the response_nonce must be the - * nonce in the DeltaDiscoveryResponse. - * Otherwise (unlike in DiscoveryRequest) response_nonce must be omitted. - */ - 'response_nonce'?: (string); - /** - * This is populated when the previous :ref:`DiscoveryResponse ` - * failed to update configuration. The *message* field in *error_details* - * provides the Envoy internal exception related to the failure. - */ - 'error_detail'?: (_google_rpc_Status | null); -} - -/** - * DeltaDiscoveryRequest and DeltaDiscoveryResponse are used in a new gRPC - * endpoint for Delta xDS. - * - * With Delta xDS, the DeltaDiscoveryResponses do not need to include a full - * snapshot of the tracked resources. Instead, DeltaDiscoveryResponses are a - * diff to the state of a xDS client. - * In Delta XDS there are per-resource versions, which allow tracking state at - * the resource granularity. - * An xDS Delta session is always in the context of a gRPC bidirectional - * stream. This allows the xDS server to keep track of the state of xDS clients - * connected to it. - * - * In Delta xDS the nonce field is required and used to pair - * DeltaDiscoveryResponse to a DeltaDiscoveryRequest ACK or NACK. - * Optionally, a response message level system_version_info is present for - * debugging purposes only. - * - * DeltaDiscoveryRequest plays two independent roles. Any DeltaDiscoveryRequest - * can be either or both of: [1] informing the server of what resources the - * client has gained/lost interest in (using resource_names_subscribe and - * resource_names_unsubscribe), or [2] (N)ACKing an earlier resource update from - * the server (using response_nonce, with presence of error_detail making it a NACK). - * Additionally, the first message (for a given type_url) of a reconnected gRPC stream - * has a third role: informing the server of the resources (and their versions) - * that the client already possesses, using the initial_resource_versions field. - * - * As with state-of-the-world, when multiple resource types are multiplexed (ADS), - * all requests/acknowledgments/updates are logically walled off by type_url: - * a Cluster ACK exists in a completely separate world from a prior Route NACK. - * In particular, initial_resource_versions being sent at the "start" of every - * gRPC stream actually entails a message for each type_url, each with its own - * initial_resource_versions. - * [#next-free-field: 8] - */ -export interface DeltaDiscoveryRequest__Output { - /** - * The node making the request. - */ - 'node': (_envoy_api_v2_core_Node__Output | null); - /** - * Type of the resource that is being requested, e.g. - * "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". - */ - 'type_url': (string); - /** - * DeltaDiscoveryRequests allow the client to add or remove individual - * resources to the set of tracked resources in the context of a stream. - * All resource names in the resource_names_subscribe list are added to the - * set of tracked resources and all resource names in the resource_names_unsubscribe - * list are removed from the set of tracked resources. - * - * *Unlike* state-of-the-world xDS, an empty resource_names_subscribe or - * resource_names_unsubscribe list simply means that no resources are to be - * added or removed to the resource list. - * *Like* state-of-the-world xDS, the server must send updates for all tracked - * resources, but can also send updates for resources the client has not subscribed to. - * - * NOTE: the server must respond with all resources listed in resource_names_subscribe, - * even if it believes the client has the most recent version of them. The reason: - * the client may have dropped them, but then regained interest before it had a chance - * to send the unsubscribe message. See DeltaSubscriptionStateTest.RemoveThenAdd. - * - * These two fields can be set in any DeltaDiscoveryRequest, including ACKs - * and initial_resource_versions. - * - * A list of Resource names to add to the list of tracked resources. - */ - 'resource_names_subscribe': (string)[]; - /** - * A list of Resource names to remove from the list of tracked resources. - */ - 'resource_names_unsubscribe': (string)[]; - /** - * Informs the server of the versions of the resources the xDS client knows of, to enable the - * client to continue the same logical xDS session even in the face of gRPC stream reconnection. - * It will not be populated: [1] in the very first stream of a session, since the client will - * not yet have any resources, [2] in any message after the first in a stream (for a given - * type_url), since the server will already be correctly tracking the client's state. - * (In ADS, the first message *of each type_url* of a reconnected stream populates this map.) - * The map's keys are names of xDS resources known to the xDS client. - * The map's values are opaque resource versions. - */ - 'initial_resource_versions': ({[key: string]: string}); - /** - * When the DeltaDiscoveryRequest is a ACK or NACK message in response - * to a previous DeltaDiscoveryResponse, the response_nonce must be the - * nonce in the DeltaDiscoveryResponse. - * Otherwise (unlike in DiscoveryRequest) response_nonce must be omitted. - */ - 'response_nonce': (string); - /** - * This is populated when the previous :ref:`DiscoveryResponse ` - * failed to update configuration. The *message* field in *error_details* - * provides the Envoy internal exception related to the failure. - */ - 'error_detail': (_google_rpc_Status__Output | null); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/DeltaDiscoveryResponse.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/DeltaDiscoveryResponse.ts deleted file mode 100644 index 1a2584b95..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/DeltaDiscoveryResponse.ts +++ /dev/null @@ -1,63 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/discovery.proto - -import type { Resource as _envoy_api_v2_Resource, Resource__Output as _envoy_api_v2_Resource__Output } from '../../../envoy/api/v2/Resource'; - -/** - * [#next-free-field: 7] - */ -export interface DeltaDiscoveryResponse { - /** - * The version of the response data (used for debugging). - */ - 'system_version_info'?: (string); - /** - * The response resources. These are typed resources, whose types must match - * the type_url field. - */ - 'resources'?: (_envoy_api_v2_Resource)[]; - /** - * Type URL for resources. Identifies the xDS API when muxing over ADS. - * Must be consistent with the type_url in the Any within 'resources' if 'resources' is non-empty. - */ - 'type_url'?: (string); - /** - * The nonce provides a way for DeltaDiscoveryRequests to uniquely - * reference a DeltaDiscoveryResponse when (N)ACKing. The nonce is required. - */ - 'nonce'?: (string); - /** - * Resources names of resources that have be deleted and to be removed from the xDS Client. - * Removed resources for missing resources can be ignored. - */ - 'removed_resources'?: (string)[]; -} - -/** - * [#next-free-field: 7] - */ -export interface DeltaDiscoveryResponse__Output { - /** - * The version of the response data (used for debugging). - */ - 'system_version_info': (string); - /** - * The response resources. These are typed resources, whose types must match - * the type_url field. - */ - 'resources': (_envoy_api_v2_Resource__Output)[]; - /** - * Type URL for resources. Identifies the xDS API when muxing over ADS. - * Must be consistent with the type_url in the Any within 'resources' if 'resources' is non-empty. - */ - 'type_url': (string); - /** - * The nonce provides a way for DeltaDiscoveryRequests to uniquely - * reference a DeltaDiscoveryResponse when (N)ACKing. The nonce is required. - */ - 'nonce': (string); - /** - * Resources names of resources that have be deleted and to be removed from the xDS Client. - * Removed resources for missing resources can be ignored. - */ - 'removed_resources': (string)[]; -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/DiscoveryRequest.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/DiscoveryRequest.ts deleted file mode 100644 index 2386e71c4..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/DiscoveryRequest.ts +++ /dev/null @@ -1,110 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/discovery.proto - -import type { Node as _envoy_api_v2_core_Node, Node__Output as _envoy_api_v2_core_Node__Output } from '../../../envoy/api/v2/core/Node'; -import type { Status as _google_rpc_Status, Status__Output as _google_rpc_Status__Output } from '../../../google/rpc/Status'; - -/** - * A DiscoveryRequest requests a set of versioned resources of the same type for - * a given Envoy node on some API. - * [#next-free-field: 7] - */ -export interface DiscoveryRequest { - /** - * The version_info provided in the request messages will be the version_info - * received with the most recent successfully processed response or empty on - * the first request. It is expected that no new request is sent after a - * response is received until the Envoy instance is ready to ACK/NACK the new - * configuration. ACK/NACK takes place by returning the new API config version - * as applied or the previous API config version respectively. Each type_url - * (see below) has an independent version associated with it. - */ - 'version_info'?: (string); - /** - * The node making the request. - */ - 'node'?: (_envoy_api_v2_core_Node | null); - /** - * List of resources to subscribe to, e.g. list of cluster names or a route - * configuration name. If this is empty, all resources for the API are - * returned. LDS/CDS may have empty resource_names, which will cause all - * resources for the Envoy instance to be returned. The LDS and CDS responses - * will then imply a number of resources that need to be fetched via EDS/RDS, - * which will be explicitly enumerated in resource_names. - */ - 'resource_names'?: (string)[]; - /** - * Type of the resource that is being requested, e.g. - * "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". This is implicit - * in requests made via singleton xDS APIs such as CDS, LDS, etc. but is - * required for ADS. - */ - 'type_url'?: (string); - /** - * nonce corresponding to DiscoveryResponse being ACK/NACKed. See above - * discussion on version_info and the DiscoveryResponse nonce comment. This - * may be empty only if 1) this is a non-persistent-stream xDS such as HTTP, - * or 2) the client has not yet accepted an update in this xDS stream (unlike - * delta, where it is populated only for new explicit ACKs). - */ - 'response_nonce'?: (string); - /** - * This is populated when the previous :ref:`DiscoveryResponse ` - * failed to update configuration. The *message* field in *error_details* provides the Envoy - * internal exception related to the failure. It is only intended for consumption during manual - * debugging, the string provided is not guaranteed to be stable across Envoy versions. - */ - 'error_detail'?: (_google_rpc_Status | null); -} - -/** - * A DiscoveryRequest requests a set of versioned resources of the same type for - * a given Envoy node on some API. - * [#next-free-field: 7] - */ -export interface DiscoveryRequest__Output { - /** - * The version_info provided in the request messages will be the version_info - * received with the most recent successfully processed response or empty on - * the first request. It is expected that no new request is sent after a - * response is received until the Envoy instance is ready to ACK/NACK the new - * configuration. ACK/NACK takes place by returning the new API config version - * as applied or the previous API config version respectively. Each type_url - * (see below) has an independent version associated with it. - */ - 'version_info': (string); - /** - * The node making the request. - */ - 'node': (_envoy_api_v2_core_Node__Output | null); - /** - * List of resources to subscribe to, e.g. list of cluster names or a route - * configuration name. If this is empty, all resources for the API are - * returned. LDS/CDS may have empty resource_names, which will cause all - * resources for the Envoy instance to be returned. The LDS and CDS responses - * will then imply a number of resources that need to be fetched via EDS/RDS, - * which will be explicitly enumerated in resource_names. - */ - 'resource_names': (string)[]; - /** - * Type of the resource that is being requested, e.g. - * "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". This is implicit - * in requests made via singleton xDS APIs such as CDS, LDS, etc. but is - * required for ADS. - */ - 'type_url': (string); - /** - * nonce corresponding to DiscoveryResponse being ACK/NACKed. See above - * discussion on version_info and the DiscoveryResponse nonce comment. This - * may be empty only if 1) this is a non-persistent-stream xDS such as HTTP, - * or 2) the client has not yet accepted an update in this xDS stream (unlike - * delta, where it is populated only for new explicit ACKs). - */ - 'response_nonce': (string); - /** - * This is populated when the previous :ref:`DiscoveryResponse ` - * failed to update configuration. The *message* field in *error_details* provides the Envoy - * internal exception related to the failure. It is only intended for consumption during manual - * debugging, the string provided is not guaranteed to be stable across Envoy versions. - */ - 'error_detail': (_google_rpc_Status__Output | null); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/DiscoveryResponse.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/DiscoveryResponse.ts deleted file mode 100644 index 179143c67..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/DiscoveryResponse.ts +++ /dev/null @@ -1,108 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/discovery.proto - -import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../google/protobuf/Any'; -import type { ControlPlane as _envoy_api_v2_core_ControlPlane, ControlPlane__Output as _envoy_api_v2_core_ControlPlane__Output } from '../../../envoy/api/v2/core/ControlPlane'; - -/** - * [#next-free-field: 7] - */ -export interface DiscoveryResponse { - /** - * The version of the response data. - */ - 'version_info'?: (string); - /** - * The response resources. These resources are typed and depend on the API being called. - */ - 'resources'?: (_google_protobuf_Any)[]; - /** - * [#not-implemented-hide:] - * Canary is used to support two Envoy command line flags: - * - * * --terminate-on-canary-transition-failure. When set, Envoy is able to - * terminate if it detects that configuration is stuck at canary. Consider - * this example sequence of updates: - * - Management server applies a canary config successfully. - * - Management server rolls back to a production config. - * - Envoy rejects the new production config. - * Since there is no sensible way to continue receiving configuration - * updates, Envoy will then terminate and apply production config from a - * clean slate. - * * --dry-run-canary. When set, a canary response will never be applied, only - * validated via a dry run. - */ - 'canary'?: (boolean); - /** - * Type URL for resources. Identifies the xDS API when muxing over ADS. - * Must be consistent with the type_url in the 'resources' repeated Any (if non-empty). - */ - 'type_url'?: (string); - /** - * For gRPC based subscriptions, the nonce provides a way to explicitly ack a - * specific DiscoveryResponse in a following DiscoveryRequest. Additional - * messages may have been sent by Envoy to the management server for the - * previous version on the stream prior to this DiscoveryResponse, that were - * unprocessed at response send time. The nonce allows the management server - * to ignore any further DiscoveryRequests for the previous version until a - * DiscoveryRequest bearing the nonce. The nonce is optional and is not - * required for non-stream based xDS implementations. - */ - 'nonce'?: (string); - /** - * [#not-implemented-hide:] - * The control plane instance that sent the response. - */ - 'control_plane'?: (_envoy_api_v2_core_ControlPlane | null); -} - -/** - * [#next-free-field: 7] - */ -export interface DiscoveryResponse__Output { - /** - * The version of the response data. - */ - 'version_info': (string); - /** - * The response resources. These resources are typed and depend on the API being called. - */ - 'resources': (_google_protobuf_Any__Output)[]; - /** - * [#not-implemented-hide:] - * Canary is used to support two Envoy command line flags: - * - * * --terminate-on-canary-transition-failure. When set, Envoy is able to - * terminate if it detects that configuration is stuck at canary. Consider - * this example sequence of updates: - * - Management server applies a canary config successfully. - * - Management server rolls back to a production config. - * - Envoy rejects the new production config. - * Since there is no sensible way to continue receiving configuration - * updates, Envoy will then terminate and apply production config from a - * clean slate. - * * --dry-run-canary. When set, a canary response will never be applied, only - * validated via a dry run. - */ - 'canary': (boolean); - /** - * Type URL for resources. Identifies the xDS API when muxing over ADS. - * Must be consistent with the type_url in the 'resources' repeated Any (if non-empty). - */ - 'type_url': (string); - /** - * For gRPC based subscriptions, the nonce provides a way to explicitly ack a - * specific DiscoveryResponse in a following DiscoveryRequest. Additional - * messages may have been sent by Envoy to the management server for the - * previous version on the stream prior to this DiscoveryResponse, that were - * unprocessed at response send time. The nonce allows the management server - * to ignore any further DiscoveryRequests for the previous version until a - * DiscoveryRequest bearing the nonce. The nonce is optional and is not - * required for non-stream based xDS implementations. - */ - 'nonce': (string); - /** - * [#not-implemented-hide:] - * The control plane instance that sent the response. - */ - 'control_plane': (_envoy_api_v2_core_ControlPlane__Output | null); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/Resource.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/Resource.ts deleted file mode 100644 index 6ce856ee7..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/Resource.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/discovery.proto - -import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../google/protobuf/Any'; - -export interface Resource { - /** - * The resource level version. It allows xDS to track the state of individual - * resources. - */ - 'version'?: (string); - /** - * The resource being tracked. - */ - 'resource'?: (_google_protobuf_Any | null); - /** - * The resource's name, to distinguish it from others of the same type of resource. - */ - 'name'?: (string); - /** - * The aliases are a list of other names that this resource can go by. - */ - 'aliases'?: (string)[]; -} - -export interface Resource__Output { - /** - * The resource level version. It allows xDS to track the state of individual - * resources. - */ - 'version': (string); - /** - * The resource being tracked. - */ - 'resource': (_google_protobuf_Any__Output | null); - /** - * The resource's name, to distinguish it from others of the same type of resource. - */ - 'name': (string); - /** - * The aliases are a list of other names that this resource can go by. - */ - 'aliases': (string)[]; -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/Address.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/Address.ts deleted file mode 100644 index 65044b74a..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/Address.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/address.proto - -import type { SocketAddress as _envoy_api_v2_core_SocketAddress, SocketAddress__Output as _envoy_api_v2_core_SocketAddress__Output } from '../../../../envoy/api/v2/core/SocketAddress'; -import type { Pipe as _envoy_api_v2_core_Pipe, Pipe__Output as _envoy_api_v2_core_Pipe__Output } from '../../../../envoy/api/v2/core/Pipe'; - -/** - * Addresses specify either a logical or physical address and port, which are - * used to tell Envoy where to bind/listen, connect to upstream and find - * management servers. - */ -export interface Address { - 'socket_address'?: (_envoy_api_v2_core_SocketAddress | null); - 'pipe'?: (_envoy_api_v2_core_Pipe | null); - 'address'?: "socket_address"|"pipe"; -} - -/** - * Addresses specify either a logical or physical address and port, which are - * used to tell Envoy where to bind/listen, connect to upstream and find - * management servers. - */ -export interface Address__Output { - 'socket_address'?: (_envoy_api_v2_core_SocketAddress__Output | null); - 'pipe'?: (_envoy_api_v2_core_Pipe__Output | null); - 'address': "socket_address"|"pipe"; -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/AsyncDataSource.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/AsyncDataSource.ts deleted file mode 100644 index 139f82689..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/AsyncDataSource.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - -import type { DataSource as _envoy_api_v2_core_DataSource, DataSource__Output as _envoy_api_v2_core_DataSource__Output } from '../../../../envoy/api/v2/core/DataSource'; -import type { RemoteDataSource as _envoy_api_v2_core_RemoteDataSource, RemoteDataSource__Output as _envoy_api_v2_core_RemoteDataSource__Output } from '../../../../envoy/api/v2/core/RemoteDataSource'; - -/** - * Async data source which support async data fetch. - */ -export interface AsyncDataSource { - /** - * Local async data source. - */ - 'local'?: (_envoy_api_v2_core_DataSource | null); - /** - * Remote async data source. - */ - 'remote'?: (_envoy_api_v2_core_RemoteDataSource | null); - 'specifier'?: "local"|"remote"; -} - -/** - * Async data source which support async data fetch. - */ -export interface AsyncDataSource__Output { - /** - * Local async data source. - */ - 'local'?: (_envoy_api_v2_core_DataSource__Output | null); - /** - * Remote async data source. - */ - 'remote'?: (_envoy_api_v2_core_RemoteDataSource__Output | null); - 'specifier': "local"|"remote"; -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/BackoffStrategy.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/BackoffStrategy.ts deleted file mode 100644 index 173aff0e1..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/BackoffStrategy.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/backoff.proto - -import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../../../../google/protobuf/Duration'; - -/** - * Configuration defining a jittered exponential back off strategy. - */ -export interface BackoffStrategy { - /** - * The base interval to be used for the next back off computation. It should - * be greater than zero and less than or equal to :ref:`max_interval - * `. - */ - 'base_interval'?: (_google_protobuf_Duration | null); - /** - * Specifies the maximum interval between retries. This parameter is optional, - * but must be greater than or equal to the :ref:`base_interval - * ` if set. The default - * is 10 times the :ref:`base_interval - * `. - */ - 'max_interval'?: (_google_protobuf_Duration | null); -} - -/** - * Configuration defining a jittered exponential back off strategy. - */ -export interface BackoffStrategy__Output { - /** - * The base interval to be used for the next back off computation. It should - * be greater than zero and less than or equal to :ref:`max_interval - * `. - */ - 'base_interval': (_google_protobuf_Duration__Output | null); - /** - * Specifies the maximum interval between retries. This parameter is optional, - * but must be greater than or equal to the :ref:`base_interval - * ` if set. The default - * is 10 times the :ref:`base_interval - * `. - */ - 'max_interval': (_google_protobuf_Duration__Output | null); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/BindConfig.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/BindConfig.ts deleted file mode 100644 index d4765c1ba..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/BindConfig.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/address.proto - -import type { SocketAddress as _envoy_api_v2_core_SocketAddress, SocketAddress__Output as _envoy_api_v2_core_SocketAddress__Output } from '../../../../envoy/api/v2/core/SocketAddress'; -import type { BoolValue as _google_protobuf_BoolValue, BoolValue__Output as _google_protobuf_BoolValue__Output } from '../../../../google/protobuf/BoolValue'; -import type { SocketOption as _envoy_api_v2_core_SocketOption, SocketOption__Output as _envoy_api_v2_core_SocketOption__Output } from '../../../../envoy/api/v2/core/SocketOption'; - -export interface BindConfig { - /** - * The address to bind to when creating a socket. - */ - 'source_address'?: (_envoy_api_v2_core_SocketAddress | null); - /** - * Whether to set the *IP_FREEBIND* option when creating the socket. When this - * flag is set to true, allows the :ref:`source_address - * ` to be an IP address - * that is not configured on the system running Envoy. When this flag is set - * to false, the option *IP_FREEBIND* is disabled on the socket. When this - * flag is not set (default), the socket is not modified, i.e. the option is - * neither enabled nor disabled. - */ - 'freebind'?: (_google_protobuf_BoolValue | null); - /** - * Additional socket options that may not be present in Envoy source code or - * precompiled binaries. - */ - 'socket_options'?: (_envoy_api_v2_core_SocketOption)[]; -} - -export interface BindConfig__Output { - /** - * The address to bind to when creating a socket. - */ - 'source_address': (_envoy_api_v2_core_SocketAddress__Output | null); - /** - * Whether to set the *IP_FREEBIND* option when creating the socket. When this - * flag is set to true, allows the :ref:`source_address - * ` to be an IP address - * that is not configured on the system running Envoy. When this flag is set - * to false, the option *IP_FREEBIND* is disabled on the socket. When this - * flag is not set (default), the socket is not modified, i.e. the option is - * neither enabled nor disabled. - */ - 'freebind': (_google_protobuf_BoolValue__Output | null); - /** - * Additional socket options that may not be present in Envoy source code or - * precompiled binaries. - */ - 'socket_options': (_envoy_api_v2_core_SocketOption__Output)[]; -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/BuildVersion.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/BuildVersion.ts deleted file mode 100644 index a33015d89..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/BuildVersion.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - -import type { SemanticVersion as _envoy_type_SemanticVersion, SemanticVersion__Output as _envoy_type_SemanticVersion__Output } from '../../../../envoy/type/SemanticVersion'; -import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../../google/protobuf/Struct'; - -/** - * BuildVersion combines SemVer version of extension with free-form build information - * (i.e. 'alpha', 'private-build') as a set of strings. - */ -export interface BuildVersion { - /** - * SemVer version of extension. - */ - 'version'?: (_envoy_type_SemanticVersion | null); - /** - * Free-form build information. - * Envoy defines several well known keys in the source/common/version/version.h file - */ - 'metadata'?: (_google_protobuf_Struct | null); -} - -/** - * BuildVersion combines SemVer version of extension with free-form build information - * (i.e. 'alpha', 'private-build') as a set of strings. - */ -export interface BuildVersion__Output { - /** - * SemVer version of extension. - */ - 'version': (_envoy_type_SemanticVersion__Output | null); - /** - * Free-form build information. - * Envoy defines several well known keys in the source/common/version/version.h file - */ - 'metadata': (_google_protobuf_Struct__Output | null); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/CidrRange.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/CidrRange.ts deleted file mode 100644 index 5e1df8a13..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/CidrRange.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/address.proto - -import type { UInt32Value as _google_protobuf_UInt32Value, UInt32Value__Output as _google_protobuf_UInt32Value__Output } from '../../../../google/protobuf/UInt32Value'; - -/** - * CidrRange specifies an IP Address and a prefix length to construct - * the subnet mask for a `CIDR `_ range. - */ -export interface CidrRange { - /** - * IPv4 or IPv6 address, e.g. ``192.0.0.0`` or ``2001:db8::``. - */ - 'address_prefix'?: (string); - /** - * Length of prefix, e.g. 0, 32. Defaults to 0 when unset. - */ - 'prefix_len'?: (_google_protobuf_UInt32Value | null); -} - -/** - * CidrRange specifies an IP Address and a prefix length to construct - * the subnet mask for a `CIDR `_ range. - */ -export interface CidrRange__Output { - /** - * IPv4 or IPv6 address, e.g. ``192.0.0.0`` or ``2001:db8::``. - */ - 'address_prefix': (string); - /** - * Length of prefix, e.g. 0, 32. Defaults to 0 when unset. - */ - 'prefix_len': (_google_protobuf_UInt32Value__Output | null); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/ControlPlane.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/ControlPlane.ts deleted file mode 100644 index 551f693a2..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/ControlPlane.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - - -/** - * Identifies a specific ControlPlane instance that Envoy is connected to. - */ -export interface ControlPlane { - /** - * An opaque control plane identifier that uniquely identifies an instance - * of control plane. This can be used to identify which control plane instance, - * the Envoy is connected to. - */ - 'identifier'?: (string); -} - -/** - * Identifies a specific ControlPlane instance that Envoy is connected to. - */ -export interface ControlPlane__Output { - /** - * An opaque control plane identifier that uniquely identifies an instance - * of control plane. This can be used to identify which control plane instance, - * the Envoy is connected to. - */ - 'identifier': (string); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/DataSource.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/DataSource.ts deleted file mode 100644 index a04100054..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/DataSource.ts +++ /dev/null @@ -1,40 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - - -/** - * Data source consisting of either a file or an inline value. - */ -export interface DataSource { - /** - * Local filesystem data source. - */ - 'filename'?: (string); - /** - * Bytes inlined in the configuration. - */ - 'inline_bytes'?: (Buffer | Uint8Array | string); - /** - * String inlined in the configuration. - */ - 'inline_string'?: (string); - 'specifier'?: "filename"|"inline_bytes"|"inline_string"; -} - -/** - * Data source consisting of either a file or an inline value. - */ -export interface DataSource__Output { - /** - * Local filesystem data source. - */ - 'filename'?: (string); - /** - * Bytes inlined in the configuration. - */ - 'inline_bytes'?: (Buffer); - /** - * String inlined in the configuration. - */ - 'inline_string'?: (string); - 'specifier': "filename"|"inline_bytes"|"inline_string"; -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/Extension.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/Extension.ts deleted file mode 100644 index 67c5e1736..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/Extension.ts +++ /dev/null @@ -1,75 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - -import type { BuildVersion as _envoy_api_v2_core_BuildVersion, BuildVersion__Output as _envoy_api_v2_core_BuildVersion__Output } from '../../../../envoy/api/v2/core/BuildVersion'; - -/** - * Version and identification for an Envoy extension. - * [#next-free-field: 6] - */ -export interface Extension { - /** - * This is the name of the Envoy filter as specified in the Envoy - * configuration, e.g. envoy.filters.http.router, com.acme.widget. - */ - 'name'?: (string); - /** - * Category of the extension. - * Extension category names use reverse DNS notation. For instance "envoy.filters.listener" - * for Envoy's built-in listener filters or "com.acme.filters.http" for HTTP filters from - * acme.com vendor. - * [#comment:TODO(yanavlasov): Link to the doc with existing envoy category names.] - */ - 'category'?: (string); - /** - * [#not-implemented-hide:] Type descriptor of extension configuration proto. - * [#comment:TODO(yanavlasov): Link to the doc with existing configuration protos.] - * [#comment:TODO(yanavlasov): Add tests when PR #9391 lands.] - */ - 'type_descriptor'?: (string); - /** - * The version is a property of the extension and maintained independently - * of other extensions and the Envoy API. - * This field is not set when extension did not provide version information. - */ - 'version'?: (_envoy_api_v2_core_BuildVersion | null); - /** - * Indicates that the extension is present but was disabled via dynamic configuration. - */ - 'disabled'?: (boolean); -} - -/** - * Version and identification for an Envoy extension. - * [#next-free-field: 6] - */ -export interface Extension__Output { - /** - * This is the name of the Envoy filter as specified in the Envoy - * configuration, e.g. envoy.filters.http.router, com.acme.widget. - */ - 'name': (string); - /** - * Category of the extension. - * Extension category names use reverse DNS notation. For instance "envoy.filters.listener" - * for Envoy's built-in listener filters or "com.acme.filters.http" for HTTP filters from - * acme.com vendor. - * [#comment:TODO(yanavlasov): Link to the doc with existing envoy category names.] - */ - 'category': (string); - /** - * [#not-implemented-hide:] Type descriptor of extension configuration proto. - * [#comment:TODO(yanavlasov): Link to the doc with existing configuration protos.] - * [#comment:TODO(yanavlasov): Add tests when PR #9391 lands.] - */ - 'type_descriptor': (string); - /** - * The version is a property of the extension and maintained independently - * of other extensions and the Envoy API. - * This field is not set when extension did not provide version information. - */ - 'version': (_envoy_api_v2_core_BuildVersion__Output | null); - /** - * Indicates that the extension is present but was disabled via dynamic configuration. - */ - 'disabled': (boolean); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/HeaderMap.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/HeaderMap.ts deleted file mode 100644 index e093d4761..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/HeaderMap.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - -import type { HeaderValue as _envoy_api_v2_core_HeaderValue, HeaderValue__Output as _envoy_api_v2_core_HeaderValue__Output } from '../../../../envoy/api/v2/core/HeaderValue'; - -/** - * Wrapper for a set of headers. - */ -export interface HeaderMap { - 'headers'?: (_envoy_api_v2_core_HeaderValue)[]; -} - -/** - * Wrapper for a set of headers. - */ -export interface HeaderMap__Output { - 'headers': (_envoy_api_v2_core_HeaderValue__Output)[]; -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/HeaderValue.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/HeaderValue.ts deleted file mode 100644 index b36605324..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/HeaderValue.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - - -/** - * Header name/value pair. - */ -export interface HeaderValue { - /** - * Header name. - */ - 'key'?: (string); - /** - * Header value. - * - * The same :ref:`format specifier ` as used for - * :ref:`HTTP access logging ` applies here, however - * unknown header values are replaced with the empty string instead of `-`. - */ - 'value'?: (string); -} - -/** - * Header name/value pair. - */ -export interface HeaderValue__Output { - /** - * Header name. - */ - 'key': (string); - /** - * Header value. - * - * The same :ref:`format specifier ` as used for - * :ref:`HTTP access logging ` applies here, however - * unknown header values are replaced with the empty string instead of `-`. - */ - 'value': (string); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/HeaderValueOption.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/HeaderValueOption.ts deleted file mode 100644 index 12421d8f4..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/HeaderValueOption.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - -import type { HeaderValue as _envoy_api_v2_core_HeaderValue, HeaderValue__Output as _envoy_api_v2_core_HeaderValue__Output } from '../../../../envoy/api/v2/core/HeaderValue'; -import type { BoolValue as _google_protobuf_BoolValue, BoolValue__Output as _google_protobuf_BoolValue__Output } from '../../../../google/protobuf/BoolValue'; - -/** - * Header name/value pair plus option to control append behavior. - */ -export interface HeaderValueOption { - /** - * Header name/value pair that this option applies to. - */ - 'header'?: (_envoy_api_v2_core_HeaderValue | null); - /** - * Should the value be appended? If true (default), the value is appended to - * existing values. - */ - 'append'?: (_google_protobuf_BoolValue | null); -} - -/** - * Header name/value pair plus option to control append behavior. - */ -export interface HeaderValueOption__Output { - /** - * Header name/value pair that this option applies to. - */ - 'header': (_envoy_api_v2_core_HeaderValue__Output | null); - /** - * Should the value be appended? If true (default), the value is appended to - * existing values. - */ - 'append': (_google_protobuf_BoolValue__Output | null); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/HttpUri.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/HttpUri.ts deleted file mode 100644 index c206a2454..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/HttpUri.ts +++ /dev/null @@ -1,79 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/http_uri.proto - -import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../../../../google/protobuf/Duration'; - -/** - * Envoy external URI descriptor - */ -export interface HttpUri { - /** - * The HTTP server URI. It should be a full FQDN with protocol, host and path. - * - * Example: - * - * .. code-block:: yaml - * - * uri: https://www.googleapis.com/oauth2/v1/certs - */ - 'uri'?: (string); - /** - * A cluster is created in the Envoy "cluster_manager" config - * section. This field specifies the cluster name. - * - * Example: - * - * .. code-block:: yaml - * - * cluster: jwks_cluster - */ - 'cluster'?: (string); - /** - * Sets the maximum duration in milliseconds that a response can take to arrive upon request. - */ - 'timeout'?: (_google_protobuf_Duration | null); - /** - * Specify how `uri` is to be fetched. Today, this requires an explicit - * cluster, but in the future we may support dynamic cluster creation or - * inline DNS resolution. See `issue - * `_. - */ - 'http_upstream_type'?: "cluster"; -} - -/** - * Envoy external URI descriptor - */ -export interface HttpUri__Output { - /** - * The HTTP server URI. It should be a full FQDN with protocol, host and path. - * - * Example: - * - * .. code-block:: yaml - * - * uri: https://www.googleapis.com/oauth2/v1/certs - */ - 'uri': (string); - /** - * A cluster is created in the Envoy "cluster_manager" config - * section. This field specifies the cluster name. - * - * Example: - * - * .. code-block:: yaml - * - * cluster: jwks_cluster - */ - 'cluster'?: (string); - /** - * Sets the maximum duration in milliseconds that a response can take to arrive upon request. - */ - 'timeout': (_google_protobuf_Duration__Output | null); - /** - * Specify how `uri` is to be fetched. Today, this requires an explicit - * cluster, but in the future we may support dynamic cluster creation or - * inline DNS resolution. See `issue - * `_. - */ - 'http_upstream_type': "cluster"; -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/Locality.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/Locality.ts deleted file mode 100644 index 49fb232a4..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/Locality.ts +++ /dev/null @@ -1,56 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - - -/** - * Identifies location of where either Envoy runs or where upstream hosts run. - */ -export interface Locality { - /** - * Region this :ref:`zone ` belongs to. - */ - 'region'?: (string); - /** - * Defines the local service zone where Envoy is running. Though optional, it - * should be set if discovery service routing is used and the discovery - * service exposes :ref:`zone data `, - * either in this message or via :option:`--service-zone`. The meaning of zone - * is context dependent, e.g. `Availability Zone (AZ) - * `_ - * on AWS, `Zone `_ on - * GCP, etc. - */ - 'zone'?: (string); - /** - * When used for locality of upstream hosts, this field further splits zone - * into smaller chunks of sub-zones so they can be load balanced - * independently. - */ - 'sub_zone'?: (string); -} - -/** - * Identifies location of where either Envoy runs or where upstream hosts run. - */ -export interface Locality__Output { - /** - * Region this :ref:`zone ` belongs to. - */ - 'region': (string); - /** - * Defines the local service zone where Envoy is running. Though optional, it - * should be set if discovery service routing is used and the discovery - * service exposes :ref:`zone data `, - * either in this message or via :option:`--service-zone`. The meaning of zone - * is context dependent, e.g. `Availability Zone (AZ) - * `_ - * on AWS, `Zone `_ on - * GCP, etc. - */ - 'zone': (string); - /** - * When used for locality of upstream hosts, this field further splits zone - * into smaller chunks of sub-zones so they can be load balanced - * independently. - */ - 'sub_zone': (string); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/Metadata.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/Metadata.ts deleted file mode 100644 index 7a6871eeb..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/Metadata.ts +++ /dev/null @@ -1,67 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - -import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../../google/protobuf/Struct'; - -/** - * Metadata provides additional inputs to filters based on matched listeners, - * filter chains, routes and endpoints. It is structured as a map, usually from - * filter name (in reverse DNS format) to metadata specific to the filter. Metadata - * key-values for a filter are merged as connection and request handling occurs, - * with later values for the same key overriding earlier values. - * - * An example use of metadata is providing additional values to - * http_connection_manager in the envoy.http_connection_manager.access_log - * namespace. - * - * Another example use of metadata is to per service config info in cluster metadata, which may get - * consumed by multiple filters. - * - * For load balancing, Metadata provides a means to subset cluster endpoints. - * Endpoints have a Metadata object associated and routes contain a Metadata - * object to match against. There are some well defined metadata used today for - * this purpose: - * - * * ``{"envoy.lb": {"canary": }}`` This indicates the canary status of an - * endpoint and is also used during header processing - * (x-envoy-upstream-canary) and for stats purposes. - * [#next-major-version: move to type/metadata/v2] - */ -export interface Metadata { - /** - * Key is the reverse DNS filter name, e.g. com.acme.widget. The envoy.* - * namespace is reserved for Envoy's built-in filters. - */ - 'filter_metadata'?: ({[key: string]: _google_protobuf_Struct}); -} - -/** - * Metadata provides additional inputs to filters based on matched listeners, - * filter chains, routes and endpoints. It is structured as a map, usually from - * filter name (in reverse DNS format) to metadata specific to the filter. Metadata - * key-values for a filter are merged as connection and request handling occurs, - * with later values for the same key overriding earlier values. - * - * An example use of metadata is providing additional values to - * http_connection_manager in the envoy.http_connection_manager.access_log - * namespace. - * - * Another example use of metadata is to per service config info in cluster metadata, which may get - * consumed by multiple filters. - * - * For load balancing, Metadata provides a means to subset cluster endpoints. - * Endpoints have a Metadata object associated and routes contain a Metadata - * object to match against. There are some well defined metadata used today for - * this purpose: - * - * * ``{"envoy.lb": {"canary": }}`` This indicates the canary status of an - * endpoint and is also used during header processing - * (x-envoy-upstream-canary) and for stats purposes. - * [#next-major-version: move to type/metadata/v2] - */ -export interface Metadata__Output { - /** - * Key is the reverse DNS filter name, e.g. com.acme.widget. The envoy.* - * namespace is reserved for Envoy's built-in filters. - */ - 'filter_metadata': ({[key: string]: _google_protobuf_Struct__Output}); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/Node.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/Node.ts deleted file mode 100644 index ddf10f08b..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/Node.ts +++ /dev/null @@ -1,173 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - -import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../../google/protobuf/Struct'; -import type { Locality as _envoy_api_v2_core_Locality, Locality__Output as _envoy_api_v2_core_Locality__Output } from '../../../../envoy/api/v2/core/Locality'; -import type { BuildVersion as _envoy_api_v2_core_BuildVersion, BuildVersion__Output as _envoy_api_v2_core_BuildVersion__Output } from '../../../../envoy/api/v2/core/BuildVersion'; -import type { Extension as _envoy_api_v2_core_Extension, Extension__Output as _envoy_api_v2_core_Extension__Output } from '../../../../envoy/api/v2/core/Extension'; -import type { Address as _envoy_api_v2_core_Address, Address__Output as _envoy_api_v2_core_Address__Output } from '../../../../envoy/api/v2/core/Address'; - -/** - * Identifies a specific Envoy instance. The node identifier is presented to the - * management server, which may use this identifier to distinguish per Envoy - * configuration for serving. - * [#next-free-field: 12] - */ -export interface Node { - /** - * An opaque node identifier for the Envoy node. This also provides the local - * service node name. It should be set if any of the following features are - * used: :ref:`statsd `, :ref:`CDS - * `, and :ref:`HTTP tracing - * `, either in this message or via - * :option:`--service-node`. - */ - 'id'?: (string); - /** - * Defines the local service cluster name where Envoy is running. Though - * optional, it should be set if any of the following features are used: - * :ref:`statsd `, :ref:`health check cluster - * verification - * `, - * :ref:`runtime override directory `, - * :ref:`user agent addition - * `, - * :ref:`HTTP global rate limiting `, - * :ref:`CDS `, and :ref:`HTTP tracing - * `, either in this message or via - * :option:`--service-cluster`. - */ - 'cluster'?: (string); - /** - * Opaque metadata extending the node identifier. Envoy will pass this - * directly to the management server. - */ - 'metadata'?: (_google_protobuf_Struct | null); - /** - * Locality specifying where the Envoy instance is running. - */ - 'locality'?: (_envoy_api_v2_core_Locality | null); - /** - * This is motivated by informing a management server during canary which - * version of Envoy is being tested in a heterogeneous fleet. This will be set - * by Envoy in management server RPCs. - * This field is deprecated in favor of the user_agent_name and user_agent_version values. - */ - 'build_version'?: (string); - /** - * Free-form string that identifies the entity requesting config. - * E.g. "envoy" or "grpc" - */ - 'user_agent_name'?: (string); - /** - * Free-form string that identifies the version of the entity requesting config. - * E.g. "1.12.2" or "abcd1234", or "SpecialEnvoyBuild" - */ - 'user_agent_version'?: (string); - /** - * Structured version of the entity requesting config. - */ - 'user_agent_build_version'?: (_envoy_api_v2_core_BuildVersion | null); - /** - * List of extensions and their versions supported by the node. - */ - 'extensions'?: (_envoy_api_v2_core_Extension)[]; - /** - * Client feature support list. These are well known features described - * in the Envoy API repository for a given major version of an API. Client features - * use reverse DNS naming scheme, for example `com.acme.feature`. - * See :ref:`the list of features ` that xDS client may - * support. - */ - 'client_features'?: (string)[]; - /** - * Known listening ports on the node as a generic hint to the management server - * for filtering :ref:`listeners ` to be returned. For example, - * if there is a listener bound to port 80, the list can optionally contain the - * SocketAddress `(0.0.0.0,80)`. The field is optional and just a hint. - */ - 'listening_addresses'?: (_envoy_api_v2_core_Address)[]; - 'user_agent_version_type'?: "user_agent_version"|"user_agent_build_version"; -} - -/** - * Identifies a specific Envoy instance. The node identifier is presented to the - * management server, which may use this identifier to distinguish per Envoy - * configuration for serving. - * [#next-free-field: 12] - */ -export interface Node__Output { - /** - * An opaque node identifier for the Envoy node. This also provides the local - * service node name. It should be set if any of the following features are - * used: :ref:`statsd `, :ref:`CDS - * `, and :ref:`HTTP tracing - * `, either in this message or via - * :option:`--service-node`. - */ - 'id': (string); - /** - * Defines the local service cluster name where Envoy is running. Though - * optional, it should be set if any of the following features are used: - * :ref:`statsd `, :ref:`health check cluster - * verification - * `, - * :ref:`runtime override directory `, - * :ref:`user agent addition - * `, - * :ref:`HTTP global rate limiting `, - * :ref:`CDS `, and :ref:`HTTP tracing - * `, either in this message or via - * :option:`--service-cluster`. - */ - 'cluster': (string); - /** - * Opaque metadata extending the node identifier. Envoy will pass this - * directly to the management server. - */ - 'metadata': (_google_protobuf_Struct__Output | null); - /** - * Locality specifying where the Envoy instance is running. - */ - 'locality': (_envoy_api_v2_core_Locality__Output | null); - /** - * This is motivated by informing a management server during canary which - * version of Envoy is being tested in a heterogeneous fleet. This will be set - * by Envoy in management server RPCs. - * This field is deprecated in favor of the user_agent_name and user_agent_version values. - */ - 'build_version': (string); - /** - * Free-form string that identifies the entity requesting config. - * E.g. "envoy" or "grpc" - */ - 'user_agent_name': (string); - /** - * Free-form string that identifies the version of the entity requesting config. - * E.g. "1.12.2" or "abcd1234", or "SpecialEnvoyBuild" - */ - 'user_agent_version'?: (string); - /** - * Structured version of the entity requesting config. - */ - 'user_agent_build_version'?: (_envoy_api_v2_core_BuildVersion__Output | null); - /** - * List of extensions and their versions supported by the node. - */ - 'extensions': (_envoy_api_v2_core_Extension__Output)[]; - /** - * Client feature support list. These are well known features described - * in the Envoy API repository for a given major version of an API. Client features - * use reverse DNS naming scheme, for example `com.acme.feature`. - * See :ref:`the list of features ` that xDS client may - * support. - */ - 'client_features': (string)[]; - /** - * Known listening ports on the node as a generic hint to the management server - * for filtering :ref:`listeners ` to be returned. For example, - * if there is a listener bound to port 80, the list can optionally contain the - * SocketAddress `(0.0.0.0,80)`. The field is optional and just a hint. - */ - 'listening_addresses': (_envoy_api_v2_core_Address__Output)[]; - 'user_agent_version_type': "user_agent_version"|"user_agent_build_version"; -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/Pipe.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/Pipe.ts deleted file mode 100644 index 9e6cbb82d..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/Pipe.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/address.proto - - -export interface Pipe { - /** - * Unix Domain Socket path. On Linux, paths starting with '@' will use the - * abstract namespace. The starting '@' is replaced by a null byte by Envoy. - * Paths starting with '@' will result in an error in environments other than - * Linux. - */ - 'path'?: (string); - /** - * The mode for the Pipe. Not applicable for abstract sockets. - */ - 'mode'?: (number); -} - -export interface Pipe__Output { - /** - * Unix Domain Socket path. On Linux, paths starting with '@' will use the - * abstract namespace. The starting '@' is replaced by a null byte by Envoy. - * Paths starting with '@' will result in an error in environments other than - * Linux. - */ - 'path': (string); - /** - * The mode for the Pipe. Not applicable for abstract sockets. - */ - 'mode': (number); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RemoteDataSource.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RemoteDataSource.ts deleted file mode 100644 index 516dbf864..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RemoteDataSource.ts +++ /dev/null @@ -1,40 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - -import type { HttpUri as _envoy_api_v2_core_HttpUri, HttpUri__Output as _envoy_api_v2_core_HttpUri__Output } from '../../../../envoy/api/v2/core/HttpUri'; -import type { RetryPolicy as _envoy_api_v2_core_RetryPolicy, RetryPolicy__Output as _envoy_api_v2_core_RetryPolicy__Output } from '../../../../envoy/api/v2/core/RetryPolicy'; - -/** - * The message specifies how to fetch data from remote and how to verify it. - */ -export interface RemoteDataSource { - /** - * The HTTP URI to fetch the remote data. - */ - 'http_uri'?: (_envoy_api_v2_core_HttpUri | null); - /** - * SHA256 string for verifying data. - */ - 'sha256'?: (string); - /** - * Retry policy for fetching remote data. - */ - 'retry_policy'?: (_envoy_api_v2_core_RetryPolicy | null); -} - -/** - * The message specifies how to fetch data from remote and how to verify it. - */ -export interface RemoteDataSource__Output { - /** - * The HTTP URI to fetch the remote data. - */ - 'http_uri': (_envoy_api_v2_core_HttpUri__Output | null); - /** - * SHA256 string for verifying data. - */ - 'sha256': (string); - /** - * Retry policy for fetching remote data. - */ - 'retry_policy': (_envoy_api_v2_core_RetryPolicy__Output | null); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RequestMethod.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RequestMethod.ts deleted file mode 100644 index 029e9882d..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RequestMethod.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - -/** - * HTTP request method. - */ -export enum RequestMethod { - METHOD_UNSPECIFIED = 0, - GET = 1, - HEAD = 2, - POST = 3, - PUT = 4, - DELETE = 5, - CONNECT = 6, - OPTIONS = 7, - TRACE = 8, - PATCH = 9, -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RetryPolicy.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RetryPolicy.ts deleted file mode 100644 index 7ff35e375..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RetryPolicy.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - -import type { BackoffStrategy as _envoy_api_v2_core_BackoffStrategy, BackoffStrategy__Output as _envoy_api_v2_core_BackoffStrategy__Output } from '../../../../envoy/api/v2/core/BackoffStrategy'; -import type { UInt32Value as _google_protobuf_UInt32Value, UInt32Value__Output as _google_protobuf_UInt32Value__Output } from '../../../../google/protobuf/UInt32Value'; - -/** - * The message specifies the retry policy of remote data source when fetching fails. - */ -export interface RetryPolicy { - /** - * Specifies parameters that control :ref:`retry backoff strategy `. - * This parameter is optional, in which case the default base interval is 1000 milliseconds. The - * default maximum interval is 10 times the base interval. - */ - 'retry_back_off'?: (_envoy_api_v2_core_BackoffStrategy | null); - /** - * Specifies the allowed number of retries. This parameter is optional and - * defaults to 1. - */ - 'num_retries'?: (_google_protobuf_UInt32Value | null); -} - -/** - * The message specifies the retry policy of remote data source when fetching fails. - */ -export interface RetryPolicy__Output { - /** - * Specifies parameters that control :ref:`retry backoff strategy `. - * This parameter is optional, in which case the default base interval is 1000 milliseconds. The - * default maximum interval is 10 times the base interval. - */ - 'retry_back_off': (_envoy_api_v2_core_BackoffStrategy__Output | null); - /** - * Specifies the allowed number of retries. This parameter is optional and - * defaults to 1. - */ - 'num_retries': (_google_protobuf_UInt32Value__Output | null); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RoutingPriority.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RoutingPriority.ts deleted file mode 100644 index 5937fceb2..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RoutingPriority.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - -/** - * Envoy supports :ref:`upstream priority routing - * ` both at the route and the virtual - * cluster level. The current priority implementation uses different connection - * pool and circuit breaking settings for each priority level. This means that - * even for HTTP/2 requests, two physical connections will be used to an - * upstream host. In the future Envoy will likely support true HTTP/2 priority - * over a single upstream connection. - */ -export enum RoutingPriority { - DEFAULT = 0, - HIGH = 1, -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RuntimeDouble.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RuntimeDouble.ts deleted file mode 100644 index 1ea2b8146..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RuntimeDouble.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - - -/** - * Runtime derived double with a default when not specified. - */ -export interface RuntimeDouble { - /** - * Default value if runtime value is not available. - */ - 'default_value'?: (number | string); - /** - * Runtime key to get value for comparison. This value is used if defined. - */ - 'runtime_key'?: (string); -} - -/** - * Runtime derived double with a default when not specified. - */ -export interface RuntimeDouble__Output { - /** - * Default value if runtime value is not available. - */ - 'default_value': (number); - /** - * Runtime key to get value for comparison. This value is used if defined. - */ - 'runtime_key': (string); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RuntimeFeatureFlag.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RuntimeFeatureFlag.ts deleted file mode 100644 index 4ad57de46..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RuntimeFeatureFlag.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - -import type { BoolValue as _google_protobuf_BoolValue, BoolValue__Output as _google_protobuf_BoolValue__Output } from '../../../../google/protobuf/BoolValue'; - -/** - * Runtime derived bool with a default when not specified. - */ -export interface RuntimeFeatureFlag { - /** - * Default value if runtime value is not available. - */ - 'default_value'?: (_google_protobuf_BoolValue | null); - /** - * Runtime key to get value for comparison. This value is used if defined. The boolean value must - * be represented via its - * `canonical JSON encoding `_. - */ - 'runtime_key'?: (string); -} - -/** - * Runtime derived bool with a default when not specified. - */ -export interface RuntimeFeatureFlag__Output { - /** - * Default value if runtime value is not available. - */ - 'default_value': (_google_protobuf_BoolValue__Output | null); - /** - * Runtime key to get value for comparison. This value is used if defined. The boolean value must - * be represented via its - * `canonical JSON encoding `_. - */ - 'runtime_key': (string); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RuntimeFractionalPercent.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RuntimeFractionalPercent.ts deleted file mode 100644 index a168af60c..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RuntimeFractionalPercent.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - -import type { FractionalPercent as _envoy_type_FractionalPercent, FractionalPercent__Output as _envoy_type_FractionalPercent__Output } from '../../../../envoy/type/FractionalPercent'; - -/** - * Runtime derived FractionalPercent with defaults for when the numerator or denominator is not - * specified via a runtime key. - * - * .. note:: - * - * Parsing of the runtime key's data is implemented such that it may be represented as a - * :ref:`FractionalPercent ` proto represented as JSON/YAML - * and may also be represented as an integer with the assumption that the value is an integral - * percentage out of 100. For instance, a runtime key lookup returning the value "42" would parse - * as a `FractionalPercent` whose numerator is 42 and denominator is HUNDRED. - */ -export interface RuntimeFractionalPercent { - /** - * Default value if the runtime value's for the numerator/denominator keys are not available. - */ - 'default_value'?: (_envoy_type_FractionalPercent | null); - /** - * Runtime key for a YAML representation of a FractionalPercent. - */ - 'runtime_key'?: (string); -} - -/** - * Runtime derived FractionalPercent with defaults for when the numerator or denominator is not - * specified via a runtime key. - * - * .. note:: - * - * Parsing of the runtime key's data is implemented such that it may be represented as a - * :ref:`FractionalPercent ` proto represented as JSON/YAML - * and may also be represented as an integer with the assumption that the value is an integral - * percentage out of 100. For instance, a runtime key lookup returning the value "42" would parse - * as a `FractionalPercent` whose numerator is 42 and denominator is HUNDRED. - */ -export interface RuntimeFractionalPercent__Output { - /** - * Default value if the runtime value's for the numerator/denominator keys are not available. - */ - 'default_value': (_envoy_type_FractionalPercent__Output | null); - /** - * Runtime key for a YAML representation of a FractionalPercent. - */ - 'runtime_key': (string); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RuntimeUInt32.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RuntimeUInt32.ts deleted file mode 100644 index 72e8972a4..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/RuntimeUInt32.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - - -/** - * Runtime derived uint32 with a default when not specified. - */ -export interface RuntimeUInt32 { - /** - * Default value if runtime value is not available. - */ - 'default_value'?: (number); - /** - * Runtime key to get value for comparison. This value is used if defined. - */ - 'runtime_key'?: (string); -} - -/** - * Runtime derived uint32 with a default when not specified. - */ -export interface RuntimeUInt32__Output { - /** - * Default value if runtime value is not available. - */ - 'default_value': (number); - /** - * Runtime key to get value for comparison. This value is used if defined. - */ - 'runtime_key': (string); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/SocketAddress.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/SocketAddress.ts deleted file mode 100644 index f81c981c1..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/SocketAddress.ts +++ /dev/null @@ -1,97 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/address.proto - - -// Original file: deps/envoy-api/envoy/api/v2/core/address.proto - -export enum _envoy_api_v2_core_SocketAddress_Protocol { - TCP = 0, - UDP = 1, -} - -/** - * [#next-free-field: 7] - */ -export interface SocketAddress { - 'protocol'?: (_envoy_api_v2_core_SocketAddress_Protocol | keyof typeof _envoy_api_v2_core_SocketAddress_Protocol); - /** - * The address for this socket. :ref:`Listeners ` will bind - * to the address. An empty address is not allowed. Specify ``0.0.0.0`` or ``::`` - * to bind to any address. [#comment:TODO(zuercher) reinstate when implemented: - * It is possible to distinguish a Listener address via the prefix/suffix matching - * in :ref:`FilterChainMatch `.] When used - * within an upstream :ref:`BindConfig `, the address - * controls the source address of outbound connections. For :ref:`clusters - * `, the cluster type determines whether the - * address must be an IP (*STATIC* or *EDS* clusters) or a hostname resolved by DNS - * (*STRICT_DNS* or *LOGICAL_DNS* clusters). Address resolution can be customized - * via :ref:`resolver_name `. - */ - 'address'?: (string); - 'port_value'?: (number); - /** - * This is only valid if :ref:`resolver_name - * ` is specified below and the - * named resolver is capable of named port resolution. - */ - 'named_port'?: (string); - /** - * The name of the custom resolver. This must have been registered with Envoy. If - * this is empty, a context dependent default applies. If the address is a concrete - * IP address, no resolution will occur. If address is a hostname this - * should be set for resolution other than DNS. Specifying a custom resolver with - * *STRICT_DNS* or *LOGICAL_DNS* will generate an error at runtime. - */ - 'resolver_name'?: (string); - /** - * When binding to an IPv6 address above, this enables `IPv4 compatibility - * `_. Binding to ``::`` will - * allow both IPv4 and IPv6 connections, with peer IPv4 addresses mapped into - * IPv6 space as ``::FFFF:``. - */ - 'ipv4_compat'?: (boolean); - 'port_specifier'?: "port_value"|"named_port"; -} - -/** - * [#next-free-field: 7] - */ -export interface SocketAddress__Output { - 'protocol': (keyof typeof _envoy_api_v2_core_SocketAddress_Protocol); - /** - * The address for this socket. :ref:`Listeners ` will bind - * to the address. An empty address is not allowed. Specify ``0.0.0.0`` or ``::`` - * to bind to any address. [#comment:TODO(zuercher) reinstate when implemented: - * It is possible to distinguish a Listener address via the prefix/suffix matching - * in :ref:`FilterChainMatch `.] When used - * within an upstream :ref:`BindConfig `, the address - * controls the source address of outbound connections. For :ref:`clusters - * `, the cluster type determines whether the - * address must be an IP (*STATIC* or *EDS* clusters) or a hostname resolved by DNS - * (*STRICT_DNS* or *LOGICAL_DNS* clusters). Address resolution can be customized - * via :ref:`resolver_name `. - */ - 'address': (string); - 'port_value'?: (number); - /** - * This is only valid if :ref:`resolver_name - * ` is specified below and the - * named resolver is capable of named port resolution. - */ - 'named_port'?: (string); - /** - * The name of the custom resolver. This must have been registered with Envoy. If - * this is empty, a context dependent default applies. If the address is a concrete - * IP address, no resolution will occur. If address is a hostname this - * should be set for resolution other than DNS. Specifying a custom resolver with - * *STRICT_DNS* or *LOGICAL_DNS* will generate an error at runtime. - */ - 'resolver_name': (string); - /** - * When binding to an IPv6 address above, this enables `IPv4 compatibility - * `_. Binding to ``::`` will - * allow both IPv4 and IPv6 connections, with peer IPv4 addresses mapped into - * IPv6 space as ``::FFFF:``. - */ - 'ipv4_compat': (boolean); - 'port_specifier': "port_value"|"named_port"; -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/SocketOption.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/SocketOption.ts deleted file mode 100644 index 4a32e46b4..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/SocketOption.ts +++ /dev/null @@ -1,90 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/socket_option.proto - -import type { Long } from '@grpc/proto-loader'; - -// Original file: deps/envoy-api/envoy/api/v2/core/socket_option.proto - -export enum _envoy_api_v2_core_SocketOption_SocketState { - /** - * Socket options are applied after socket creation but before binding the socket to a port - */ - STATE_PREBIND = 0, - /** - * Socket options are applied after binding the socket to a port but before calling listen() - */ - STATE_BOUND = 1, - /** - * Socket options are applied after calling listen() - */ - STATE_LISTENING = 2, -} - -/** - * Generic socket option message. This would be used to set socket options that - * might not exist in upstream kernels or precompiled Envoy binaries. - * [#next-free-field: 7] - */ -export interface SocketOption { - /** - * An optional name to give this socket option for debugging, etc. - * Uniqueness is not required and no special meaning is assumed. - */ - 'description'?: (string); - /** - * Corresponding to the level value passed to setsockopt, such as IPPROTO_TCP - */ - 'level'?: (number | string | Long); - /** - * The numeric name as passed to setsockopt - */ - 'name'?: (number | string | Long); - /** - * Because many sockopts take an int value. - */ - 'int_value'?: (number | string | Long); - /** - * Otherwise it's a byte buffer. - */ - 'buf_value'?: (Buffer | Uint8Array | string); - /** - * The state in which the option will be applied. When used in BindConfig - * STATE_PREBIND is currently the only valid value. - */ - 'state'?: (_envoy_api_v2_core_SocketOption_SocketState | keyof typeof _envoy_api_v2_core_SocketOption_SocketState); - 'value'?: "int_value"|"buf_value"; -} - -/** - * Generic socket option message. This would be used to set socket options that - * might not exist in upstream kernels or precompiled Envoy binaries. - * [#next-free-field: 7] - */ -export interface SocketOption__Output { - /** - * An optional name to give this socket option for debugging, etc. - * Uniqueness is not required and no special meaning is assumed. - */ - 'description': (string); - /** - * Corresponding to the level value passed to setsockopt, such as IPPROTO_TCP - */ - 'level': (string); - /** - * The numeric name as passed to setsockopt - */ - 'name': (string); - /** - * Because many sockopts take an int value. - */ - 'int_value'?: (string); - /** - * Otherwise it's a byte buffer. - */ - 'buf_value'?: (Buffer); - /** - * The state in which the option will be applied. When used in BindConfig - * STATE_PREBIND is currently the only valid value. - */ - 'state': (keyof typeof _envoy_api_v2_core_SocketOption_SocketState); - 'value': "int_value"|"buf_value"; -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/TcpKeepalive.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/TcpKeepalive.ts deleted file mode 100644 index e9d805c76..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/TcpKeepalive.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/address.proto - -import type { UInt32Value as _google_protobuf_UInt32Value, UInt32Value__Output as _google_protobuf_UInt32Value__Output } from '../../../../google/protobuf/UInt32Value'; - -export interface TcpKeepalive { - /** - * Maximum number of keepalive probes to send without response before deciding - * the connection is dead. Default is to use the OS level configuration (unless - * overridden, Linux defaults to 9.) - */ - 'keepalive_probes'?: (_google_protobuf_UInt32Value | null); - /** - * The number of seconds a connection needs to be idle before keep-alive probes - * start being sent. Default is to use the OS level configuration (unless - * overridden, Linux defaults to 7200s (i.e., 2 hours.) - */ - 'keepalive_time'?: (_google_protobuf_UInt32Value | null); - /** - * The number of seconds between keep-alive probes. Default is to use the OS - * level configuration (unless overridden, Linux defaults to 75s.) - */ - 'keepalive_interval'?: (_google_protobuf_UInt32Value | null); -} - -export interface TcpKeepalive__Output { - /** - * Maximum number of keepalive probes to send without response before deciding - * the connection is dead. Default is to use the OS level configuration (unless - * overridden, Linux defaults to 9.) - */ - 'keepalive_probes': (_google_protobuf_UInt32Value__Output | null); - /** - * The number of seconds a connection needs to be idle before keep-alive probes - * start being sent. Default is to use the OS level configuration (unless - * overridden, Linux defaults to 7200s (i.e., 2 hours.) - */ - 'keepalive_time': (_google_protobuf_UInt32Value__Output | null); - /** - * The number of seconds between keep-alive probes. Default is to use the OS - * level configuration (unless overridden, Linux defaults to 75s.) - */ - 'keepalive_interval': (_google_protobuf_UInt32Value__Output | null); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/TrafficDirection.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/TrafficDirection.ts deleted file mode 100644 index 41cf36523..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/TrafficDirection.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - -/** - * Identifies the direction of the traffic relative to the local Envoy. - */ -export enum TrafficDirection { - /** - * Default option is unspecified. - */ - UNSPECIFIED = 0, - /** - * The transport is used for incoming traffic. - */ - INBOUND = 1, - /** - * The transport is used for outgoing traffic. - */ - OUTBOUND = 2, -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/TransportSocket.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/core/TransportSocket.ts deleted file mode 100644 index 87fbcaf38..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/core/TransportSocket.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/core/base.proto - -import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../../google/protobuf/Struct'; -import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../../google/protobuf/Any'; - -/** - * Configuration for transport socket in :ref:`listeners ` and - * :ref:`clusters `. If the configuration is - * empty, a default transport socket implementation and configuration will be - * chosen based on the platform and existence of tls_context. - */ -export interface TransportSocket { - /** - * The name of the transport socket to instantiate. The name must match a supported transport - * socket implementation. - */ - 'name'?: (string); - 'config'?: (_google_protobuf_Struct | null); - 'typed_config'?: (_google_protobuf_Any | null); - /** - * Implementation specific configuration which depends on the implementation being instantiated. - * See the supported transport socket implementations for further documentation. - */ - 'config_type'?: "config"|"typed_config"; -} - -/** - * Configuration for transport socket in :ref:`listeners ` and - * :ref:`clusters `. If the configuration is - * empty, a default transport socket implementation and configuration will be - * chosen based on the platform and existence of tls_context. - */ -export interface TransportSocket__Output { - /** - * The name of the transport socket to instantiate. The name must match a supported transport - * socket implementation. - */ - 'name': (string); - 'config'?: (_google_protobuf_Struct__Output | null); - 'typed_config'?: (_google_protobuf_Any__Output | null); - /** - * Implementation specific configuration which depends on the implementation being instantiated. - * See the supported transport socket implementations for further documentation. - */ - 'config_type': "config"|"typed_config"; -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/endpoint/ClusterStats.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/endpoint/ClusterStats.ts deleted file mode 100644 index 3609ea1e4..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/endpoint/ClusterStats.ts +++ /dev/null @@ -1,117 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/endpoint/load_report.proto - -import type { UpstreamLocalityStats as _envoy_api_v2_endpoint_UpstreamLocalityStats, UpstreamLocalityStats__Output as _envoy_api_v2_endpoint_UpstreamLocalityStats__Output } from '../../../../envoy/api/v2/endpoint/UpstreamLocalityStats'; -import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../../../../google/protobuf/Duration'; -import type { Long } from '@grpc/proto-loader'; - -export interface _envoy_api_v2_endpoint_ClusterStats_DroppedRequests { - /** - * Identifier for the policy specifying the drop. - */ - 'category'?: (string); - /** - * Total number of deliberately dropped requests for the category. - */ - 'dropped_count'?: (number | string | Long); -} - -export interface _envoy_api_v2_endpoint_ClusterStats_DroppedRequests__Output { - /** - * Identifier for the policy specifying the drop. - */ - 'category': (string); - /** - * Total number of deliberately dropped requests for the category. - */ - 'dropped_count': (string); -} - -/** - * Per cluster load stats. Envoy reports these stats a management server in a - * :ref:`LoadStatsRequest` - * [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. - * Next ID: 7 - * [#next-free-field: 7] - */ -export interface ClusterStats { - /** - * The name of the cluster. - */ - 'cluster_name'?: (string); - /** - * Need at least one. - */ - 'upstream_locality_stats'?: (_envoy_api_v2_endpoint_UpstreamLocalityStats)[]; - /** - * Cluster-level stats such as total_successful_requests may be computed by - * summing upstream_locality_stats. In addition, below there are additional - * cluster-wide stats. - * - * The total number of dropped requests. This covers requests - * deliberately dropped by the drop_overload policy and circuit breaking. - */ - 'total_dropped_requests'?: (number | string | Long); - /** - * Period over which the actual load report occurred. This will be guaranteed to include every - * request reported. Due to system load and delays between the *LoadStatsRequest* sent from Envoy - * and the *LoadStatsResponse* message sent from the management server, this may be longer than - * the requested load reporting interval in the *LoadStatsResponse*. - */ - 'load_report_interval'?: (_google_protobuf_Duration | null); - /** - * Information about deliberately dropped requests for each category specified - * in the DropOverload policy. - */ - 'dropped_requests'?: (_envoy_api_v2_endpoint_ClusterStats_DroppedRequests)[]; - /** - * The eds_cluster_config service_name of the cluster. - * It's possible that two clusters send the same service_name to EDS, - * in that case, the management server is supposed to do aggregation on the load reports. - */ - 'cluster_service_name'?: (string); -} - -/** - * Per cluster load stats. Envoy reports these stats a management server in a - * :ref:`LoadStatsRequest` - * [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. - * Next ID: 7 - * [#next-free-field: 7] - */ -export interface ClusterStats__Output { - /** - * The name of the cluster. - */ - 'cluster_name': (string); - /** - * Need at least one. - */ - 'upstream_locality_stats': (_envoy_api_v2_endpoint_UpstreamLocalityStats__Output)[]; - /** - * Cluster-level stats such as total_successful_requests may be computed by - * summing upstream_locality_stats. In addition, below there are additional - * cluster-wide stats. - * - * The total number of dropped requests. This covers requests - * deliberately dropped by the drop_overload policy and circuit breaking. - */ - 'total_dropped_requests': (string); - /** - * Period over which the actual load report occurred. This will be guaranteed to include every - * request reported. Due to system load and delays between the *LoadStatsRequest* sent from Envoy - * and the *LoadStatsResponse* message sent from the management server, this may be longer than - * the requested load reporting interval in the *LoadStatsResponse*. - */ - 'load_report_interval': (_google_protobuf_Duration__Output | null); - /** - * Information about deliberately dropped requests for each category specified - * in the DropOverload policy. - */ - 'dropped_requests': (_envoy_api_v2_endpoint_ClusterStats_DroppedRequests__Output)[]; - /** - * The eds_cluster_config service_name of the cluster. - * It's possible that two clusters send the same service_name to EDS, - * in that case, the management server is supposed to do aggregation on the load reports. - */ - 'cluster_service_name': (string); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/endpoint/EndpointLoadMetricStats.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/endpoint/EndpointLoadMetricStats.ts deleted file mode 100644 index 335b759b6..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/endpoint/EndpointLoadMetricStats.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/endpoint/load_report.proto - -import type { Long } from '@grpc/proto-loader'; - -/** - * [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. - */ -export interface EndpointLoadMetricStats { - /** - * Name of the metric; may be empty. - */ - 'metric_name'?: (string); - /** - * Number of calls that finished and included this metric. - */ - 'num_requests_finished_with_metric'?: (number | string | Long); - /** - * Sum of metric values across all calls that finished with this metric for - * load_reporting_interval. - */ - 'total_metric_value'?: (number | string); -} - -/** - * [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. - */ -export interface EndpointLoadMetricStats__Output { - /** - * Name of the metric; may be empty. - */ - 'metric_name': (string); - /** - * Number of calls that finished and included this metric. - */ - 'num_requests_finished_with_metric': (string); - /** - * Sum of metric values across all calls that finished with this metric for - * load_reporting_interval. - */ - 'total_metric_value': (number); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/endpoint/UpstreamEndpointStats.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/endpoint/UpstreamEndpointStats.ts deleted file mode 100644 index e4551bd37..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/endpoint/UpstreamEndpointStats.ts +++ /dev/null @@ -1,106 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/endpoint/load_report.proto - -import type { Address as _envoy_api_v2_core_Address, Address__Output as _envoy_api_v2_core_Address__Output } from '../../../../envoy/api/v2/core/Address'; -import type { EndpointLoadMetricStats as _envoy_api_v2_endpoint_EndpointLoadMetricStats, EndpointLoadMetricStats__Output as _envoy_api_v2_endpoint_EndpointLoadMetricStats__Output } from '../../../../envoy/api/v2/endpoint/EndpointLoadMetricStats'; -import type { Struct as _google_protobuf_Struct, Struct__Output as _google_protobuf_Struct__Output } from '../../../../google/protobuf/Struct'; -import type { Long } from '@grpc/proto-loader'; - -/** - * [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. - * [#next-free-field: 8] - */ -export interface UpstreamEndpointStats { - /** - * Upstream host address. - */ - 'address'?: (_envoy_api_v2_core_Address | null); - /** - * The total number of requests successfully completed by the endpoints in the - * locality. These include non-5xx responses for HTTP, where errors - * originate at the client and the endpoint responded successfully. For gRPC, - * the grpc-status values are those not covered by total_error_requests below. - */ - 'total_successful_requests'?: (number | string | Long); - /** - * The total number of unfinished requests for this endpoint. - */ - 'total_requests_in_progress'?: (number | string | Long); - /** - * The total number of requests that failed due to errors at the endpoint. - * For HTTP these are responses with 5xx status codes and for gRPC the - * grpc-status values: - * - * - DeadlineExceeded - * - Unimplemented - * - Internal - * - Unavailable - * - Unknown - * - DataLoss - */ - 'total_error_requests'?: (number | string | Long); - /** - * Stats for multi-dimensional load balancing. - */ - 'load_metric_stats'?: (_envoy_api_v2_endpoint_EndpointLoadMetricStats)[]; - /** - * Opaque and implementation dependent metadata of the - * endpoint. Envoy will pass this directly to the management server. - */ - 'metadata'?: (_google_protobuf_Struct | null); - /** - * The total number of requests that were issued to this endpoint - * since the last report. A single TCP connection, HTTP or gRPC - * request or stream is counted as one request. - */ - 'total_issued_requests'?: (number | string | Long); -} - -/** - * [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. - * [#next-free-field: 8] - */ -export interface UpstreamEndpointStats__Output { - /** - * Upstream host address. - */ - 'address': (_envoy_api_v2_core_Address__Output | null); - /** - * The total number of requests successfully completed by the endpoints in the - * locality. These include non-5xx responses for HTTP, where errors - * originate at the client and the endpoint responded successfully. For gRPC, - * the grpc-status values are those not covered by total_error_requests below. - */ - 'total_successful_requests': (string); - /** - * The total number of unfinished requests for this endpoint. - */ - 'total_requests_in_progress': (string); - /** - * The total number of requests that failed due to errors at the endpoint. - * For HTTP these are responses with 5xx status codes and for gRPC the - * grpc-status values: - * - * - DeadlineExceeded - * - Unimplemented - * - Internal - * - Unavailable - * - Unknown - * - DataLoss - */ - 'total_error_requests': (string); - /** - * Stats for multi-dimensional load balancing. - */ - 'load_metric_stats': (_envoy_api_v2_endpoint_EndpointLoadMetricStats__Output)[]; - /** - * Opaque and implementation dependent metadata of the - * endpoint. Envoy will pass this directly to the management server. - */ - 'metadata': (_google_protobuf_Struct__Output | null); - /** - * The total number of requests that were issued to this endpoint - * since the last report. A single TCP connection, HTTP or gRPC - * request or stream is counted as one request. - */ - 'total_issued_requests': (string); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/api/v2/endpoint/UpstreamLocalityStats.ts b/packages/grpc-js-xds/src/generated/envoy/api/v2/endpoint/UpstreamLocalityStats.ts deleted file mode 100644 index df4d4eb89..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/api/v2/endpoint/UpstreamLocalityStats.ts +++ /dev/null @@ -1,108 +0,0 @@ -// Original file: deps/envoy-api/envoy/api/v2/endpoint/load_report.proto - -import type { Locality as _envoy_api_v2_core_Locality, Locality__Output as _envoy_api_v2_core_Locality__Output } from '../../../../envoy/api/v2/core/Locality'; -import type { EndpointLoadMetricStats as _envoy_api_v2_endpoint_EndpointLoadMetricStats, EndpointLoadMetricStats__Output as _envoy_api_v2_endpoint_EndpointLoadMetricStats__Output } from '../../../../envoy/api/v2/endpoint/EndpointLoadMetricStats'; -import type { UpstreamEndpointStats as _envoy_api_v2_endpoint_UpstreamEndpointStats, UpstreamEndpointStats__Output as _envoy_api_v2_endpoint_UpstreamEndpointStats__Output } from '../../../../envoy/api/v2/endpoint/UpstreamEndpointStats'; -import type { Long } from '@grpc/proto-loader'; - -/** - * These are stats Envoy reports to GLB every so often. Report frequency is - * defined by - * :ref:`LoadStatsResponse.load_reporting_interval`. - * Stats per upstream region/zone and optionally per subzone. - * [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. - * [#next-free-field: 9] - */ -export interface UpstreamLocalityStats { - /** - * Name of zone, region and optionally endpoint group these metrics were - * collected from. Zone and region names could be empty if unknown. - */ - 'locality'?: (_envoy_api_v2_core_Locality | null); - /** - * The total number of requests successfully completed by the endpoints in the - * locality. - */ - 'total_successful_requests'?: (number | string | Long); - /** - * The total number of unfinished requests - */ - 'total_requests_in_progress'?: (number | string | Long); - /** - * The total number of requests that failed due to errors at the endpoint, - * aggregated over all endpoints in the locality. - */ - 'total_error_requests'?: (number | string | Long); - /** - * Stats for multi-dimensional load balancing. - */ - 'load_metric_stats'?: (_envoy_api_v2_endpoint_EndpointLoadMetricStats)[]; - /** - * [#not-implemented-hide:] The priority of the endpoint group these metrics - * were collected from. - */ - 'priority'?: (number); - /** - * Endpoint granularity stats information for this locality. This information - * is populated if the Server requests it by setting - * :ref:`LoadStatsResponse.report_endpoint_granularity`. - */ - 'upstream_endpoint_stats'?: (_envoy_api_v2_endpoint_UpstreamEndpointStats)[]; - /** - * The total number of requests that were issued by this Envoy since - * the last report. This information is aggregated over all the - * upstream endpoints in the locality. - */ - 'total_issued_requests'?: (number | string | Long); -} - -/** - * These are stats Envoy reports to GLB every so often. Report frequency is - * defined by - * :ref:`LoadStatsResponse.load_reporting_interval`. - * Stats per upstream region/zone and optionally per subzone. - * [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. - * [#next-free-field: 9] - */ -export interface UpstreamLocalityStats__Output { - /** - * Name of zone, region and optionally endpoint group these metrics were - * collected from. Zone and region names could be empty if unknown. - */ - 'locality': (_envoy_api_v2_core_Locality__Output | null); - /** - * The total number of requests successfully completed by the endpoints in the - * locality. - */ - 'total_successful_requests': (string); - /** - * The total number of unfinished requests - */ - 'total_requests_in_progress': (string); - /** - * The total number of requests that failed due to errors at the endpoint, - * aggregated over all endpoints in the locality. - */ - 'total_error_requests': (string); - /** - * Stats for multi-dimensional load balancing. - */ - 'load_metric_stats': (_envoy_api_v2_endpoint_EndpointLoadMetricStats__Output)[]; - /** - * [#not-implemented-hide:] The priority of the endpoint group these metrics - * were collected from. - */ - 'priority': (number); - /** - * Endpoint granularity stats information for this locality. This information - * is populated if the Server requests it by setting - * :ref:`LoadStatsResponse.report_endpoint_granularity`. - */ - 'upstream_endpoint_stats': (_envoy_api_v2_endpoint_UpstreamEndpointStats__Output)[]; - /** - * The total number of requests that were issued by this Envoy since - * the last report. This information is aggregated over all the - * upstream endpoints in the locality. - */ - 'total_issued_requests': (string); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/service/discovery/v2/AdsDummy.ts b/packages/grpc-js-xds/src/generated/envoy/service/discovery/v2/AdsDummy.ts deleted file mode 100644 index eeb6aa6af..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/service/discovery/v2/AdsDummy.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Original file: deps/envoy-api/envoy/service/discovery/v2/ads.proto - - -/** - * [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing - * services: https://github.com/google/protobuf/issues/4221 - */ -export interface AdsDummy { -} - -/** - * [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing - * services: https://github.com/google/protobuf/issues/4221 - */ -export interface AdsDummy__Output { -} diff --git a/packages/grpc-js-xds/src/generated/envoy/service/discovery/v2/AggregatedDiscoveryService.ts b/packages/grpc-js-xds/src/generated/envoy/service/discovery/v2/AggregatedDiscoveryService.ts deleted file mode 100644 index 6044118bc..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/service/discovery/v2/AggregatedDiscoveryService.ts +++ /dev/null @@ -1,58 +0,0 @@ -// Original file: deps/envoy-api/envoy/service/discovery/v2/ads.proto - -import type * as grpc from '@grpc/grpc-js' -import type { MethodDefinition } from '@grpc/proto-loader' -import type { DeltaDiscoveryRequest as _envoy_api_v2_DeltaDiscoveryRequest, DeltaDiscoveryRequest__Output as _envoy_api_v2_DeltaDiscoveryRequest__Output } from '../../../../envoy/api/v2/DeltaDiscoveryRequest'; -import type { DeltaDiscoveryResponse as _envoy_api_v2_DeltaDiscoveryResponse, DeltaDiscoveryResponse__Output as _envoy_api_v2_DeltaDiscoveryResponse__Output } from '../../../../envoy/api/v2/DeltaDiscoveryResponse'; -import type { DiscoveryRequest as _envoy_api_v2_DiscoveryRequest, DiscoveryRequest__Output as _envoy_api_v2_DiscoveryRequest__Output } from '../../../../envoy/api/v2/DiscoveryRequest'; -import type { DiscoveryResponse as _envoy_api_v2_DiscoveryResponse, DiscoveryResponse__Output as _envoy_api_v2_DiscoveryResponse__Output } from '../../../../envoy/api/v2/DiscoveryResponse'; - -/** - * See https://github.com/lyft/envoy-api#apis for a description of the role of - * ADS and how it is intended to be used by a management server. ADS requests - * have the same structure as their singleton xDS counterparts, but can - * multiplex many resource types on a single stream. The type_url in the - * DiscoveryRequest/DiscoveryResponse provides sufficient information to recover - * the multiplexed singleton APIs at the Envoy instance and management server. - */ -export interface AggregatedDiscoveryServiceClient extends grpc.Client { - DeltaAggregatedResources(metadata: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_api_v2_DeltaDiscoveryRequest, _envoy_api_v2_DeltaDiscoveryResponse__Output>; - DeltaAggregatedResources(options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_api_v2_DeltaDiscoveryRequest, _envoy_api_v2_DeltaDiscoveryResponse__Output>; - deltaAggregatedResources(metadata: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_api_v2_DeltaDiscoveryRequest, _envoy_api_v2_DeltaDiscoveryResponse__Output>; - deltaAggregatedResources(options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_api_v2_DeltaDiscoveryRequest, _envoy_api_v2_DeltaDiscoveryResponse__Output>; - - /** - * This is a gRPC-only API. - */ - StreamAggregatedResources(metadata: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_api_v2_DiscoveryRequest, _envoy_api_v2_DiscoveryResponse__Output>; - StreamAggregatedResources(options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_api_v2_DiscoveryRequest, _envoy_api_v2_DiscoveryResponse__Output>; - /** - * This is a gRPC-only API. - */ - streamAggregatedResources(metadata: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_api_v2_DiscoveryRequest, _envoy_api_v2_DiscoveryResponse__Output>; - streamAggregatedResources(options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_api_v2_DiscoveryRequest, _envoy_api_v2_DiscoveryResponse__Output>; - -} - -/** - * See https://github.com/lyft/envoy-api#apis for a description of the role of - * ADS and how it is intended to be used by a management server. ADS requests - * have the same structure as their singleton xDS counterparts, but can - * multiplex many resource types on a single stream. The type_url in the - * DiscoveryRequest/DiscoveryResponse provides sufficient information to recover - * the multiplexed singleton APIs at the Envoy instance and management server. - */ -export interface AggregatedDiscoveryServiceHandlers extends grpc.UntypedServiceImplementation { - DeltaAggregatedResources: grpc.handleBidiStreamingCall<_envoy_api_v2_DeltaDiscoveryRequest__Output, _envoy_api_v2_DeltaDiscoveryResponse>; - - /** - * This is a gRPC-only API. - */ - StreamAggregatedResources: grpc.handleBidiStreamingCall<_envoy_api_v2_DiscoveryRequest__Output, _envoy_api_v2_DiscoveryResponse>; - -} - -export interface AggregatedDiscoveryServiceDefinition extends grpc.ServiceDefinition { - DeltaAggregatedResources: MethodDefinition<_envoy_api_v2_DeltaDiscoveryRequest, _envoy_api_v2_DeltaDiscoveryResponse, _envoy_api_v2_DeltaDiscoveryRequest__Output, _envoy_api_v2_DeltaDiscoveryResponse__Output> - StreamAggregatedResources: MethodDefinition<_envoy_api_v2_DiscoveryRequest, _envoy_api_v2_DiscoveryResponse, _envoy_api_v2_DiscoveryRequest__Output, _envoy_api_v2_DiscoveryResponse__Output> -} diff --git a/packages/grpc-js-xds/src/generated/envoy/service/load_stats/v2/LoadReportingService.ts b/packages/grpc-js-xds/src/generated/envoy/service/load_stats/v2/LoadReportingService.ts deleted file mode 100644 index 2a95752de..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/service/load_stats/v2/LoadReportingService.ts +++ /dev/null @@ -1,113 +0,0 @@ -// Original file: deps/envoy-api/envoy/service/load_stats/v2/lrs.proto - -import type * as grpc from '@grpc/grpc-js' -import type { MethodDefinition } from '@grpc/proto-loader' -import type { LoadStatsRequest as _envoy_service_load_stats_v2_LoadStatsRequest, LoadStatsRequest__Output as _envoy_service_load_stats_v2_LoadStatsRequest__Output } from '../../../../envoy/service/load_stats/v2/LoadStatsRequest'; -import type { LoadStatsResponse as _envoy_service_load_stats_v2_LoadStatsResponse, LoadStatsResponse__Output as _envoy_service_load_stats_v2_LoadStatsResponse__Output } from '../../../../envoy/service/load_stats/v2/LoadStatsResponse'; - -export interface LoadReportingServiceClient extends grpc.Client { - /** - * Advanced API to allow for multi-dimensional load balancing by remote - * server. For receiving LB assignments, the steps are: - * 1, The management server is configured with per cluster/zone/load metric - * capacity configuration. The capacity configuration definition is - * outside of the scope of this document. - * 2. Envoy issues a standard {Stream,Fetch}Endpoints request for the clusters - * to balance. - * - * Independently, Envoy will initiate a StreamLoadStats bidi stream with a - * management server: - * 1. Once a connection establishes, the management server publishes a - * LoadStatsResponse for all clusters it is interested in learning load - * stats about. - * 2. For each cluster, Envoy load balances incoming traffic to upstream hosts - * based on per-zone weights and/or per-instance weights (if specified) - * based on intra-zone LbPolicy. This information comes from the above - * {Stream,Fetch}Endpoints. - * 3. When upstream hosts reply, they optionally add header with ASCII representation of EndpointLoadMetricStats. - * 4. Envoy aggregates load reports over the period of time given to it in - * LoadStatsResponse.load_reporting_interval. This includes aggregation - * stats Envoy maintains by itself (total_requests, rpc_errors etc.) as - * well as load metrics from upstream hosts. - * 5. When the timer of load_reporting_interval expires, Envoy sends new - * LoadStatsRequest filled with load reports for each cluster. - * 6. The management server uses the load reports from all reported Envoys - * from around the world, computes global assignment and prepares traffic - * assignment destined for each zone Envoys are located in. Goto 2. - */ - StreamLoadStats(metadata: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_service_load_stats_v2_LoadStatsRequest, _envoy_service_load_stats_v2_LoadStatsResponse__Output>; - StreamLoadStats(options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_service_load_stats_v2_LoadStatsRequest, _envoy_service_load_stats_v2_LoadStatsResponse__Output>; - /** - * Advanced API to allow for multi-dimensional load balancing by remote - * server. For receiving LB assignments, the steps are: - * 1, The management server is configured with per cluster/zone/load metric - * capacity configuration. The capacity configuration definition is - * outside of the scope of this document. - * 2. Envoy issues a standard {Stream,Fetch}Endpoints request for the clusters - * to balance. - * - * Independently, Envoy will initiate a StreamLoadStats bidi stream with a - * management server: - * 1. Once a connection establishes, the management server publishes a - * LoadStatsResponse for all clusters it is interested in learning load - * stats about. - * 2. For each cluster, Envoy load balances incoming traffic to upstream hosts - * based on per-zone weights and/or per-instance weights (if specified) - * based on intra-zone LbPolicy. This information comes from the above - * {Stream,Fetch}Endpoints. - * 3. When upstream hosts reply, they optionally add header with ASCII representation of EndpointLoadMetricStats. - * 4. Envoy aggregates load reports over the period of time given to it in - * LoadStatsResponse.load_reporting_interval. This includes aggregation - * stats Envoy maintains by itself (total_requests, rpc_errors etc.) as - * well as load metrics from upstream hosts. - * 5. When the timer of load_reporting_interval expires, Envoy sends new - * LoadStatsRequest filled with load reports for each cluster. - * 6. The management server uses the load reports from all reported Envoys - * from around the world, computes global assignment and prepares traffic - * assignment destined for each zone Envoys are located in. Goto 2. - */ - streamLoadStats(metadata: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_service_load_stats_v2_LoadStatsRequest, _envoy_service_load_stats_v2_LoadStatsResponse__Output>; - streamLoadStats(options?: grpc.CallOptions): grpc.ClientDuplexStream<_envoy_service_load_stats_v2_LoadStatsRequest, _envoy_service_load_stats_v2_LoadStatsResponse__Output>; - -} - -export interface LoadReportingServiceHandlers extends grpc.UntypedServiceImplementation { - /** - * Advanced API to allow for multi-dimensional load balancing by remote - * server. For receiving LB assignments, the steps are: - * 1, The management server is configured with per cluster/zone/load metric - * capacity configuration. The capacity configuration definition is - * outside of the scope of this document. - * 2. Envoy issues a standard {Stream,Fetch}Endpoints request for the clusters - * to balance. - * - * Independently, Envoy will initiate a StreamLoadStats bidi stream with a - * management server: - * 1. Once a connection establishes, the management server publishes a - * LoadStatsResponse for all clusters it is interested in learning load - * stats about. - * 2. For each cluster, Envoy load balances incoming traffic to upstream hosts - * based on per-zone weights and/or per-instance weights (if specified) - * based on intra-zone LbPolicy. This information comes from the above - * {Stream,Fetch}Endpoints. - * 3. When upstream hosts reply, they optionally add header with ASCII representation of EndpointLoadMetricStats. - * 4. Envoy aggregates load reports over the period of time given to it in - * LoadStatsResponse.load_reporting_interval. This includes aggregation - * stats Envoy maintains by itself (total_requests, rpc_errors etc.) as - * well as load metrics from upstream hosts. - * 5. When the timer of load_reporting_interval expires, Envoy sends new - * LoadStatsRequest filled with load reports for each cluster. - * 6. The management server uses the load reports from all reported Envoys - * from around the world, computes global assignment and prepares traffic - * assignment destined for each zone Envoys are located in. Goto 2. - */ - StreamLoadStats: grpc.handleBidiStreamingCall<_envoy_service_load_stats_v2_LoadStatsRequest__Output, _envoy_service_load_stats_v2_LoadStatsResponse>; - -} - -export interface LoadReportingServiceDefinition extends grpc.ServiceDefinition { - StreamLoadStats: MethodDefinition<_envoy_service_load_stats_v2_LoadStatsRequest, _envoy_service_load_stats_v2_LoadStatsResponse, _envoy_service_load_stats_v2_LoadStatsRequest__Output, _envoy_service_load_stats_v2_LoadStatsResponse__Output> -} diff --git a/packages/grpc-js-xds/src/generated/envoy/service/load_stats/v2/LoadStatsRequest.ts b/packages/grpc-js-xds/src/generated/envoy/service/load_stats/v2/LoadStatsRequest.ts deleted file mode 100644 index 3cd5ebc2f..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/service/load_stats/v2/LoadStatsRequest.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Original file: deps/envoy-api/envoy/service/load_stats/v2/lrs.proto - -import type { Node as _envoy_api_v2_core_Node, Node__Output as _envoy_api_v2_core_Node__Output } from '../../../../envoy/api/v2/core/Node'; -import type { ClusterStats as _envoy_api_v2_endpoint_ClusterStats, ClusterStats__Output as _envoy_api_v2_endpoint_ClusterStats__Output } from '../../../../envoy/api/v2/endpoint/ClusterStats'; - -/** - * A load report Envoy sends to the management server. - * [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. - */ -export interface LoadStatsRequest { - /** - * Node identifier for Envoy instance. - */ - 'node'?: (_envoy_api_v2_core_Node | null); - /** - * A list of load stats to report. - */ - 'cluster_stats'?: (_envoy_api_v2_endpoint_ClusterStats)[]; -} - -/** - * A load report Envoy sends to the management server. - * [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. - */ -export interface LoadStatsRequest__Output { - /** - * Node identifier for Envoy instance. - */ - 'node': (_envoy_api_v2_core_Node__Output | null); - /** - * A list of load stats to report. - */ - 'cluster_stats': (_envoy_api_v2_endpoint_ClusterStats__Output)[]; -} diff --git a/packages/grpc-js-xds/src/generated/envoy/service/load_stats/v2/LoadStatsResponse.ts b/packages/grpc-js-xds/src/generated/envoy/service/load_stats/v2/LoadStatsResponse.ts deleted file mode 100644 index 1065fe22f..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/service/load_stats/v2/LoadStatsResponse.ts +++ /dev/null @@ -1,71 +0,0 @@ -// Original file: deps/envoy-api/envoy/service/load_stats/v2/lrs.proto - -import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../../../../google/protobuf/Duration'; - -/** - * The management server sends envoy a LoadStatsResponse with all clusters it - * is interested in learning load stats about. - * [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. - */ -export interface LoadStatsResponse { - /** - * Clusters to report stats for. - * Not populated if *send_all_clusters* is true. - */ - 'clusters'?: (string)[]; - /** - * The minimum interval of time to collect stats over. This is only a minimum for two reasons: - * 1. There may be some delay from when the timer fires until stats sampling occurs. - * 2. For clusters that were already feature in the previous *LoadStatsResponse*, any traffic - * that is observed in between the corresponding previous *LoadStatsRequest* and this - * *LoadStatsResponse* will also be accumulated and billed to the cluster. This avoids a period - * of inobservability that might otherwise exists between the messages. New clusters are not - * subject to this consideration. - */ - 'load_reporting_interval'?: (_google_protobuf_Duration | null); - /** - * Set to *true* if the management server supports endpoint granularity - * report. - */ - 'report_endpoint_granularity'?: (boolean); - /** - * If true, the client should send all clusters it knows about. - * Only clients that advertise the "envoy.lrs.supports_send_all_clusters" capability in their - * :ref:`client_features` field will honor this field. - */ - 'send_all_clusters'?: (boolean); -} - -/** - * The management server sends envoy a LoadStatsResponse with all clusters it - * is interested in learning load stats about. - * [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. - */ -export interface LoadStatsResponse__Output { - /** - * Clusters to report stats for. - * Not populated if *send_all_clusters* is true. - */ - 'clusters': (string)[]; - /** - * The minimum interval of time to collect stats over. This is only a minimum for two reasons: - * 1. There may be some delay from when the timer fires until stats sampling occurs. - * 2. For clusters that were already feature in the previous *LoadStatsResponse*, any traffic - * that is observed in between the corresponding previous *LoadStatsRequest* and this - * *LoadStatsResponse* will also be accumulated and billed to the cluster. This avoids a period - * of inobservability that might otherwise exists between the messages. New clusters are not - * subject to this consideration. - */ - 'load_reporting_interval': (_google_protobuf_Duration__Output | null); - /** - * Set to *true* if the management server supports endpoint granularity - * report. - */ - 'report_endpoint_granularity': (boolean); - /** - * If true, the client should send all clusters it knows about. - * Only clients that advertise the "envoy.lrs.supports_send_all_clusters" capability in their - * :ref:`client_features` field will honor this field. - */ - 'send_all_clusters': (boolean); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/type/FractionalPercent.ts b/packages/grpc-js-xds/src/generated/envoy/type/FractionalPercent.ts deleted file mode 100644 index e450f0bfa..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/type/FractionalPercent.ts +++ /dev/null @@ -1,68 +0,0 @@ -// Original file: deps/envoy-api/envoy/type/percent.proto - - -// Original file: deps/envoy-api/envoy/type/percent.proto - -/** - * Fraction percentages support several fixed denominator values. - */ -export enum _envoy_type_FractionalPercent_DenominatorType { - /** - * 100. - * - * **Example**: 1/100 = 1%. - */ - HUNDRED = 0, - /** - * 10,000. - * - * **Example**: 1/10000 = 0.01%. - */ - TEN_THOUSAND = 1, - /** - * 1,000,000. - * - * **Example**: 1/1000000 = 0.0001%. - */ - MILLION = 2, -} - -/** - * A fractional percentage is used in cases in which for performance reasons performing floating - * point to integer conversions during randomness calculations is undesirable. The message includes - * both a numerator and denominator that together determine the final fractional value. - * - * * **Example**: 1/100 = 1%. - * * **Example**: 3/10000 = 0.03%. - */ -export interface FractionalPercent { - /** - * Specifies the numerator. Defaults to 0. - */ - 'numerator'?: (number); - /** - * Specifies the denominator. If the denominator specified is less than the numerator, the final - * fractional percentage is capped at 1 (100%). - */ - 'denominator'?: (_envoy_type_FractionalPercent_DenominatorType | keyof typeof _envoy_type_FractionalPercent_DenominatorType); -} - -/** - * A fractional percentage is used in cases in which for performance reasons performing floating - * point to integer conversions during randomness calculations is undesirable. The message includes - * both a numerator and denominator that together determine the final fractional value. - * - * * **Example**: 1/100 = 1%. - * * **Example**: 3/10000 = 0.03%. - */ -export interface FractionalPercent__Output { - /** - * Specifies the numerator. Defaults to 0. - */ - 'numerator': (number); - /** - * Specifies the denominator. If the denominator specified is less than the numerator, the final - * fractional percentage is capped at 1 (100%). - */ - 'denominator': (keyof typeof _envoy_type_FractionalPercent_DenominatorType); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/type/Percent.ts b/packages/grpc-js-xds/src/generated/envoy/type/Percent.ts deleted file mode 100644 index 364419994..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/type/Percent.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Original file: deps/envoy-api/envoy/type/percent.proto - - -/** - * Identifies a percentage, in the range [0.0, 100.0]. - */ -export interface Percent { - 'value'?: (number | string); -} - -/** - * Identifies a percentage, in the range [0.0, 100.0]. - */ -export interface Percent__Output { - 'value': (number); -} diff --git a/packages/grpc-js-xds/src/generated/envoy/type/SemanticVersion.ts b/packages/grpc-js-xds/src/generated/envoy/type/SemanticVersion.ts deleted file mode 100644 index f99431703..000000000 --- a/packages/grpc-js-xds/src/generated/envoy/type/SemanticVersion.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Original file: deps/envoy-api/envoy/type/semantic_version.proto - - -/** - * Envoy uses SemVer (https://semver.org/). Major/minor versions indicate - * expected behaviors and APIs, the patch version field is used only - * for security fixes and can be generally ignored. - */ -export interface SemanticVersion { - 'major_number'?: (number); - 'minor_number'?: (number); - 'patch'?: (number); -} - -/** - * Envoy uses SemVer (https://semver.org/). Major/minor versions indicate - * expected behaviors and APIs, the patch version field is used only - * for security fixes and can be generally ignored. - */ -export interface SemanticVersion__Output { - 'major_number': (number); - 'minor_number': (number); - 'patch': (number); -} diff --git a/packages/grpc-js-xds/src/generated/lrs.ts b/packages/grpc-js-xds/src/generated/lrs.ts index e92f80800..e57d6c249 100644 --- a/packages/grpc-js-xds/src/generated/lrs.ts +++ b/packages/grpc-js-xds/src/generated/lrs.ts @@ -1,7 +1,6 @@ import type * as grpc from '@grpc/grpc-js'; import type { EnumTypeDefinition, MessageTypeDefinition } from '@grpc/proto-loader'; -import type { LoadReportingServiceClient as _envoy_service_load_stats_v2_LoadReportingServiceClient, LoadReportingServiceDefinition as _envoy_service_load_stats_v2_LoadReportingServiceDefinition } from './envoy/service/load_stats/v2/LoadReportingService'; import type { LoadReportingServiceClient as _envoy_service_load_stats_v3_LoadReportingServiceClient, LoadReportingServiceDefinition as _envoy_service_load_stats_v3_LoadReportingServiceDefinition } from './envoy/service/load_stats/v3/LoadReportingService'; type SubtypeConstructor any, Subtype> = { @@ -12,48 +11,6 @@ export interface ProtoGrpcType { envoy: { annotations: { } - api: { - v2: { - core: { - Address: MessageTypeDefinition - AsyncDataSource: MessageTypeDefinition - BackoffStrategy: MessageTypeDefinition - BindConfig: MessageTypeDefinition - BuildVersion: MessageTypeDefinition - CidrRange: MessageTypeDefinition - ControlPlane: MessageTypeDefinition - DataSource: MessageTypeDefinition - Extension: MessageTypeDefinition - HeaderMap: MessageTypeDefinition - HeaderValue: MessageTypeDefinition - HeaderValueOption: MessageTypeDefinition - HttpUri: MessageTypeDefinition - Locality: MessageTypeDefinition - Metadata: MessageTypeDefinition - Node: MessageTypeDefinition - Pipe: MessageTypeDefinition - RemoteDataSource: MessageTypeDefinition - RequestMethod: EnumTypeDefinition - RetryPolicy: MessageTypeDefinition - RoutingPriority: EnumTypeDefinition - RuntimeDouble: MessageTypeDefinition - RuntimeFeatureFlag: MessageTypeDefinition - RuntimeFractionalPercent: MessageTypeDefinition - RuntimeUInt32: MessageTypeDefinition - SocketAddress: MessageTypeDefinition - SocketOption: MessageTypeDefinition - TcpKeepalive: MessageTypeDefinition - TrafficDirection: EnumTypeDefinition - TransportSocket: MessageTypeDefinition - } - endpoint: { - ClusterStats: MessageTypeDefinition - EndpointLoadMetricStats: MessageTypeDefinition - UpstreamEndpointStats: MessageTypeDefinition - UpstreamLocalityStats: MessageTypeDefinition - } - } - } config: { core: { v3: { @@ -104,11 +61,6 @@ export interface ProtoGrpcType { } service: { load_stats: { - v2: { - LoadReportingService: SubtypeConstructor & { service: _envoy_service_load_stats_v2_LoadReportingServiceDefinition } - LoadStatsRequest: MessageTypeDefinition - LoadStatsResponse: MessageTypeDefinition - } v3: { LoadReportingService: SubtypeConstructor & { service: _envoy_service_load_stats_v3_LoadReportingServiceDefinition } LoadStatsRequest: MessageTypeDefinition @@ -117,9 +69,6 @@ export interface ProtoGrpcType { } } type: { - FractionalPercent: MessageTypeDefinition - Percent: MessageTypeDefinition - SemanticVersion: MessageTypeDefinition v3: { FractionalPercent: MessageTypeDefinition Percent: MessageTypeDefinition From 4ac8d6dab36b494cd49bca0a83068b067dd562e0 Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Wed, 12 Oct 2022 13:48:39 -0700 Subject: [PATCH 2/2] grpc-js-xds: Remove all code for handling xDS v2 --- packages/grpc-js-xds/src/csds.ts | 14 +- packages/grpc-js-xds/src/load-balancer-eds.ts | 2 +- packages/grpc-js-xds/src/load-balancer-lrs.ts | 2 +- packages/grpc-js-xds/src/resolver-xds.ts | 28 +- packages/grpc-js-xds/src/resources.ts | 27 +- packages/grpc-js-xds/src/xds-client.ts | 432 +++++------------- .../src/xds-stream-state/lds-state.ts | 13 +- .../src/xds-stream-state/rds-state.ts | 8 +- .../src/xds-stream-state/xds-stream-state.ts | 15 +- 9 files changed, 173 insertions(+), 368 deletions(-) diff --git a/packages/grpc-js-xds/src/csds.ts b/packages/grpc-js-xds/src/csds.ts index 6454e1ad1..114c18042 100644 --- a/packages/grpc-js-xds/src/csds.ts +++ b/packages/grpc-js-xds/src/csds.ts @@ -21,7 +21,7 @@ import { ClientStatusDiscoveryServiceHandlers } from "./generated/envoy/service/ import { ClientStatusRequest__Output } from "./generated/envoy/service/status/v3/ClientStatusRequest"; import { ClientStatusResponse } from "./generated/envoy/service/status/v3/ClientStatusResponse"; import { Timestamp } from "./generated/google/protobuf/Timestamp"; -import { AdsTypeUrl, CDS_TYPE_URL_V2, CDS_TYPE_URL_V3, EDS_TYPE_URL_V2, EDS_TYPE_URL_V3, LDS_TYPE_URL_V2, LDS_TYPE_URL_V3, RDS_TYPE_URL_V2, RDS_TYPE_URL_V3 } from "./resources"; +import { AdsTypeUrl, CDS_TYPE_URL, EDS_TYPE_URL, LDS_TYPE_URL, RDS_TYPE_URL } from "./resources"; import { HandleResponseResult } from "./xds-stream-state/xds-stream-state"; import { sendUnaryData, ServerDuplexStream, ServerUnaryCall, status, experimental, loadPackageDefinition, logVerbosity } from '@grpc/grpc-js'; import { loadSync } from "@grpc/proto-loader"; @@ -50,14 +50,10 @@ function dateToProtoTimestamp(date?: Date | null): Timestamp | null { let clientNode: Node | null = null; const configStatus = { - [EDS_TYPE_URL_V2]: new Map(), - [EDS_TYPE_URL_V3]: new Map(), - [CDS_TYPE_URL_V2]: new Map(), - [CDS_TYPE_URL_V3]: new Map(), - [RDS_TYPE_URL_V2]: new Map(), - [RDS_TYPE_URL_V3]: new Map(), - [LDS_TYPE_URL_V2]: new Map(), - [LDS_TYPE_URL_V3]: new Map() + [EDS_TYPE_URL]: new Map(), + [CDS_TYPE_URL]: new Map(), + [RDS_TYPE_URL]: new Map(), + [LDS_TYPE_URL]: new Map() }; /** diff --git a/packages/grpc-js-xds/src/load-balancer-eds.ts b/packages/grpc-js-xds/src/load-balancer-eds.ts index e7aac0571..6bec1fd19 100644 --- a/packages/grpc-js-xds/src/load-balancer-eds.ts +++ b/packages/grpc-js-xds/src/load-balancer-eds.ts @@ -18,7 +18,7 @@ import { connectivityState as ConnectivityState, status as Status, Metadata, logVerbosity as LogVerbosity, experimental, StatusObject } from '@grpc/grpc-js'; import { getSingletonXdsClient, XdsClient, XdsClusterDropStats } from './xds-client'; import { ClusterLoadAssignment__Output } from './generated/envoy/config/endpoint/v3/ClusterLoadAssignment'; -import { Locality__Output } from './generated/envoy/api/v2/core/Locality'; +import { Locality__Output } from './generated/envoy/config/core/v3/Locality'; import { LocalitySubchannelAddress, PriorityChild, PriorityLoadBalancingConfig } from './load-balancer-priority'; import LoadBalancer = experimental.LoadBalancer; import ChannelControlHelper = experimental.ChannelControlHelper; diff --git a/packages/grpc-js-xds/src/load-balancer-lrs.ts b/packages/grpc-js-xds/src/load-balancer-lrs.ts index 145501fe9..27c62c19b 100644 --- a/packages/grpc-js-xds/src/load-balancer-lrs.ts +++ b/packages/grpc-js-xds/src/load-balancer-lrs.ts @@ -16,7 +16,7 @@ */ import { connectivityState as ConnectivityState, StatusObject, status as Status, experimental } from '@grpc/grpc-js'; -import { Locality__Output } from './generated/envoy/api/v2/core/Locality'; +import { Locality__Output } from './generated/envoy/config/core/v3/Locality'; import { XdsClusterLocalityStats, XdsClient, getSingletonXdsClient } from './xds-client'; import LoadBalancer = experimental.LoadBalancer; import ChannelControlHelper = experimental.ChannelControlHelper; diff --git a/packages/grpc-js-xds/src/resolver-xds.ts b/packages/grpc-js-xds/src/resolver-xds.ts index 8c447931d..496c37094 100644 --- a/packages/grpc-js-xds/src/resolver-xds.ts +++ b/packages/grpc-js-xds/src/resolver-xds.ts @@ -40,7 +40,7 @@ import { XdsClusterManagerLoadBalancingConfig } from './load-balancer-xds-cluste import { ExactValueMatcher, FullMatcher, HeaderMatcher, Matcher, PathExactValueMatcher, PathPrefixValueMatcher, PathSafeRegexValueMatcher, PrefixValueMatcher, PresentValueMatcher, RangeValueMatcher, RejectValueMatcher, SafeRegexValueMatcher, SuffixValueMatcher, ValueMatcher } from './matcher'; import { envoyFractionToFraction, Fraction } from "./fraction"; import { RouteAction, SingleClusterRouteAction, WeightedCluster, WeightedClusterRouteAction } from './route-action'; -import { decodeSingleResource, HTTP_CONNECTION_MANGER_TYPE_URL_V3 } from './resources'; +import { decodeSingleResource, HTTP_CONNECTION_MANGER_TYPE_URL } from './resources'; import Duration = experimental.Duration; import { Duration__Output } from './generated/google/protobuf/Duration'; import { createHttpFilter, HttpFilterConfig, parseOverrideFilterConfig, parseTopLevelFilterConfig } from './http-filter'; @@ -212,7 +212,6 @@ class XdsResolver implements Resolver { private latestRouteConfigName: string | null = null; private latestRouteConfig: RouteConfiguration__Output | null = null; - private latestRouteConfigIsV2 = false; private clusterRefcounts = new Map(); @@ -226,15 +225,15 @@ class XdsResolver implements Resolver { private channelOptions: ChannelOptions ) { this.ldsWatcher = { - onValidUpdate: (update: Listener__Output, isV2: boolean) => { - const httpConnectionManager = decodeSingleResource(HTTP_CONNECTION_MANGER_TYPE_URL_V3, update.api_listener!.api_listener!.value); + onValidUpdate: (update: Listener__Output) => { + const httpConnectionManager = decodeSingleResource(HTTP_CONNECTION_MANGER_TYPE_URL, update.api_listener!.api_listener!.value); const defaultTimeout = httpConnectionManager.common_http_protocol_options?.idle_timeout; if (defaultTimeout === null || defaultTimeout === undefined) { this.latestDefaultTimeout = undefined; } else { this.latestDefaultTimeout = protoDurationToDuration(defaultTimeout); } - if (!isV2 && EXPERIMENTAL_FAULT_INJECTION) { + if (EXPERIMENTAL_FAULT_INJECTION) { this.ldsHttpFilterConfigs = []; for (const filter of httpConnectionManager.http_filters) { // typed_config must be set here, or validation would have failed @@ -260,7 +259,7 @@ class XdsResolver implements Resolver { if (this.latestRouteConfigName) { getSingletonXdsClient().removeRouteWatcher(this.latestRouteConfigName, this.rdsWatcher); } - this.handleRouteConfig(httpConnectionManager.route_config!, isV2); + this.handleRouteConfig(httpConnectionManager.route_config!); break; default: // This is prevented by the validation rules @@ -280,8 +279,8 @@ class XdsResolver implements Resolver { } }; this.rdsWatcher = { - onValidUpdate: (update: RouteConfiguration__Output, isV2: boolean) => { - this.handleRouteConfig(update, isV2); + onValidUpdate: (update: RouteConfiguration__Output) => { + this.handleRouteConfig(update); }, onTransientError: (error: StatusObject) => { /* A transient error only needs to bubble up as a failure if we have @@ -311,14 +310,13 @@ class XdsResolver implements Resolver { refCount.refCount -= 1; if (!refCount.inLastConfig && refCount.refCount === 0) { this.clusterRefcounts.delete(clusterName); - this.handleRouteConfig(this.latestRouteConfig!, this.latestRouteConfigIsV2); + this.handleRouteConfig(this.latestRouteConfig!); } } } - private handleRouteConfig(routeConfig: RouteConfiguration__Output, isV2: boolean) { + private handleRouteConfig(routeConfig: RouteConfiguration__Output) { this.latestRouteConfig = routeConfig; - this.latestRouteConfigIsV2 = isV2; /* Select the virtual host using the default authority override if it * exists, and the channel target otherwise. */ const hostDomain = this.channelOptions['grpc.default_authority'] ?? this.target.path; @@ -328,7 +326,7 @@ class XdsResolver implements Resolver { return; } const virtualHostHttpFilterOverrides = new Map(); - if (!isV2 && EXPERIMENTAL_FAULT_INJECTION) { + if (EXPERIMENTAL_FAULT_INJECTION) { for (const [name, filter] of Object.entries(virtualHost.typed_per_filter_config ?? {})) { const parsedConfig = parseOverrideFilterConfig(filter); if (parsedConfig) { @@ -357,7 +355,7 @@ class XdsResolver implements Resolver { timeout = undefined; } const routeHttpFilterOverrides = new Map(); - if (!isV2 && EXPERIMENTAL_FAULT_INJECTION) { + if (EXPERIMENTAL_FAULT_INJECTION) { for (const [name, filter] of Object.entries(route.typed_per_filter_config ?? {})) { const parsedConfig = parseOverrideFilterConfig(filter); if (parsedConfig) { @@ -372,7 +370,7 @@ class XdsResolver implements Resolver { const cluster = route.route!.cluster!; allConfigClusters.add(cluster); const extraFilterFactories: FilterFactory[] = []; - if (!isV2 && EXPERIMENTAL_FAULT_INJECTION) { + if (EXPERIMENTAL_FAULT_INJECTION) { for (const filterConfig of this.ldsHttpFilterConfigs) { if (routeHttpFilterOverrides.has(filterConfig.name)) { const filter = createHttpFilter(filterConfig.config, routeHttpFilterOverrides.get(filterConfig.name)!); @@ -401,7 +399,7 @@ class XdsResolver implements Resolver { allConfigClusters.add(clusterWeight.name); const extraFilterFactories: FilterFactory[] = []; const clusterHttpFilterOverrides = new Map(); - if (!isV2 && EXPERIMENTAL_FAULT_INJECTION) { + if (EXPERIMENTAL_FAULT_INJECTION) { for (const [name, filter] of Object.entries(clusterWeight.typed_per_filter_config ?? {})) { const parsedConfig = parseOverrideFilterConfig(filter); if (parsedConfig) { diff --git a/packages/grpc-js-xds/src/resources.ts b/packages/grpc-js-xds/src/resources.ts index 4a7e22763..0972ce97d 100644 --- a/packages/grpc-js-xds/src/resources.ts +++ b/packages/grpc-js-xds/src/resources.ts @@ -23,29 +23,22 @@ import { Listener__Output } from './generated/envoy/config/listener/v3/Listener' import { RouteConfiguration__Output } from './generated/envoy/config/route/v3/RouteConfiguration'; import { HttpConnectionManager__Output } from './generated/envoy/extensions/filters/network/http_connection_manager/v3/HttpConnectionManager'; -export const EDS_TYPE_URL_V2 = 'type.googleapis.com/envoy.api.v2.ClusterLoadAssignment'; -export const CDS_TYPE_URL_V2 = 'type.googleapis.com/envoy.api.v2.Cluster'; -export const LDS_TYPE_URL_V2 = 'type.googleapis.com/envoy.api.v2.Listener'; -export const RDS_TYPE_URL_V2 = 'type.googleapis.com/envoy.api.v2.RouteConfiguration'; +export const EDS_TYPE_URL = 'type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment'; +export const CDS_TYPE_URL = 'type.googleapis.com/envoy.config.cluster.v3.Cluster'; +export const LDS_TYPE_URL = 'type.googleapis.com/envoy.config.listener.v3.Listener'; +export const RDS_TYPE_URL = 'type.googleapis.com/envoy.config.route.v3.RouteConfiguration'; -export const EDS_TYPE_URL_V3 = 'type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment'; -export const CDS_TYPE_URL_V3 = 'type.googleapis.com/envoy.config.cluster.v3.Cluster'; -export const LDS_TYPE_URL_V3 = 'type.googleapis.com/envoy.config.listener.v3.Listener'; -export const RDS_TYPE_URL_V3 = 'type.googleapis.com/envoy.config.route.v3.RouteConfiguration'; - -export type EdsTypeUrl = 'type.googleapis.com/envoy.api.v2.ClusterLoadAssignment' | 'type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment'; -export type CdsTypeUrl = 'type.googleapis.com/envoy.api.v2.Cluster' | 'type.googleapis.com/envoy.config.cluster.v3.Cluster'; -export type LdsTypeUrl = 'type.googleapis.com/envoy.api.v2.Listener' | 'type.googleapis.com/envoy.config.listener.v3.Listener'; -export type RdsTypeUrl = 'type.googleapis.com/envoy.api.v2.RouteConfiguration' | 'type.googleapis.com/envoy.config.route.v3.RouteConfiguration'; +export type EdsTypeUrl = 'type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment'; +export type CdsTypeUrl = 'type.googleapis.com/envoy.config.cluster.v3.Cluster'; +export type LdsTypeUrl = 'type.googleapis.com/envoy.config.listener.v3.Listener'; +export type RdsTypeUrl = 'type.googleapis.com/envoy.config.route.v3.RouteConfiguration'; export type AdsTypeUrl = EdsTypeUrl | CdsTypeUrl | RdsTypeUrl | LdsTypeUrl; -export const HTTP_CONNECTION_MANGER_TYPE_URL_V2 = - 'type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager'; -export const HTTP_CONNECTION_MANGER_TYPE_URL_V3 = +export const HTTP_CONNECTION_MANGER_TYPE_URL = 'type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager'; -export type HttpConnectionManagerTypeUrl = 'type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager' | 'type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager'; +export type HttpConnectionManagerTypeUrl = 'type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager'; /** * Map type URLs to their corresponding message types diff --git a/packages/grpc-js-xds/src/xds-client.ts b/packages/grpc-js-xds/src/xds-client.ts index 0c8126cbe..439ed80ea 100644 --- a/packages/grpc-js-xds/src/xds-client.ts +++ b/packages/grpc-js-xds/src/xds-client.ts @@ -22,17 +22,12 @@ import { loadPackageDefinition, StatusObject, status, logVerbosity, Metadata, ex import * as adsTypes from './generated/ads'; import * as lrsTypes from './generated/lrs'; import { loadBootstrapInfo } from './xds-bootstrap'; -import { Node as NodeV2 } from './generated/envoy/api/v2/core/Node'; -import { Node as NodeV3 } from './generated/envoy/config/core/v3/Node'; -import { AggregatedDiscoveryServiceClient as AggregatedDiscoveryServiceClientV2 } from './generated/envoy/service/discovery/v2/AggregatedDiscoveryService'; -import { AggregatedDiscoveryServiceClient as AggregatedDiscoveryServiceClientV3 } from './generated/envoy/service/discovery/v3/AggregatedDiscoveryService'; -import { DiscoveryRequest as DiscoveryRequestV2 } from './generated/envoy/api/v2/DiscoveryRequest'; -import { DiscoveryRequest as DiscoveryRequestV3 } from './generated/envoy/service/discovery/v3/DiscoveryRequest'; +import { Node } from './generated/envoy/config/core/v3/Node'; +import { AggregatedDiscoveryServiceClient } from './generated/envoy/service/discovery/v3/AggregatedDiscoveryService'; +import { DiscoveryRequest } from './generated/envoy/service/discovery/v3/DiscoveryRequest'; import { DiscoveryResponse__Output } from './generated/envoy/service/discovery/v3/DiscoveryResponse'; -import { LoadReportingServiceClient as LoadReportingServiceClientV2 } from './generated/envoy/service/load_stats/v2/LoadReportingService'; -import { LoadReportingServiceClient as LoadReportingServiceClientV3 } from './generated/envoy/service/load_stats/v3/LoadReportingService'; -import { LoadStatsRequest as LoadStatsRequestV2 } from './generated/envoy/service/load_stats/v2/LoadStatsRequest'; -import { LoadStatsRequest as LoadStatsRequestV3 } from './generated/envoy/service/load_stats/v3/LoadStatsRequest'; +import { LoadReportingServiceClient } from './generated/envoy/service/load_stats/v3/LoadReportingService'; +import { LoadStatsRequest } from './generated/envoy/service/load_stats/v3/LoadStatsRequest'; import { LoadStatsResponse__Output } from './generated/envoy/service/load_stats/v3/LoadStatsResponse'; import { Locality, Locality__Output } from './generated/envoy/config/core/v3/Locality'; import { Listener__Output } from './generated/envoy/config/listener/v3/Listener'; @@ -50,7 +45,7 @@ import { ClusterLoadAssignment__Output } from './generated/envoy/config/endpoint import { Cluster__Output } from './generated/envoy/config/cluster/v3/Cluster'; import { RouteConfiguration__Output } from './generated/envoy/config/route/v3/RouteConfiguration'; import { Duration } from './generated/google/protobuf/Duration'; -import { AdsOutputType, AdsTypeUrl, CDS_TYPE_URL_V2, CDS_TYPE_URL_V3, decodeSingleResource, EDS_TYPE_URL_V2, EDS_TYPE_URL_V3, LDS_TYPE_URL_V2, LDS_TYPE_URL_V3, RDS_TYPE_URL_V2, RDS_TYPE_URL_V3 } from './resources'; +import { AdsOutputType, AdsTypeUrl, CDS_TYPE_URL, decodeSingleResource, EDS_TYPE_URL, LDS_TYPE_URL, RDS_TYPE_URL } from './resources'; import { setCsdsClientNode, updateCsdsRequestedNameList, updateCsdsResourceResponse } from './csds'; const TRACER_NAME = 'xds_client'; @@ -74,8 +69,6 @@ function loadAdsProtos(): Promise< loadedProtos = protoLoader .load( [ - 'envoy/service/discovery/v2/ads.proto', - 'envoy/service/load_stats/v2/lrs.proto', 'envoy/service/discovery/v3/ads.proto', 'envoy/service/load_stats/v3/lrs.proto', ], @@ -85,6 +78,7 @@ function loadAdsProtos(): Promise< enums: String, defaults: true, oneofs: true, + json: true, includeDirs: [ // Paths are relative to src/build __dirname + '/../../deps/envoy-api/', @@ -234,62 +228,38 @@ interface AdsState { lds: LdsState; } -enum XdsApiVersion { - V2, - V3 -} - function getResponseMessages( targetTypeUrl: T, - allowedTypeUrls: string[], resources: Any__Output[] ): ResourcePair>[] { const result: ResourcePair>[] = []; for (const resource of resources) { - if (allowedTypeUrls.includes(resource.type_url)) { - result.push({ - resource: decodeSingleResource(targetTypeUrl, resource.value), - raw: resource - }); - } else { + if (resource.type_url !== targetTypeUrl) { throw new Error( - `ADS Error: Invalid resource type ${resource.type_url}, expected ${allowedTypeUrls}` + `ADS Error: Invalid resource type ${resource.type_url}, expected ${targetTypeUrl}` ); } + result.push({ + resource: decodeSingleResource(targetTypeUrl, resource.value), + raw: resource + }); } return result; } export class XdsClient { - private apiVersion: XdsApiVersion = XdsApiVersion.V2; - - private adsNodeV2: NodeV2 | null = null; - private adsNodeV3: NodeV3 | null = null; - /* A client initiates connections lazily, so the client we don't use won't - * use significant extra resources. */ - private adsClientV2: AggregatedDiscoveryServiceClientV2 | null = null; - private adsClientV3: AggregatedDiscoveryServiceClientV3 | null = null; - /* TypeScript typing is structural, so we can take advantage of the fact that - * the output structures for the two call types are identical. */ - private adsCallV2: ClientDuplexStream< - DiscoveryRequestV2, - DiscoveryResponse__Output - > | null = null; - private adsCallV3: ClientDuplexStream< - DiscoveryRequestV3, + + private adsNode: Node | null = null; + private adsClient: AggregatedDiscoveryServiceClient | null = null; + private adsCall: ClientDuplexStream< + DiscoveryRequest, DiscoveryResponse__Output > | null = null; - private lrsNodeV2: NodeV2 | null = null; - private lrsNodeV3: NodeV3 | null = null; - private lrsClientV2: LoadReportingServiceClientV2 | null = null; - private lrsClientV3: LoadReportingServiceClientV3 | null = null; - private lrsCallV2: ClientDuplexStream< - LoadStatsRequestV2, - LoadStatsResponse__Output - > | null = null; - private lrsCallV3: ClientDuplexStream< - LoadStatsRequestV3, + private lrsNode: Node | null = null; + private lrsClient: LoadReportingServiceClient | null = null; + private lrsCall: ClientDuplexStream< + LoadStatsRequest, LoadStatsResponse__Output > | null = null; private latestLrsSettings: LoadStatsResponse__Output | null = null; @@ -355,48 +325,24 @@ export class XdsClient { }); return; } - if (bootstrapInfo.xdsServers[0].serverFeatures.indexOf('xds_v3') >= 0) { - this.apiVersion = XdsApiVersion.V3; - } else { - this.apiVersion = XdsApiVersion.V2; - } if (bootstrapInfo.xdsServers[0].serverFeatures.indexOf('ignore_resource_deletion') >= 0) { this.adsState.lds.enableIgnoreResourceDeletion(); this.adsState.cds.enableIgnoreResourceDeletion(); } - const nodeV2: NodeV2 = { - ...bootstrapInfo.node, - build_version: `gRPC Node Pure JS ${clientVersion}`, - user_agent_name: 'gRPC Node Pure JS', - }; - const nodeV3: NodeV3 = { + const userAgentName = 'gRPC Node Pure JS'; + this.adsNode = { ...bootstrapInfo.node, - user_agent_name: 'gRPC Node Pure JS', - }; - this.adsNodeV2 = { - ...nodeV2, - client_features: ['envoy.lb.does_not_support_overprovisioning'], - }; - this.adsNodeV3 = { - ...nodeV3, + user_agent_name: userAgentName, client_features: ['envoy.lb.does_not_support_overprovisioning'], }; - this.lrsNodeV2 = { - ...nodeV2, - client_features: ['envoy.lrs.supports_send_all_clusters'], - }; - this.lrsNodeV3 = { - ...nodeV3, + this.lrsNode = { + ...bootstrapInfo.node, + user_agent_name: userAgentName, client_features: ['envoy.lrs.supports_send_all_clusters'], }; - setCsdsClientNode(this.adsNodeV3); - if (this.apiVersion === XdsApiVersion.V2) { - trace('ADS Node: ' + JSON.stringify(this.adsNodeV2, undefined, 2)); - trace('LRS Node: ' + JSON.stringify(this.lrsNodeV2, undefined, 2)); - } else { - trace('ADS Node: ' + JSON.stringify(this.adsNodeV3, undefined, 2)); - trace('LRS Node: ' + JSON.stringify(this.lrsNodeV3, undefined, 2)); - } + setCsdsClientNode(this.adsNode); + trace('ADS Node: ' + JSON.stringify(this.adsNode, undefined, 2)); + trace('LRS Node: ' + JSON.stringify(this.lrsNode, undefined, 2)); const credentialsConfigs = bootstrapInfo.xdsServers[0].channelCreds; let channelCreds: ChannelCredentials | null = null; for (const config of credentialsConfigs) { @@ -421,24 +367,14 @@ export class XdsClient { const serverUri = bootstrapInfo.xdsServers[0].serverUri trace('Starting xDS client connected to server URI ' + bootstrapInfo.xdsServers[0].serverUri); const channel = new Channel(serverUri, channelCreds, channelArgs); - this.adsClientV2 = new protoDefinitions.envoy.service.discovery.v2.AggregatedDiscoveryService( - serverUri, - channelCreds, - {channelOverride: channel} - ); - this.adsClientV3 = new protoDefinitions.envoy.service.discovery.v3.AggregatedDiscoveryService( + this.adsClient = new protoDefinitions.envoy.service.discovery.v3.AggregatedDiscoveryService( serverUri, channelCreds, {channelOverride: channel} ); this.maybeStartAdsStream(); - this.lrsClientV2 = new protoDefinitions.envoy.service.load_stats.v2.LoadReportingService( - serverUri, - channelCreds, - {channelOverride: channel} - ); - this.lrsClientV3 = new protoDefinitions.envoy.service.load_stats.v3.LoadReportingService( + this.lrsClient = new protoDefinitions.envoy.service.load_stats.v3.LoadReportingService( serverUri, channelCreds, {channelOverride: channel} @@ -463,55 +399,36 @@ export class XdsClient { result: HandleResponseResult; serviceKind: AdsServiceKind; } | null = null; - let isV2: boolean; - switch (message.type_url) { - case EDS_TYPE_URL_V2: - case CDS_TYPE_URL_V2: - case RDS_TYPE_URL_V2: - case LDS_TYPE_URL_V2: - isV2 = true; - break; - default: - isV2 = false; - } try { switch (message.type_url) { - case EDS_TYPE_URL_V2: - case EDS_TYPE_URL_V3: + case EDS_TYPE_URL: handleResponseResult = { result: this.adsState.eds.handleResponses( - getResponseMessages(EDS_TYPE_URL_V3, [EDS_TYPE_URL_V2, EDS_TYPE_URL_V3], message.resources), - isV2 + getResponseMessages(EDS_TYPE_URL, message.resources) ), serviceKind: 'eds' }; break; - case CDS_TYPE_URL_V2: - case CDS_TYPE_URL_V3: + case CDS_TYPE_URL: handleResponseResult = { result: this.adsState.cds.handleResponses( - getResponseMessages(CDS_TYPE_URL_V3, [CDS_TYPE_URL_V2, CDS_TYPE_URL_V3], message.resources), - isV2 + getResponseMessages(CDS_TYPE_URL, message.resources) ), serviceKind: 'cds' }; break; - case RDS_TYPE_URL_V2: - case RDS_TYPE_URL_V3: + case RDS_TYPE_URL: handleResponseResult = { result: this.adsState.rds.handleResponses( - getResponseMessages(RDS_TYPE_URL_V3, [RDS_TYPE_URL_V2, RDS_TYPE_URL_V3], message.resources), - isV2 + getResponseMessages(RDS_TYPE_URL, message.resources) ), serviceKind: 'rds' }; break; - case LDS_TYPE_URL_V2: - case LDS_TYPE_URL_V3: + case LDS_TYPE_URL: handleResponseResult = { result: this.adsState.lds.handleResponses( - getResponseMessages(LDS_TYPE_URL_V3, [LDS_TYPE_URL_V2, LDS_TYPE_URL_V3], message.resources), - isV2 + getResponseMessages(LDS_TYPE_URL, message.resources) ), serviceKind: 'lds' } @@ -548,8 +465,7 @@ export class XdsClient { trace( 'ADS stream ended. code=' + streamStatus.code + ' details= ' + streamStatus.details ); - this.adsCallV2 = null; - this.adsCallV3 = null; + this.adsCall = null; if (streamStatus.code !== status.OK) { this.reportStreamError(streamStatus); } @@ -560,48 +476,6 @@ export class XdsClient { } } - private maybeStartAdsStreamV2(): boolean { - if (this.apiVersion !== XdsApiVersion.V2) { - return false; - } - if (this.adsClientV2 === null) { - return false; - } - if (this.adsCallV2 !== null) { - return false; - } - this.adsCallV2 = this.adsClientV2.StreamAggregatedResources(); - this.adsCallV2.on('data', (message: DiscoveryResponse__Output) => { - this.handleAdsResponse(message); - }); - this.adsCallV2.on('status', (status: StatusObject) => { - this.handleAdsCallStatus(status); - }); - this.adsCallV2.on('error', () => {}); - return true; - } - - private maybeStartAdsStreamV3(): boolean { - if (this.apiVersion !== XdsApiVersion.V3) { - return false; - } - if (this.adsClientV3 === null) { - return false; - } - if (this.adsCallV3 !== null) { - return false; - } - this.adsCallV3 = this.adsClientV3.StreamAggregatedResources(); - this.adsCallV3.on('data', (message: DiscoveryResponse__Output) => { - this.handleAdsResponse(message); - }); - this.adsCallV3.on('status', (status: StatusObject) => { - this.handleAdsCallStatus(status); - }); - this.adsCallV3.on('error', () => {}); - return true; - } - /** * Start the ADS stream if the client exists and there is not already an * existing stream, and there are resources to request. @@ -616,73 +490,55 @@ export class XdsClient { this.adsState.lds.getResourceNames().length === 0) { return; } - let streamStarted: boolean; - if (this.apiVersion === XdsApiVersion.V2) { - streamStarted = this.maybeStartAdsStreamV2(); - } else { - streamStarted = this.maybeStartAdsStreamV3(); + if (this.adsClient === null) { + return; } - if (streamStarted) { - trace('Started ADS stream'); - // Backoff relative to when we start the request - this.adsBackoff.runOnce(); - - const allServiceKinds: AdsServiceKind[] = ['eds', 'cds', 'rds', 'lds']; - for (const service of allServiceKinds) { - const state = this.adsState[service]; - if (state.getResourceNames().length > 0) { - this.updateNames(service); - } + if (this.adsCall !== null) { + return; + } + this.adsCall = this.adsClient.StreamAggregatedResources(); + this.adsCall.on('data', (message: DiscoveryResponse__Output) => { + this.handleAdsResponse(message); + }); + this.adsCall.on('status', (status: StatusObject) => { + this.handleAdsCallStatus(status); + }); + this.adsCall.on('error', () => {}); + trace('Started ADS stream'); + // Backoff relative to when we start the request + this.adsBackoff.runOnce(); + + const allServiceKinds: AdsServiceKind[] = ['eds', 'cds', 'rds', 'lds']; + for (const service of allServiceKinds) { + const state = this.adsState[service]; + if (state.getResourceNames().length > 0) { + this.updateNames(service); } - this.reportAdsStreamStarted(); } + this.reportAdsStreamStarted(); } private maybeSendAdsMessage(typeUrl: string, resourceNames: string[], responseNonce: string, versionInfo: string, errorMessage?: string) { - if (this.apiVersion === XdsApiVersion.V2) { - this.adsCallV2?.write({ - node: this.adsNodeV2!, - type_url: typeUrl, - resource_names: resourceNames, - response_nonce: responseNonce, - version_info: versionInfo, - error_detail: errorMessage ? { message: errorMessage } : undefined - }); - } else { - this.adsCallV3?.write({ - node: this.adsNodeV3!, - type_url: typeUrl, - resource_names: resourceNames, - response_nonce: responseNonce, - version_info: versionInfo, - error_detail: errorMessage ? { message: errorMessage } : undefined - }); - } + this.adsCall?.write({ + node: this.adsNode!, + type_url: typeUrl, + resource_names: resourceNames, + response_nonce: responseNonce, + version_info: versionInfo, + error_detail: errorMessage ? { message: errorMessage } : undefined + }); } private getTypeUrl(serviceKind: AdsServiceKind): AdsTypeUrl { - if (this.apiVersion === XdsApiVersion.V2) { - switch (serviceKind) { - case 'eds': - return EDS_TYPE_URL_V2; - case 'cds': - return CDS_TYPE_URL_V2; - case 'rds': - return RDS_TYPE_URL_V2; - case 'lds': - return LDS_TYPE_URL_V2; - } - } else { - switch (serviceKind) { - case 'eds': - return EDS_TYPE_URL_V3; - case 'cds': - return CDS_TYPE_URL_V3; - case 'rds': - return RDS_TYPE_URL_V3; - case 'lds': - return LDS_TYPE_URL_V3; - } + switch (serviceKind) { + case 'eds': + return EDS_TYPE_URL; + case 'cds': + return CDS_TYPE_URL; + case 'rds': + return RDS_TYPE_URL; + case 'lds': + return LDS_TYPE_URL; } } @@ -708,20 +564,16 @@ export class XdsClient { let versionInfo: string; let serviceKind: AdsServiceKind | null; switch (typeUrl) { - case EDS_TYPE_URL_V2: - case EDS_TYPE_URL_V3: + case EDS_TYPE_URL: serviceKind = 'eds'; break; - case CDS_TYPE_URL_V2: - case CDS_TYPE_URL_V3: + case CDS_TYPE_URL: serviceKind = 'cds'; break; - case RDS_TYPE_URL_V2: - case RDS_TYPE_URL_V3: + case RDS_TYPE_URL: serviceKind = 'rds'; break; - case LDS_TYPE_URL_V2: - case LDS_TYPE_URL_V3: + case LDS_TYPE_URL: serviceKind = 'lds'; break; default: @@ -731,7 +583,7 @@ export class XdsClient { if (serviceKind) { this.adsState[serviceKind].reportStreamError({ code: status.UNAVAILABLE, - details: message + ' Node ID=' + this.adsNodeV3!.id, + details: message + ' Node ID=' + this.adsNode!.id, metadata: new Metadata() }); resourceNames = this.adsState[serviceKind].getResourceNames(); @@ -750,19 +602,15 @@ export class XdsClient { this.adsState.cds.getResourceNames().length === 0 && this.adsState.rds.getResourceNames().length === 0 && this.adsState.lds.getResourceNames().length === 0) { - this.adsCallV2?.end(); - this.adsCallV2 = null; - this.adsCallV3?.end(); - this.adsCallV3 = null; - this.lrsCallV2?.end(); - this.lrsCallV2 = null; - this.lrsCallV3?.end(); - this.lrsCallV3 = null; + this.adsCall?.end(); + this.adsCall = null; + this.lrsCall?.end(); + this.lrsCall = null; return; } this.maybeStartAdsStream(); this.maybeStartLrsStream(); - if (!this.adsCallV2 && !this.adsCallV3) { + if (!this.adsCall) { /* If the stream is not set up yet at this point, shortcut the rest * becuase nothing will actually be sent. This would mainly happen if * the bootstrap file has not been read yet. In that case, the output @@ -776,7 +624,7 @@ export class XdsClient { } private reportStreamError(status: StatusObject) { - status = {...status, details: status.details + ' Node ID=' + this.adsNodeV3!.id}; + status = {...status, details: status.details + ' Node ID=' + this.adsNode!.id}; this.adsState.eds.reportStreamError(status); this.adsState.cds.reportStreamError(status); this.adsState.rds.reportStreamError(status); @@ -823,8 +671,7 @@ export class XdsClient { trace( 'LRS stream ended. code=' + streamStatus.code + ' details= ' + streamStatus.details ); - this.lrsCallV2 = null; - this.lrsCallV3 = null; + this.lrsCall = null; clearInterval(this.statsTimer); /* If the backoff timer is no longer running, we do not need to wait any * more to start the new call. */ @@ -833,41 +680,22 @@ export class XdsClient { } } - private maybeStartLrsStreamV2(): boolean { - if (!this.lrsClientV2) { - return false; - } - if (this.lrsCallV2) { - return false; - } - this.lrsCallV2 = this.lrsClientV2.streamLoadStats(); - this.receivedLrsSettingsForCurrentStream = false; - this.lrsCallV2.on('data', (message: LoadStatsResponse__Output) => { - this.handleLrsResponse(message); - }); - this.lrsCallV2.on('status', (status: StatusObject) => { - this.handleLrsCallStatus(status); - }); - this.lrsCallV2.on('error', () => {}); - return true; - } - private maybeStartLrsStreamV3(): boolean { - if (!this.lrsClientV3) { + if (!this.lrsClient) { return false; } - if (this.lrsCallV3) { + if (this.lrsCall) { return false; } - this.lrsCallV3 = this.lrsClientV3.streamLoadStats(); + this.lrsCall = this.lrsClient.streamLoadStats(); this.receivedLrsSettingsForCurrentStream = false; - this.lrsCallV3.on('data', (message: LoadStatsResponse__Output) => { + this.lrsCall.on('data', (message: LoadStatsResponse__Output) => { this.handleLrsResponse(message); }); - this.lrsCallV3.on('status', (status: StatusObject) => { + this.lrsCall.on('status', (status: StatusObject) => { this.handleLrsCallStatus(status); }); - this.lrsCallV3.on('error', () => {}); + this.lrsCall.on('error', () => {}); return true; } @@ -881,39 +709,37 @@ export class XdsClient { this.adsState.lds.getResourceNames().length === 0) { return; } - - let streamStarted: boolean; - if (this.apiVersion === XdsApiVersion.V2) { - streamStarted = this.maybeStartLrsStreamV2(); - } else { - streamStarted = this.maybeStartLrsStreamV3(); + if (!this.lrsClient) { + return; } - - if (streamStarted) { - trace('Starting LRS stream'); - this.lrsBackoff.runOnce(); - /* Send buffered stats information when starting LRS stream. If there is no - * buffered stats information, it will still send the node field. */ - this.sendStats(); + if (this.lrsCall) { + return; } + this.lrsCall = this.lrsClient.streamLoadStats(); + this.receivedLrsSettingsForCurrentStream = false; + this.lrsCall.on('data', (message: LoadStatsResponse__Output) => { + this.handleLrsResponse(message); + }); + this.lrsCall.on('status', (status: StatusObject) => { + this.handleLrsCallStatus(status); + }); + this.lrsCall.on('error', () => {}); + trace('Starting LRS stream'); + this.lrsBackoff.runOnce(); + /* Send buffered stats information when starting LRS stream. If there is no + * buffered stats information, it will still send the node field. */ + this.sendStats(); } private maybeSendLrsMessage(clusterStats: ClusterStats[]) { - if (this.apiVersion === XdsApiVersion.V2) { - this.lrsCallV2?.write({ - node: this.lrsNodeV2!, - cluster_stats: clusterStats - }); - } else { - this.lrsCallV3?.write({ - node: this.lrsNodeV3!, - cluster_stats: clusterStats - }); - } + this.lrsCall?.write({ + node: this.lrsNode!, + cluster_stats: clusterStats + }); } private sendStats() { - if (this.lrsCallV2 === null && this.lrsCallV3 === null) { + if (this.lrsCall === null) { return; } if (!this.latestLrsSettings) { @@ -1121,14 +947,10 @@ export class XdsClient { } private shutdown(): void { - this.adsCallV2?.cancel(); - this.adsCallV3?.cancel(); - this.adsClientV2?.close(); - this.adsClientV3?.close(); - this.lrsCallV2?.cancel(); - this.lrsCallV3?.cancel(); - this.lrsClientV2?.close(); - this.lrsClientV3?.close(); + this.adsCall?.cancel(); + this.adsClient?.close(); + this.lrsCall?.cancel(); + this.lrsClient?.close(); this.hasShutdown = true; } } diff --git a/packages/grpc-js-xds/src/xds-stream-state/lds-state.ts b/packages/grpc-js-xds/src/xds-stream-state/lds-state.ts index bd5b6423f..c215076db 100644 --- a/packages/grpc-js-xds/src/xds-stream-state/lds-state.ts +++ b/packages/grpc-js-xds/src/xds-stream-state/lds-state.ts @@ -19,7 +19,7 @@ import { experimental, logVerbosity } from "@grpc/grpc-js"; import { Listener__Output } from '../generated/envoy/config/listener/v3/Listener'; import { RdsState } from "./rds-state"; import { BaseXdsStreamState, XdsStreamState } from "./xds-stream-state"; -import { decodeSingleResource, HTTP_CONNECTION_MANGER_TYPE_URL_V2, HTTP_CONNECTION_MANGER_TYPE_URL_V3 } from '../resources'; +import { decodeSingleResource, HTTP_CONNECTION_MANGER_TYPE_URL } from '../resources'; import { getTopLevelFilterUrl, validateTopLevelFilter } from '../http-filter'; import { EXPERIMENTAL_FAULT_INJECTION } from '../environment'; @@ -46,18 +46,17 @@ export class LdsState extends BaseXdsStreamState implements Xd super(updateResourceNames); } - public validateResponse(message: Listener__Output, isV2: boolean): boolean { + public validateResponse(message: Listener__Output): boolean { if ( !( message.api_listener?.api_listener && - (message.api_listener.api_listener.type_url === HTTP_CONNECTION_MANGER_TYPE_URL_V2 || - message.api_listener.api_listener.type_url === HTTP_CONNECTION_MANGER_TYPE_URL_V3) + message.api_listener.api_listener.type_url === HTTP_CONNECTION_MANGER_TYPE_URL ) ) { return false; } - const httpConnectionManager = decodeSingleResource(HTTP_CONNECTION_MANGER_TYPE_URL_V3, message.api_listener!.api_listener.value); - if (!isV2 && EXPERIMENTAL_FAULT_INJECTION) { + const httpConnectionManager = decodeSingleResource(HTTP_CONNECTION_MANGER_TYPE_URL, message.api_listener!.api_listener.value); + if (EXPERIMENTAL_FAULT_INJECTION) { const filterNames = new Set(); for (const [index, httpFilter] of httpConnectionManager.http_filters.entries()) { if (filterNames.has(httpFilter.name)) { @@ -89,7 +88,7 @@ export class LdsState extends BaseXdsStreamState implements Xd case 'rds': return !!httpConnectionManager.rds?.config_source?.ads; case 'route_config': - return this.rdsState.validateResponse(httpConnectionManager.route_config!, isV2); + return this.rdsState.validateResponse(httpConnectionManager.route_config!); } return false; } diff --git a/packages/grpc-js-xds/src/xds-stream-state/rds-state.ts b/packages/grpc-js-xds/src/xds-stream-state/rds-state.ts index a5d3c47cf..119ac6b92 100644 --- a/packages/grpc-js-xds/src/xds-stream-state/rds-state.ts +++ b/packages/grpc-js-xds/src/xds-stream-state/rds-state.ts @@ -40,7 +40,7 @@ export class RdsState extends BaseXdsStreamState imp protected getProtocolName(): string { return 'RDS'; } - validateResponse(message: RouteConfiguration__Output, isV2: boolean): boolean { + validateResponse(message: RouteConfiguration__Output): boolean { // https://github.com/grpc/proposal/blob/master/A28-xds-traffic-splitting-and-routing.md#response-validation for (const virtualHost of message.virtual_hosts) { for (const domainPattern of virtualHost.domains) { @@ -55,7 +55,7 @@ export class RdsState extends BaseXdsStreamState imp return false; } } - if (!isV2 && EXPERIMENTAL_FAULT_INJECTION) { + if (EXPERIMENTAL_FAULT_INJECTION) { for (const filterConfig of Object.values(virtualHost.typed_per_filter_config ?? {})) { if (!validateOverrideFilter(filterConfig)) { return false; @@ -81,7 +81,7 @@ export class RdsState extends BaseXdsStreamState imp if ((route.route === undefined) || (route.route === null) || SUPPORTED_CLUSTER_SPECIFIERS.indexOf(route.route.cluster_specifier) < 0) { return false; } - if (!isV2 && EXPERIMENTAL_FAULT_INJECTION) { + if (EXPERIMENTAL_FAULT_INJECTION) { for (const [name, filterConfig] of Object.entries(route.typed_per_filter_config ?? {})) { if (!validateOverrideFilter(filterConfig)) { return false; @@ -99,7 +99,7 @@ export class RdsState extends BaseXdsStreamState imp if (weightSum !== route.route.weighted_clusters!.total_weight?.value ?? 100) { return false; } - if (!isV2 && EXPERIMENTAL_FAULT_INJECTION) { + if (EXPERIMENTAL_FAULT_INJECTION) { for (const weightedCluster of route.route!.weighted_clusters!.clusters) { for (const filterConfig of Object.values(weightedCluster.typed_per_filter_config ?? {})) { if (!validateOverrideFilter(filterConfig)) { diff --git a/packages/grpc-js-xds/src/xds-stream-state/xds-stream-state.ts b/packages/grpc-js-xds/src/xds-stream-state/xds-stream-state.ts index 7b3bc0189..86c2cea4b 100644 --- a/packages/grpc-js-xds/src/xds-stream-state/xds-stream-state.ts +++ b/packages/grpc-js-xds/src/xds-stream-state/xds-stream-state.ts @@ -26,7 +26,7 @@ export interface Watcher { * message type into a library-specific configuration object type, to * remove a lot of duplicate logic, including logic for handling that * flag. */ - onValidUpdate(update: UpdateType, isV2: boolean): void; + onValidUpdate(update: UpdateType): void; onTransientError(error: StatusObject): void; onResourceDoesNotExist(): void; } @@ -85,7 +85,6 @@ export abstract class BaseXdsStreamState implements XdsStreamState nonce = ''; private subscriptions: Map> = new Map>(); - private latestIsV2 = false; private isAdsStreamRunning = false; private ignoreResourceDeletion = false; @@ -128,7 +127,7 @@ export abstract class BaseXdsStreamState implements XdsStreamState * the same happens here */ process.nextTick(() => { this.trace('Reporting existing update for new watcher for name ' + name); - watcher.onValidUpdate(cachedResponse, this.latestIsV2); + watcher.onValidUpdate(cachedResponse); }); } if (addedName) { @@ -157,7 +156,7 @@ export abstract class BaseXdsStreamState implements XdsStreamState getResourceNames(): string[] { return Array.from(this.subscriptions.keys()); } - handleResponses(responses: ResourcePair[], isV2: boolean): HandleResponseResult { + handleResponses(responses: ResourcePair[]): HandleResponseResult { const validResponses: ResponseType[] = []; let result: HandleResponseResult = { accepted: [], @@ -166,7 +165,7 @@ export abstract class BaseXdsStreamState implements XdsStreamState } for (const {resource, raw} of responses) { const resourceName = this.getResourceName(resource); - if (this.validateResponse(resource, isV2)) { + if (this.validateResponse(resource)) { validResponses.push(resource); result.accepted.push({ name: resourceName, @@ -180,7 +179,6 @@ export abstract class BaseXdsStreamState implements XdsStreamState }); } } - this.latestIsV2 = isV2; const allResourceNames = new Set(); for (const resource of validResponses) { const resourceName = this.getResourceName(resource); @@ -189,7 +187,7 @@ export abstract class BaseXdsStreamState implements XdsStreamState if (subscriptionEntry) { const watchers = subscriptionEntry.watchers; for (const watcher of watchers) { - watcher.onValidUpdate(resource, isV2); + watcher.onValidUpdate(resource); } clearTimeout(subscriptionEntry.resourceTimer); subscriptionEntry.cachedResponse = resource; @@ -259,9 +257,8 @@ export abstract class BaseXdsStreamState implements XdsStreamState * This function is public so that the LDS validateResponse can call into * the RDS validateResponse. * @param resource The resource object sent by the xDS server - * @param isV2 If true, the resource is an xDS V2 resource instead of xDS V3 */ - public abstract validateResponse(resource: ResponseType, isV2: boolean): boolean; + public abstract validateResponse(resource: ResponseType): boolean; /** * Get the name of a resource object. The name is some field of the object, so * getting it depends on the specific type.