scoped_route.proto 3.8 KB

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