scoped_route.proto 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. syntax = "proto3";
  2. package envoy.config.route.v3;
  3. import "envoy/config/route/v3/route.proto";
  4. import "udpa/annotations/migrate.proto";
  5. import "udpa/annotations/status.proto";
  6. import "udpa/annotations/versioning.proto";
  7. import "validate/validate.proto";
  8. option java_package = "io.envoyproxy.envoy.config.route.v3";
  9. option java_outer_classname = "ScopedRouteProto";
  10. option java_multiple_files = true;
  11. option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/route/v3;routev3";
  12. option (udpa.annotations.file_status).package_version_status = ACTIVE;
  13. // [#protodoc-title: HTTP scoped routing configuration]
  14. // * Routing :ref:`architecture overview <arch_overview_http_routing>`
  15. // Specifies a routing scope, which associates a
  16. // :ref:`Key<envoy_v3_api_msg_config.route.v3.ScopedRouteConfiguration.Key>` to a
  17. // :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration`.
  18. // The :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration` can be obtained dynamically
  19. // via RDS (:ref:`route_configuration_name<envoy_v3_api_field_config.route.v3.ScopedRouteConfiguration.route_configuration_name>`)
  20. // or specified inline (:ref:`route_configuration<envoy_v3_api_field_config.route.v3.ScopedRouteConfiguration.route_configuration>`).
  21. //
  22. // The HTTP connection manager builds up a table consisting of these Key to
  23. // RouteConfiguration mappings, and looks up the RouteConfiguration to use per
  24. // request according to the algorithm specified in the
  25. // :ref:`scope_key_builder<envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.ScopedRoutes.scope_key_builder>`
  26. // assigned to the HttpConnectionManager.
  27. //
  28. // For example, with the following configurations (in YAML):
  29. //
  30. // HttpConnectionManager config:
  31. //
  32. // .. code::
  33. //
  34. // ...
  35. // scoped_routes:
  36. // name: foo-scoped-routes
  37. // scope_key_builder:
  38. // fragments:
  39. // - header_value_extractor:
  40. // name: X-Route-Selector
  41. // element_separator: ,
  42. // element:
  43. // separator: =
  44. // key: vip
  45. //
  46. // ScopedRouteConfiguration resources (specified statically via
  47. // :ref:`scoped_route_configurations_list<envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.ScopedRoutes.scoped_route_configurations_list>`
  48. // or obtained dynamically via SRDS):
  49. //
  50. // .. code::
  51. //
  52. // (1)
  53. // name: route-scope1
  54. // route_configuration_name: route-config1
  55. // key:
  56. // fragments:
  57. // - string_key: 172.10.10.20
  58. //
  59. // (2)
  60. // name: route-scope2
  61. // route_configuration_name: route-config2
  62. // key:
  63. // fragments:
  64. // - string_key: 172.20.20.30
  65. //
  66. // A request from a client such as:
  67. //
  68. // .. code::
  69. //
  70. // GET / HTTP/1.1
  71. // Host: foo.com
  72. // X-Route-Selector: vip=172.10.10.20
  73. //
  74. // would result in the routing table defined by the `route-config1`
  75. // RouteConfiguration being assigned to the HTTP request/stream.
  76. //
  77. // [#next-free-field: 6]
  78. message ScopedRouteConfiguration {
  79. option (udpa.annotations.versioning).previous_message_type =
  80. "envoy.api.v2.ScopedRouteConfiguration";
  81. // Specifies a key which is matched against the output of the
  82. // :ref:`scope_key_builder<envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.ScopedRoutes.scope_key_builder>`
  83. // specified in the HttpConnectionManager. The matching is done per HTTP
  84. // request and is dependent on the order of the fragments contained in the
  85. // Key.
  86. message Key {
  87. option (udpa.annotations.versioning).previous_message_type =
  88. "envoy.api.v2.ScopedRouteConfiguration.Key";
  89. message Fragment {
  90. option (udpa.annotations.versioning).previous_message_type =
  91. "envoy.api.v2.ScopedRouteConfiguration.Key.Fragment";
  92. oneof type {
  93. option (validate.required) = true;
  94. // A string to match against.
  95. string string_key = 1;
  96. }
  97. }
  98. // The ordered set of fragments to match against. The order must match the
  99. // fragments in the corresponding
  100. // :ref:`scope_key_builder<envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.ScopedRoutes.scope_key_builder>`.
  101. repeated Fragment fragments = 1 [(validate.rules).repeated = {min_items: 1}];
  102. }
  103. // Whether the RouteConfiguration should be loaded on demand.
  104. bool on_demand = 4;
  105. // The name assigned to the routing scope.
  106. string name = 1 [(validate.rules).string = {min_len: 1}];
  107. // The resource name to use for a :ref:`envoy_v3_api_msg_service.discovery.v3.DiscoveryRequest` to an
  108. // RDS server to fetch the :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration` associated
  109. // with this scope.
  110. string route_configuration_name = 2
  111. [(udpa.annotations.field_migrate).oneof_promotion = "route_config"];
  112. // The :ref:`envoy_v3_api_msg_config.route.v3.RouteConfiguration` associated with the scope.
  113. RouteConfiguration route_configuration = 5
  114. [(udpa.annotations.field_migrate).oneof_promotion = "route_config"];
  115. // The key to match against.
  116. Key key = 3 [(validate.rules).message = {required: true}];
  117. }