// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Traffic Director API Client for Deno * ==================================== * * * * Docs: https://cloud.google.com/traffic-director * Source: https://googleapis.deno.dev/v1/trafficdirector:v3.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; export class TrafficDirector { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://trafficdirector.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } async discoveryClient_status(req: ClientStatusRequest): Promise { const url = new URL(`${this.#baseUrl}v3/discovery:client_status`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeClientStatusResponse(data); } } /** * 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 { /** * Specifies a user-space address handled by :ref:`internal listeners `. */ envoyInternalAddress?: EnvoyInternalAddress; pipe?: Pipe; socketAddress?: SocketAddress; } /** * BuildVersion combines SemVer version of extension with free-form build * information (i.e. 'alpha', 'private-build') as a set of strings. */ export interface BuildVersion { /** * Free-form build information. Envoy defines several well known keys in the * source/common/version/version.h file */ metadata?: { [key: string]: any }; /** * SemVer version of extension. */ version?: SemanticVersion; } /** * All xds configs for a particular client. */ export interface ClientConfig { /** * For xDS clients, the scope in which the data is used. For example, gRPC * indicates the data plane target or that the data is associated with gRPC * server(s). */ clientScope?: string; /** * Represents generic xDS config and the exact config structure depends on * the type URL (like Cluster if it is CDS) */ genericXdsConfigs?: GenericXdsConfig[]; /** * Node for a particular client. */ node?: Node; /** * This field is deprecated in favor of generic_xds_configs which is much * simpler and uniform in structure. */ xdsConfig?: PerXdsConfig[]; } function serializeClientConfig(data: any): ClientConfig { return { ...data, genericXdsConfigs: data["genericXdsConfigs"] !== undefined ? data["genericXdsConfigs"].map((item: any) => (serializeGenericXdsConfig(item))) : undefined, xdsConfig: data["xdsConfig"] !== undefined ? data["xdsConfig"].map((item: any) => (serializePerXdsConfig(item))) : undefined, }; } function deserializeClientConfig(data: any): ClientConfig { return { ...data, genericXdsConfigs: data["genericXdsConfigs"] !== undefined ? data["genericXdsConfigs"].map((item: any) => (deserializeGenericXdsConfig(item))) : undefined, xdsConfig: data["xdsConfig"] !== undefined ? data["xdsConfig"].map((item: any) => (deserializePerXdsConfig(item))) : undefined, }; } /** * Request for client status of clients identified by a list of NodeMatchers. */ export interface ClientStatusRequest { /** * If true, the server will not include the resource contents in the response * (i.e., the generic_xds_configs.xds_config field will not be populated). * [#not-implemented-hide:] */ excludeResourceContents?: boolean; /** * The node making the csds request. */ node?: Node; /** * Management server can use these match criteria to identify clients. The * match follows OR semantics. */ nodeMatchers?: NodeMatcher[]; } export interface ClientStatusResponse { /** * Client configs for the clients specified in the ClientStatusRequest. */ config?: ClientConfig[]; } function serializeClientStatusResponse(data: any): ClientStatusResponse { return { ...data, config: data["config"] !== undefined ? data["config"].map((item: any) => (serializeClientConfig(item))) : undefined, }; } function deserializeClientStatusResponse(data: any): ClientStatusResponse { return { ...data, config: data["config"] !== undefined ? data["config"].map((item: any) => (deserializeClientConfig(item))) : undefined, }; } /** * Envoy's cluster manager fills this message with all currently known * clusters. Cluster configuration information can be used to recreate an Envoy * configuration by populating all clusters as static clusters or by returning * them in a CDS response. */ export interface ClustersConfigDump { /** * The dynamically loaded active clusters. These are clusters that are * available to service data plane traffic. */ dynamicActiveClusters?: DynamicCluster[]; /** * The dynamically loaded warming clusters. These are clusters that are * currently undergoing warming in preparation to service data plane traffic. * Note that if attempting to recreate an Envoy configuration from a * configuration dump, the warming clusters should generally be discarded. */ dynamicWarmingClusters?: DynamicCluster[]; /** * The statically loaded cluster configs. */ staticClusters?: StaticCluster[]; /** * This is the :ref:`version_info ` in the last processed CDS discovery * response. If there are only static bootstrap clusters, this field will be * "". */ versionInfo?: string; } function serializeClustersConfigDump(data: any): ClustersConfigDump { return { ...data, dynamicActiveClusters: data["dynamicActiveClusters"] !== undefined ? data["dynamicActiveClusters"].map((item: any) => (serializeDynamicCluster(item))) : undefined, dynamicWarmingClusters: data["dynamicWarmingClusters"] !== undefined ? data["dynamicWarmingClusters"].map((item: any) => (serializeDynamicCluster(item))) : undefined, staticClusters: data["staticClusters"] !== undefined ? data["staticClusters"].map((item: any) => (serializeStaticCluster(item))) : undefined, }; } function deserializeClustersConfigDump(data: any): ClustersConfigDump { return { ...data, dynamicActiveClusters: data["dynamicActiveClusters"] !== undefined ? data["dynamicActiveClusters"].map((item: any) => (deserializeDynamicCluster(item))) : undefined, dynamicWarmingClusters: data["dynamicWarmingClusters"] !== undefined ? data["dynamicWarmingClusters"].map((item: any) => (deserializeDynamicCluster(item))) : undefined, staticClusters: data["staticClusters"] !== undefined ? data["staticClusters"].map((item: any) => (deserializeStaticCluster(item))) : undefined, }; } /** * Additional parameters that can be used to select resource variants. These * include any global context parameters, per-resource type client feature * capabilities and per-resource type functional attributes. All per-resource * type attributes will be `xds.resource.` prefixed and some of these are * documented below: `xds.resource.listening_address`: The value is "IP:port" * (e.g. "10.1.1.3:8080") which is the listening address of a Listener. Used in * a Listener resource query. */ export interface ContextParams { params?: { [key: string]: string }; } /** * Specifies the way to match a double value. */ export interface DoubleMatcher { /** * If specified, the input double value must be equal to the value specified * here. */ exact?: number; /** * If specified, the input double value must be in the range specified here. * Note: The range is using half-open interval semantics [start, end). */ range?: DoubleRange; } /** * Specifies the double start and end of the range using half-open interval * semantics [start, end). */ export interface DoubleRange { /** * end of the range (exclusive) */ end?: number; /** * start of the range (inclusive) */ start?: number; } /** * Describes a dynamically loaded cluster via the CDS API. [#next-free-field: * 6] */ export interface DynamicCluster { /** * The client status of this resource. [#not-implemented-hide:] */ clientStatus?: | "UNKNOWN" | "REQUESTED" | "DOES_NOT_EXIST" | "ACKED" | "NACKED"; /** * The cluster config. */ cluster?: { [key: string]: any }; /** * Set if the last update failed, cleared after the next successful update. * The ``error_state`` field contains the rejected version of this particular * resource along with the reason and timestamp. For successfully updated or * acknowledged resource, this field should be empty. [#not-implemented-hide:] */ errorState?: UpdateFailureState; /** * The timestamp when the Cluster was last updated. */ lastUpdated?: Date; /** * This is the per-resource version information. This version is currently * taken from the :ref:`version_info ` field at the time that the cluster was * loaded. In the future, discrete per-cluster versions may be supported by * the API. */ versionInfo?: string; } function serializeDynamicCluster(data: any): DynamicCluster { return { ...data, errorState: data["errorState"] !== undefined ? serializeUpdateFailureState(data["errorState"]) : undefined, lastUpdated: data["lastUpdated"] !== undefined ? data["lastUpdated"].toISOString() : undefined, }; } function deserializeDynamicCluster(data: any): DynamicCluster { return { ...data, errorState: data["errorState"] !== undefined ? deserializeUpdateFailureState(data["errorState"]) : undefined, lastUpdated: data["lastUpdated"] !== undefined ? new Date(data["lastUpdated"]) : undefined, }; } /** * [#next-free-field: 6] */ export interface DynamicEndpointConfig { /** * The client status of this resource. [#not-implemented-hide:] */ clientStatus?: | "UNKNOWN" | "REQUESTED" | "DOES_NOT_EXIST" | "ACKED" | "NACKED"; /** * The endpoint config. */ endpointConfig?: { [key: string]: any }; /** * Set if the last update failed, cleared after the next successful update. * The ``error_state`` field contains the rejected version of this particular * resource along with the reason and timestamp. For successfully updated or * acknowledged resource, this field should be empty. [#not-implemented-hide:] */ errorState?: UpdateFailureState; /** * [#not-implemented-hide:] The timestamp when the Endpoint was last updated. */ lastUpdated?: Date; /** * [#not-implemented-hide:] This is the per-resource version information. * This version is currently taken from the :ref:`version_info ` field at the * time that the endpoint configuration was loaded. */ versionInfo?: string; } function serializeDynamicEndpointConfig(data: any): DynamicEndpointConfig { return { ...data, errorState: data["errorState"] !== undefined ? serializeUpdateFailureState(data["errorState"]) : undefined, lastUpdated: data["lastUpdated"] !== undefined ? data["lastUpdated"].toISOString() : undefined, }; } function deserializeDynamicEndpointConfig(data: any): DynamicEndpointConfig { return { ...data, errorState: data["errorState"] !== undefined ? deserializeUpdateFailureState(data["errorState"]) : undefined, lastUpdated: data["lastUpdated"] !== undefined ? new Date(data["lastUpdated"]) : undefined, }; } /** * Describes a dynamically loaded listener via the LDS API. [#next-free-field: * 7] */ export interface DynamicListener { /** * The listener state for any active listener by this name. These are * listeners that are available to service data plane traffic. */ activeState?: DynamicListenerState; /** * The client status of this resource. [#not-implemented-hide:] */ clientStatus?: | "UNKNOWN" | "REQUESTED" | "DOES_NOT_EXIST" | "ACKED" | "NACKED"; /** * The listener state for any draining listener by this name. These are * listeners that are currently undergoing draining in preparation to stop * servicing data plane traffic. Note that if attempting to recreate an Envoy * configuration from a configuration dump, the draining listeners should * generally be discarded. */ drainingState?: DynamicListenerState; /** * Set if the last update failed, cleared after the next successful update. * The ``error_state`` field contains the rejected version of this particular * resource along with the reason and timestamp. For successfully updated or * acknowledged resource, this field should be empty. */ errorState?: UpdateFailureState; /** * The name or unique id of this listener, pulled from the * DynamicListenerState config. */ name?: string; /** * The listener state for any warming listener by this name. These are * listeners that are currently undergoing warming in preparation to service * data plane traffic. Note that if attempting to recreate an Envoy * configuration from a configuration dump, the warming listeners should * generally be discarded. */ warmingState?: DynamicListenerState; } function serializeDynamicListener(data: any): DynamicListener { return { ...data, activeState: data["activeState"] !== undefined ? serializeDynamicListenerState(data["activeState"]) : undefined, drainingState: data["drainingState"] !== undefined ? serializeDynamicListenerState(data["drainingState"]) : undefined, errorState: data["errorState"] !== undefined ? serializeUpdateFailureState(data["errorState"]) : undefined, warmingState: data["warmingState"] !== undefined ? serializeDynamicListenerState(data["warmingState"]) : undefined, }; } function deserializeDynamicListener(data: any): DynamicListener { return { ...data, activeState: data["activeState"] !== undefined ? deserializeDynamicListenerState(data["activeState"]) : undefined, drainingState: data["drainingState"] !== undefined ? deserializeDynamicListenerState(data["drainingState"]) : undefined, errorState: data["errorState"] !== undefined ? deserializeUpdateFailureState(data["errorState"]) : undefined, warmingState: data["warmingState"] !== undefined ? deserializeDynamicListenerState(data["warmingState"]) : undefined, }; } export interface DynamicListenerState { /** * The timestamp when the Listener was last successfully updated. */ lastUpdated?: Date; /** * The listener config. */ listener?: { [key: string]: any }; /** * This is the per-resource version information. This version is currently * taken from the :ref:`version_info ` field at the time that the listener was * loaded. In the future, discrete per-listener versions may be supported by * the API. */ versionInfo?: string; } function serializeDynamicListenerState(data: any): DynamicListenerState { return { ...data, lastUpdated: data["lastUpdated"] !== undefined ? data["lastUpdated"].toISOString() : undefined, }; } function deserializeDynamicListenerState(data: any): DynamicListenerState { return { ...data, lastUpdated: data["lastUpdated"] !== undefined ? new Date(data["lastUpdated"]) : undefined, }; } /** * [#next-free-field: 6] */ export interface DynamicRouteConfig { /** * The client status of this resource. [#not-implemented-hide:] */ clientStatus?: | "UNKNOWN" | "REQUESTED" | "DOES_NOT_EXIST" | "ACKED" | "NACKED"; /** * Set if the last update failed, cleared after the next successful update. * The ``error_state`` field contains the rejected version of this particular * resource along with the reason and timestamp. For successfully updated or * acknowledged resource, this field should be empty. [#not-implemented-hide:] */ errorState?: UpdateFailureState; /** * The timestamp when the Route was last updated. */ lastUpdated?: Date; /** * The route config. */ routeConfig?: { [key: string]: any }; /** * This is the per-resource version information. This version is currently * taken from the :ref:`version_info ` field at the time that the route * configuration was loaded. */ versionInfo?: string; } function serializeDynamicRouteConfig(data: any): DynamicRouteConfig { return { ...data, errorState: data["errorState"] !== undefined ? serializeUpdateFailureState(data["errorState"]) : undefined, lastUpdated: data["lastUpdated"] !== undefined ? data["lastUpdated"].toISOString() : undefined, }; } function deserializeDynamicRouteConfig(data: any): DynamicRouteConfig { return { ...data, errorState: data["errorState"] !== undefined ? deserializeUpdateFailureState(data["errorState"]) : undefined, lastUpdated: data["lastUpdated"] !== undefined ? new Date(data["lastUpdated"]) : undefined, }; } /** * [#next-free-field: 7] */ export interface DynamicScopedRouteConfigs { /** * The client status of this resource. [#not-implemented-hide:] */ clientStatus?: | "UNKNOWN" | "REQUESTED" | "DOES_NOT_EXIST" | "ACKED" | "NACKED"; /** * Set if the last update failed, cleared after the next successful update. * The ``error_state`` field contains the rejected version of this particular * resource along with the reason and timestamp. For successfully updated or * acknowledged resource, this field should be empty. [#not-implemented-hide:] */ errorState?: UpdateFailureState; /** * The timestamp when the scoped route config set was last updated. */ lastUpdated?: Date; /** * The name assigned to the scoped route configurations. */ name?: string; /** * The scoped route configurations. */ scopedRouteConfigs?: { [key: string]: any }[]; /** * This is the per-resource version information. This version is currently * taken from the :ref:`version_info ` field at the time that the scoped * routes configuration was loaded. */ versionInfo?: string; } function serializeDynamicScopedRouteConfigs(data: any): DynamicScopedRouteConfigs { return { ...data, errorState: data["errorState"] !== undefined ? serializeUpdateFailureState(data["errorState"]) : undefined, lastUpdated: data["lastUpdated"] !== undefined ? data["lastUpdated"].toISOString() : undefined, }; } function deserializeDynamicScopedRouteConfigs(data: any): DynamicScopedRouteConfigs { return { ...data, errorState: data["errorState"] !== undefined ? deserializeUpdateFailureState(data["errorState"]) : undefined, lastUpdated: data["lastUpdated"] !== undefined ? new Date(data["lastUpdated"]) : undefined, }; } /** * Envoy's admin fill this message with all currently known endpoints. Endpoint * configuration information can be used to recreate an Envoy configuration by * populating all endpoints as static endpoints or by returning them in an EDS * response. */ export interface EndpointsConfigDump { /** * The dynamically loaded endpoint configs. */ dynamicEndpointConfigs?: DynamicEndpointConfig[]; /** * The statically loaded endpoint configs. */ staticEndpointConfigs?: StaticEndpointConfig[]; } function serializeEndpointsConfigDump(data: any): EndpointsConfigDump { return { ...data, dynamicEndpointConfigs: data["dynamicEndpointConfigs"] !== undefined ? data["dynamicEndpointConfigs"].map((item: any) => (serializeDynamicEndpointConfig(item))) : undefined, staticEndpointConfigs: data["staticEndpointConfigs"] !== undefined ? data["staticEndpointConfigs"].map((item: any) => (serializeStaticEndpointConfig(item))) : undefined, }; } function deserializeEndpointsConfigDump(data: any): EndpointsConfigDump { return { ...data, dynamicEndpointConfigs: data["dynamicEndpointConfigs"] !== undefined ? data["dynamicEndpointConfigs"].map((item: any) => (deserializeDynamicEndpointConfig(item))) : undefined, staticEndpointConfigs: data["staticEndpointConfigs"] !== undefined ? data["staticEndpointConfigs"].map((item: any) => (deserializeStaticEndpointConfig(item))) : undefined, }; } /** * The address represents an envoy internal listener. [#comment: */ export interface EnvoyInternalAddress { /** * Specifies an endpoint identifier to distinguish between multiple endpoints * for the same internal listener in a single upstream pool. Only used in the * upstream addresses for tracking changes to individual endpoints. This, for * example, may be set to the final destination IP for the target internal * listener. */ endpointId?: string; /** * Specifies the :ref:`name ` of the internal listener. */ serverListenerName?: string; } /** * Version and identification for an Envoy extension. [#next-free-field: 7] */ export interface Extension { /** * 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: */ category?: string; /** * Indicates that the extension is present but was disabled via dynamic * configuration. */ disabled?: boolean; /** * 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; /** * [#not-implemented-hide:] Type descriptor of extension configuration proto. * [#comment: */ typeDescriptor?: string; /** * Type URLs of extension configuration protos. */ typeUrls?: 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?: BuildVersion; } /** * GenericXdsConfig is used to specify the config status and the dump of any * xDS resource identified by their type URL. It is the generalized version of * the now deprecated ListenersConfigDump, ClustersConfigDump etc * [#next-free-field: 10] */ export interface GenericXdsConfig { /** * Per xDS resource status from the view of a xDS client */ clientStatus?: | "UNKNOWN" | "REQUESTED" | "DOES_NOT_EXIST" | "ACKED" | "NACKED"; /** * Per xDS resource config status. It is generated by management servers. It * will not be present if the CSDS server is an xDS client. */ configStatus?: | "UNKNOWN" | "SYNCED" | "NOT_SENT" | "STALE" | "ERROR"; /** * Set if the last update failed, cleared after the next successful update. * The *error_state* field contains the rejected version of this particular * resource along with the reason and timestamp. For successfully updated or * acknowledged resource, this field should be empty. [#not-implemented-hide:] */ errorState?: UpdateFailureState; /** * Is static resource is true if it is specified in the config supplied * through the file at the startup. */ isStaticResource?: boolean; /** * Timestamp when the xDS resource was last updated */ lastUpdated?: Date; /** * Name of the xDS resource */ name?: string; /** * Type_url represents the fully qualified name of xDS resource type like * envoy.v3.Cluster, envoy.v3.ClusterLoadAssignment etc. */ typeUrl?: string; /** * This is the :ref:`version_info ` in the last processed xDS discovery * response. If there are only static bootstrap listeners, this field will be * "" */ versionInfo?: string; /** * The xDS resource config. Actual content depends on the type */ xdsConfig?: { [key: string]: any }; } function serializeGenericXdsConfig(data: any): GenericXdsConfig { return { ...data, errorState: data["errorState"] !== undefined ? serializeUpdateFailureState(data["errorState"]) : undefined, lastUpdated: data["lastUpdated"] !== undefined ? data["lastUpdated"].toISOString() : undefined, }; } function deserializeGenericXdsConfig(data: any): GenericXdsConfig { return { ...data, errorState: data["errorState"] !== undefined ? deserializeUpdateFailureState(data["errorState"]) : undefined, lastUpdated: data["lastUpdated"] !== undefined ? new Date(data["lastUpdated"]) : undefined, }; } /** * Google's `RE2 `_ regex engine. The regex string must adhere to the * documented `syntax `_. The engine is designed to complete execution in linear * time as well as limit the amount of memory used. Envoy supports program size * checking via runtime. The runtime keys ``re2.max_program_size.error_level`` * and ``re2.max_program_size.warn_level`` can be set to integers as the maximum * program size or complexity that a compiled regex can have before an exception * is thrown or a warning is logged, respectively. * ``re2.max_program_size.error_level`` defaults to 100, and * ``re2.max_program_size.warn_level`` has no default if unset (will not * check/log a warning). Envoy emits two stats for tracking the program size of * regexes: the histogram ``re2.program_size``, which records the program size, * and the counter ``re2.exceeded_warn_level``, which is incremented each time * the program size exceeds the warn level threshold. */ export interface GoogleRE2 { /** * This field controls the RE2 "program size" which is a rough estimate of * how complex a compiled regex is to evaluate. A regex that has a program * size greater than the configured value will fail to compile. In this case, * the configured max program size can be increased or the regex can be * simplified. If not specified, the default is 100. This field is deprecated; * regexp validation should be performed on the management server instead of * being done by each individual client. .. note:: Although this field is * deprecated, the program size will still be checked against the global * ``re2.max_program_size.error_level`` runtime value. */ maxProgramSize?: number; } export interface InlineScopedRouteConfigs { /** * The timestamp when the scoped route config set was last updated. */ lastUpdated?: Date; /** * The name assigned to the scoped route configurations. */ name?: string; /** * The scoped route configurations. */ scopedRouteConfigs?: { [key: string]: any }[]; } function serializeInlineScopedRouteConfigs(data: any): InlineScopedRouteConfigs { return { ...data, lastUpdated: data["lastUpdated"] !== undefined ? data["lastUpdated"].toISOString() : undefined, }; } function deserializeInlineScopedRouteConfigs(data: any): InlineScopedRouteConfigs { return { ...data, lastUpdated: data["lastUpdated"] !== undefined ? new Date(data["lastUpdated"]) : undefined, }; } /** * Envoy's listener manager fills this message with all currently known * listeners. Listener configuration information can be used to recreate an * Envoy configuration by populating all listeners as static listeners or by * returning them in a LDS response. */ export interface ListenersConfigDump { /** * State for any warming, active, or draining listeners. */ dynamicListeners?: DynamicListener[]; /** * The statically loaded listener configs. */ staticListeners?: StaticListener[]; /** * This is the :ref:`version_info ` in the last processed LDS discovery * response. If there are only static bootstrap listeners, this field will be * "". */ versionInfo?: string; } function serializeListenersConfigDump(data: any): ListenersConfigDump { return { ...data, dynamicListeners: data["dynamicListeners"] !== undefined ? data["dynamicListeners"].map((item: any) => (serializeDynamicListener(item))) : undefined, staticListeners: data["staticListeners"] !== undefined ? data["staticListeners"].map((item: any) => (serializeStaticListener(item))) : undefined, }; } function deserializeListenersConfigDump(data: any): ListenersConfigDump { return { ...data, dynamicListeners: data["dynamicListeners"] !== undefined ? data["dynamicListeners"].map((item: any) => (deserializeDynamicListener(item))) : undefined, staticListeners: data["staticListeners"] !== undefined ? data["staticListeners"].map((item: any) => (deserializeStaticListener(item))) : undefined, }; } /** * Specifies the way to match a list value. */ export interface ListMatcher { /** * If specified, at least one of the values in the list must match the value * specified. */ oneOf?: ValueMatcher; } /** * Identifies location of where either Envoy runs or where upstream hosts run. */ export interface Locality { /** * Region this :ref:`zone ` belongs to. */ region?: 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. */ subZone?: 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; } /** * 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: 13] */ export interface Node { /** * 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. */ clientFeatures?: 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; /** * Map from xDS resource type URL to dynamic context parameters. These may * vary at runtime (unlike other fields in this message). For example, the xDS * client may have a shard identifier that changes during the lifetime of the * xDS client. In Envoy, this would be achieved by updating the dynamic * context on the Server::Instance's LocalInfo context provider. The shard ID * dynamic parameter then appears in this field during future discovery * requests. */ dynamicParameters?: { [key: string]: ContextParams }; /** * List of extensions and their versions supported by the node. */ extensions?: Extension[]; /** * 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; /** * 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. */ listeningAddresses?: Address[]; /** * Locality specifying where the Envoy instance is running. */ locality?: Locality; /** * Opaque metadata extending the node identifier. Envoy will pass this * directly to the management server. */ metadata?: { [key: string]: any }; /** * Structured version of the entity requesting config. */ userAgentBuildVersion?: BuildVersion; /** * Free-form string that identifies the entity requesting config. E.g. * "envoy" or "grpc" */ userAgentName?: string; /** * Free-form string that identifies the version of the entity requesting * config. E.g. "1.12.2" or "abcd1234", or "SpecialEnvoyBuild" */ userAgentVersion?: string; } /** * Specifies the way to match a Node. The match follows AND semantics. */ export interface NodeMatcher { /** * Specifies match criteria on the node id. */ nodeId?: StringMatcher; /** * Specifies match criteria on the node metadata. */ nodeMetadatas?: StructMatcher[]; } /** * NullMatch is an empty message to specify a null value. */ export interface NullMatch { } /** * Specifies a list of alternatives for the match. */ export interface OrMatcher { valueMatchers?: ValueMatcher[]; } /** * Specifies the segment in a path to retrieve value from Struct. */ export interface PathSegment { /** * If specified, use the key to retrieve the value in a Struct. */ key?: string; } /** * Detailed config (per xDS) with status. [#next-free-field: 8] */ export interface PerXdsConfig { /** * Client config status is populated by xDS clients. Will not be present if * the CSDS server is an xDS server. No matter what the client config status * is, xDS clients should always dump the most recent accepted xDS config. .. * attention:: This field is deprecated. Use :ref:`ClientResourceStatus ` for * per-resource config status instead. */ clientStatus?: | "CLIENT_UNKNOWN" | "CLIENT_REQUESTED" | "CLIENT_ACKED" | "CLIENT_NACKED"; clusterConfig?: ClustersConfigDump; endpointConfig?: EndpointsConfigDump; listenerConfig?: ListenersConfigDump; routeConfig?: RoutesConfigDump; scopedRouteConfig?: ScopedRoutesConfigDump; /** * Config status generated by management servers. Will not be present if the * CSDS server is an xDS client. */ status?: | "UNKNOWN" | "SYNCED" | "NOT_SENT" | "STALE" | "ERROR"; } function serializePerXdsConfig(data: any): PerXdsConfig { return { ...data, clusterConfig: data["clusterConfig"] !== undefined ? serializeClustersConfigDump(data["clusterConfig"]) : undefined, endpointConfig: data["endpointConfig"] !== undefined ? serializeEndpointsConfigDump(data["endpointConfig"]) : undefined, listenerConfig: data["listenerConfig"] !== undefined ? serializeListenersConfigDump(data["listenerConfig"]) : undefined, routeConfig: data["routeConfig"] !== undefined ? serializeRoutesConfigDump(data["routeConfig"]) : undefined, scopedRouteConfig: data["scopedRouteConfig"] !== undefined ? serializeScopedRoutesConfigDump(data["scopedRouteConfig"]) : undefined, }; } function deserializePerXdsConfig(data: any): PerXdsConfig { return { ...data, clusterConfig: data["clusterConfig"] !== undefined ? deserializeClustersConfigDump(data["clusterConfig"]) : undefined, endpointConfig: data["endpointConfig"] !== undefined ? deserializeEndpointsConfigDump(data["endpointConfig"]) : undefined, listenerConfig: data["listenerConfig"] !== undefined ? deserializeListenersConfigDump(data["listenerConfig"]) : undefined, routeConfig: data["routeConfig"] !== undefined ? deserializeRoutesConfigDump(data["routeConfig"]) : undefined, scopedRouteConfig: data["scopedRouteConfig"] !== undefined ? deserializeScopedRoutesConfigDump(data["scopedRouteConfig"]) : undefined, }; } export interface Pipe { /** * The mode for the Pipe. Not applicable for abstract sockets. */ mode?: number; /** * 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; } /** * A regex matcher designed for safety when used with untrusted input. */ export interface RegexMatcher { /** * Google's RE2 regex engine. */ googleRe2?: GoogleRE2; /** * The regex match string. The string must be supported by the configured * engine. The regex is matched against the full string, not as a partial * match. */ regex?: string; } /** * Envoy's RDS implementation fills this message with all currently loaded * routes, as described by their RouteConfiguration objects. Static routes that * are either defined in the bootstrap configuration or defined inline while * configuring listeners are separated from those configured dynamically via * RDS. Route configuration information can be used to recreate an Envoy * configuration by populating all routes as static routes or by returning them * in RDS responses. */ export interface RoutesConfigDump { /** * The dynamically loaded route configs. */ dynamicRouteConfigs?: DynamicRouteConfig[]; /** * The statically loaded route configs. */ staticRouteConfigs?: StaticRouteConfig[]; } function serializeRoutesConfigDump(data: any): RoutesConfigDump { return { ...data, dynamicRouteConfigs: data["dynamicRouteConfigs"] !== undefined ? data["dynamicRouteConfigs"].map((item: any) => (serializeDynamicRouteConfig(item))) : undefined, staticRouteConfigs: data["staticRouteConfigs"] !== undefined ? data["staticRouteConfigs"].map((item: any) => (serializeStaticRouteConfig(item))) : undefined, }; } function deserializeRoutesConfigDump(data: any): RoutesConfigDump { return { ...data, dynamicRouteConfigs: data["dynamicRouteConfigs"] !== undefined ? data["dynamicRouteConfigs"].map((item: any) => (deserializeDynamicRouteConfig(item))) : undefined, staticRouteConfigs: data["staticRouteConfigs"] !== undefined ? data["staticRouteConfigs"].map((item: any) => (deserializeStaticRouteConfig(item))) : undefined, }; } /** * Envoy's scoped RDS implementation fills this message with all currently * loaded route configuration scopes (defined via ScopedRouteConfigurationsSet * protos). This message lists both the scopes defined inline with the higher * order object (i.e., the HttpConnectionManager) and the dynamically obtained * scopes via the SRDS API. */ export interface ScopedRoutesConfigDump { /** * The dynamically loaded scoped route configs. */ dynamicScopedRouteConfigs?: DynamicScopedRouteConfigs[]; /** * The statically loaded scoped route configs. */ inlineScopedRouteConfigs?: InlineScopedRouteConfigs[]; } function serializeScopedRoutesConfigDump(data: any): ScopedRoutesConfigDump { return { ...data, dynamicScopedRouteConfigs: data["dynamicScopedRouteConfigs"] !== undefined ? data["dynamicScopedRouteConfigs"].map((item: any) => (serializeDynamicScopedRouteConfigs(item))) : undefined, inlineScopedRouteConfigs: data["inlineScopedRouteConfigs"] !== undefined ? data["inlineScopedRouteConfigs"].map((item: any) => (serializeInlineScopedRouteConfigs(item))) : undefined, }; } function deserializeScopedRoutesConfigDump(data: any): ScopedRoutesConfigDump { return { ...data, dynamicScopedRouteConfigs: data["dynamicScopedRouteConfigs"] !== undefined ? data["dynamicScopedRouteConfigs"].map((item: any) => (deserializeDynamicScopedRouteConfigs(item))) : undefined, inlineScopedRouteConfigs: data["inlineScopedRouteConfigs"] !== undefined ? data["inlineScopedRouteConfigs"].map((item: any) => (deserializeInlineScopedRouteConfigs(item))) : undefined, }; } /** * 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 { majorNumber?: number; minorNumber?: number; patch?: number; } /** * [#next-free-field: 7] */ export interface SocketAddress { /** * 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; /** * 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:``. */ ipv4Compat?: boolean; /** * This is only valid if :ref:`resolver_name ` is specified below and the * named resolver is capable of named port resolution. */ namedPort?: string; portValue?: number; protocol?: | "TCP" | "UDP"; /** * 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. */ resolverName?: string; } /** * Describes a statically loaded cluster. */ export interface StaticCluster { /** * The cluster config. */ cluster?: { [key: string]: any }; /** * The timestamp when the Cluster was last updated. */ lastUpdated?: Date; } function serializeStaticCluster(data: any): StaticCluster { return { ...data, lastUpdated: data["lastUpdated"] !== undefined ? data["lastUpdated"].toISOString() : undefined, }; } function deserializeStaticCluster(data: any): StaticCluster { return { ...data, lastUpdated: data["lastUpdated"] !== undefined ? new Date(data["lastUpdated"]) : undefined, }; } export interface StaticEndpointConfig { /** * The endpoint config. */ endpointConfig?: { [key: string]: any }; /** * [#not-implemented-hide:] The timestamp when the Endpoint was last updated. */ lastUpdated?: Date; } function serializeStaticEndpointConfig(data: any): StaticEndpointConfig { return { ...data, lastUpdated: data["lastUpdated"] !== undefined ? data["lastUpdated"].toISOString() : undefined, }; } function deserializeStaticEndpointConfig(data: any): StaticEndpointConfig { return { ...data, lastUpdated: data["lastUpdated"] !== undefined ? new Date(data["lastUpdated"]) : undefined, }; } /** * Describes a statically loaded listener. */ export interface StaticListener { /** * The timestamp when the Listener was last successfully updated. */ lastUpdated?: Date; /** * The listener config. */ listener?: { [key: string]: any }; } function serializeStaticListener(data: any): StaticListener { return { ...data, lastUpdated: data["lastUpdated"] !== undefined ? data["lastUpdated"].toISOString() : undefined, }; } function deserializeStaticListener(data: any): StaticListener { return { ...data, lastUpdated: data["lastUpdated"] !== undefined ? new Date(data["lastUpdated"]) : undefined, }; } export interface StaticRouteConfig { /** * The timestamp when the Route was last updated. */ lastUpdated?: Date; /** * The route config. */ routeConfig?: { [key: string]: any }; } function serializeStaticRouteConfig(data: any): StaticRouteConfig { return { ...data, lastUpdated: data["lastUpdated"] !== undefined ? data["lastUpdated"].toISOString() : undefined, }; } function deserializeStaticRouteConfig(data: any): StaticRouteConfig { return { ...data, lastUpdated: data["lastUpdated"] !== undefined ? new Date(data["lastUpdated"]) : undefined, }; } /** * Specifies the way to match a string. [#next-free-field: 9] */ export interface StringMatcher { /** * The input string must have the substring specified here. Note: empty * contains match is not allowed, please use regex instead. Examples: * * ``abc`` matches the value ``xyz.abc.def`` */ contains?: string; /** * Use an extension as the matcher type. [#extension-category: * envoy.string_matcher] */ custom?: TypedExtensionConfig; /** * The input string must match exactly the string specified here. Examples: * * ``abc`` only matches the value ``abc``. */ exact?: string; /** * If true, indicates the exact/prefix/suffix/contains matching should be * case insensitive. This has no effect for the safe_regex match. For example, * the matcher ``data`` will match both input string ``Data`` and ``data`` if * set to true. */ ignoreCase?: boolean; /** * The input string must have the prefix specified here. Note: empty prefix * is not allowed, please use regex instead. Examples: * ``abc`` matches the * value ``abc.xyz`` */ prefix?: string; /** * The input string must match the regular expression specified here. */ safeRegex?: RegexMatcher; /** * The input string must have the suffix specified here. Note: empty prefix * is not allowed, please use regex instead. Examples: * ``abc`` matches the * value ``xyz.abc`` */ suffix?: string; } /** * StructMatcher provides a general interface to check if a given value is * matched in google.protobuf.Struct. It uses ``path`` to retrieve the value * from the struct and then check if it's matched to the specified value. For * example, for the following Struct: .. code-block:: yaml fields: a: * struct_value: fields: b: struct_value: fields: c: string_value: pro t: * list_value: values: - string_value: m - string_value: n The following * MetadataMatcher is matched as the path [a, b, c] will retrieve a string value * "pro" from the Metadata which is matched to the specified prefix match. .. * code-block:: yaml path: - key: a - key: b - key: c value: string_match: * prefix: pr The following StructMatcher is matched as the code will match one * of the string values in the list at the path [a, t]. .. code-block:: yaml * path: - key: a - key: t value: list_match: one_of: string_match: exact: m An * example use of StructMatcher is to match metadata in envoy.v*.core.Node. */ export interface StructMatcher { /** * The path to retrieve the Value from the Struct. */ path?: PathSegment[]; /** * The StructMatcher is matched if the value retrieved by path is matched to * this value. */ value?: ValueMatcher; } /** * Message type for extension configuration. */ export interface TypedExtensionConfig { /** * The name of an extension. This is not used to select the extension, * instead it serves the role of an opaque identifier. */ name?: string; /** * The typed config for the extension. The type URL will be used to identify * the extension. In the case that the type URL is *xds.type.v3.TypedStruct* * (or, for historical reasons, *udpa.type.v1.TypedStruct*), the inner type * URL of *TypedStruct* will be utilized. See the :ref:`extension * configuration overview ` for further details. */ typedConfig?: { [key: string]: any }; } export interface UpdateFailureState { /** * Details about the last failed update attempt. */ details?: string; /** * What the component configuration would have been if the update had * succeeded. This field may not be populated by xDS clients due to storage * overhead. */ failedConfiguration?: { [key: string]: any }; /** * Time of the latest failed update attempt. */ lastUpdateAttempt?: Date; /** * This is the version of the rejected resource. [#not-implemented-hide:] */ versionInfo?: string; } function serializeUpdateFailureState(data: any): UpdateFailureState { return { ...data, lastUpdateAttempt: data["lastUpdateAttempt"] !== undefined ? data["lastUpdateAttempt"].toISOString() : undefined, }; } function deserializeUpdateFailureState(data: any): UpdateFailureState { return { ...data, lastUpdateAttempt: data["lastUpdateAttempt"] !== undefined ? new Date(data["lastUpdateAttempt"]) : undefined, }; } /** * Specifies the way to match a ProtobufWkt::Value. Primitive values and * ListValue are supported. StructValue is not supported and is always not * matched. [#next-free-field: 8] */ export interface ValueMatcher { /** * If specified, a match occurs if and only if the target value is a bool * value and is equal to this field. */ boolMatch?: boolean; /** * If specified, a match occurs if and only if the target value is a double * value and is matched to this field. */ doubleMatch?: DoubleMatcher; /** * If specified, a match occurs if and only if the target value is a list * value and is matched to this field. */ listMatch?: ListMatcher; /** * If specified, a match occurs if and only if the target value is a * NullValue. */ nullMatch?: NullMatch; /** * If specified, a match occurs if and only if any of the alternatives in the * match accept the value. */ orMatch?: OrMatcher; /** * If specified, value match will be performed based on whether the path is * referring to a valid primitive value in the metadata. If the path is * referring to a non-primitive value, the result is always not matched. */ presentMatch?: boolean; /** * If specified, a match occurs if and only if the target value is a string * value and is matched to this field. */ stringMatch?: StringMatcher; }