1// Copyright 2020 The gRPC Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Local copy of Envoy xDS proto file, used for testing only.
16
17syntax = "proto3";
18
19package envoy.config.core.v3;
20
21import "src/proto/grpc/testing/xds/v3/percent.proto";
22
23import "google/protobuf/any.proto";
24import "google/protobuf/struct.proto";
25
26// Identifies location of where either Envoy runs or where upstream hosts run.
27message Locality {
28  // Region this :ref:`zone <envoy_api_field_config.core.v3.Locality.zone>` belongs to.
29  string region = 1;
30
31  // Defines the local service zone where Envoy is running. Though optional, it
32  // should be set if discovery service routing is used and the discovery
33  // service exposes :ref:`zone data <envoy_api_field_config.endpoint.v3.LocalityLbEndpoints.locality>`,
34  // either in this message or via :option:`--service-zone`. The meaning of zone
35  // is context dependent, e.g. `Availability Zone (AZ)
36  // <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html>`_
37  // on AWS, `Zone <https://cloud.google.com/compute/docs/regions-zones/>`_ on
38  // GCP, etc.
39  string zone = 2;
40
41  // When used for locality of upstream hosts, this field further splits zone
42  // into smaller chunks of sub-zones so they can be load balanced
43  // independently.
44  string sub_zone = 3;
45}
46
47// Identifies a specific Envoy instance. The node identifier is presented to the
48// management server, which may use this identifier to distinguish per Envoy
49// configuration for serving.
50// [#next-free-field: 12]
51message Node {
52  // An opaque node identifier for the Envoy node. This also provides the local
53  // service node name. It should be set if any of the following features are
54  // used: :ref:`statsd <arch_overview_statistics>`, :ref:`CDS
55  // <config_cluster_manager_cds>`, and :ref:`HTTP tracing
56  // <arch_overview_tracing>`, either in this message or via
57  // :option:`--service-node`.
58  string id = 1;
59
60  // Defines the local service cluster name where Envoy is running. Though
61  // optional, it should be set if any of the following features are used:
62  // :ref:`statsd <arch_overview_statistics>`, :ref:`health check cluster
63  // verification
64  // <envoy_api_field_config.core.v3.HealthCheck.HttpHealthCheck.service_name_matcher>`,
65  // :ref:`runtime override directory <envoy_api_msg_config.bootstrap.v3.Runtime>`,
66  // :ref:`user agent addition
67  // <envoy_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.add_user_agent>`,
68  // :ref:`HTTP global rate limiting <config_http_filters_rate_limit>`,
69  // :ref:`CDS <config_cluster_manager_cds>`, and :ref:`HTTP tracing
70  // <arch_overview_tracing>`, either in this message or via
71  // :option:`--service-cluster`.
72  string cluster = 2;
73
74  // Opaque metadata extending the node identifier. Envoy will pass this
75  // directly to the management server.
76  google.protobuf.Struct metadata = 3;
77
78  // Locality specifying where the Envoy instance is running.
79  Locality locality = 4;
80
81  // Free-form string that identifies the entity requesting config.
82  // E.g. "envoy" or "grpc"
83  string user_agent_name = 6;
84
85  oneof user_agent_version_type {
86    // Free-form string that identifies the version of the entity requesting config.
87    // E.g. "1.12.2" or "abcd1234", or "SpecialEnvoyBuild"
88    string user_agent_version = 7;
89  }
90
91  // Client feature support list. These are well known features described
92  // in the Envoy API repository for a given major version of an API. Client features
93  // use reverse DNS naming scheme, for example `com.acme.feature`.
94  // See :ref:`the list of features <client_features>` that xDS client may
95  // support.
96  repeated string client_features = 10;
97}
98
99// Runtime derived FractionalPercent with defaults for when the numerator or denominator is not
100// specified via a runtime key.
101//
102// .. note::
103//
104//   Parsing of the runtime key's data is implemented such that it may be represented as a
105//   :ref:`FractionalPercent <envoy_api_msg_type.v3.FractionalPercent>` proto represented as JSON/YAML
106//   and may also be represented as an integer with the assumption that the value is an integral
107//   percentage out of 100. For instance, a runtime key lookup returning the value "42" would parse
108//   as a `FractionalPercent` whose numerator is 42 and denominator is HUNDRED.
109message RuntimeFractionalPercent {
110  // Default value if the runtime value's for the numerator/denominator keys are not available.
111  type.v3.FractionalPercent default_value = 1;
112}
113
114// Configuration for transport socket in :ref:`listeners <config_listeners>` and
115// :ref:`clusters <envoy_api_msg_config.cluster.v3.Cluster>`. If the configuration is
116// empty, a default transport socket implementation and configuration will be
117// chosen based on the platform and existence of tls_context.
118message TransportSocket {
119  // The name of the transport socket to instantiate. The name must match a supported transport
120  // socket implementation.
121  string name = 1;
122
123  // Implementation specific configuration which depends on the implementation being instantiated.
124  // See the supported transport socket implementations for further documentation.
125  oneof config_type {
126    google.protobuf.Any typed_config = 3;
127  }
128}
129