Skip to content

Commit cf943f0

Browse files
scaleway-botyfodil
andauthored
feat(edge_services): display doc for host_filter (#5450)
Co-authored-by: Yacine Fodil <105779815+yfodil@users.noreply.github.com>
1 parent afc88e4 commit cf943f0

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

cmd/scw/testdata/test-all-usage-edge-services-route-rules-add-usage.golden

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ARGS:
1010
[route-rules.{index}.rule-http-match.method-filters.{index}] HTTP methods to filter for. A request using any of these methods will be considered to match the rule. Possible values are `get`, `post`, `put`, `patch`, `delete`, `head`, `options`. All methods will match if none is provided (unknown_method_filter | get | post | put | patch | delete | head | options)
1111
[route-rules.{index}.rule-http-match.path-filter.path-filter-type] Type of filter to match for the HTTP URL path. For now, all path filters must be written in regex and use the `regex` type (unknown_path_filter | regex)
1212
[route-rules.{index}.rule-http-match.path-filter.value] Value to be matched for the HTTP URL path
13+
[route-rules.{index}.rule-http-match.host-filter.host-filter-type] (unknown_host_filter | regex)
14+
[route-rules.{index}.rule-http-match.host-filter.value]
1315
[route-rules.{index}.backend-stage-id] ID of the backend stage that requests matching the rule should be forwarded to
1416
[route-rules.{index}.waf-stage-id] ID of the WAF stage that requests matching the rule should be forwarded to
1517
[after-position] Add rules after the given position

cmd/scw/testdata/test-all-usage-edge-services-route-rules-set-usage.golden

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ARGS:
1010
[route-rules.{index}.rule-http-match.method-filters.{index}] HTTP methods to filter for. A request using any of these methods will be considered to match the rule. Possible values are `get`, `post`, `put`, `patch`, `delete`, `head`, `options`. All methods will match if none is provided (unknown_method_filter | get | post | put | patch | delete | head | options)
1111
[route-rules.{index}.rule-http-match.path-filter.path-filter-type] Type of filter to match for the HTTP URL path. For now, all path filters must be written in regex and use the `regex` type (unknown_path_filter | regex)
1212
[route-rules.{index}.rule-http-match.path-filter.value] Value to be matched for the HTTP URL path
13+
[route-rules.{index}.rule-http-match.host-filter.host-filter-type] (unknown_host_filter | regex)
14+
[route-rules.{index}.rule-http-match.host-filter.value]
1315
[route-rules.{index}.backend-stage-id] ID of the backend stage that requests matching the rule should be forwarded to
1416
[route-rules.{index}.waf-stage-id] ID of the WAF stage that requests matching the rule should be forwarded to
1517

docs/commands/edge-services.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,8 @@ scw edge-services route-rules add <route-stage-id ...> [arg=value ...]
644644
| route-rules.{index}.rule-http-match.method-filters.{index} | One of: `unknown_method_filter`, `get`, `post`, `put`, `patch`, `delete`, `head`, `options` | HTTP methods to filter for. A request using any of these methods will be considered to match the rule. Possible values are `get`, `post`, `put`, `patch`, `delete`, `head`, `options`. All methods will match if none is provided |
645645
| route-rules.{index}.rule-http-match.path-filter.path-filter-type | One of: `unknown_path_filter`, `regex` | Type of filter to match for the HTTP URL path. For now, all path filters must be written in regex and use the `regex` type |
646646
| route-rules.{index}.rule-http-match.path-filter.value | | Value to be matched for the HTTP URL path |
647+
| route-rules.{index}.rule-http-match.host-filter.host-filter-type | One of: `unknown_host_filter`, `regex` | |
648+
| route-rules.{index}.rule-http-match.host-filter.value | | |
647649
| route-rules.{index}.backend-stage-id | | ID of the backend stage that requests matching the rule should be forwarded to |
648650
| route-rules.{index}.waf-stage-id | | ID of the WAF stage that requests matching the rule should be forwarded to |
649651
| after-position | | Add rules after the given position |
@@ -713,6 +715,8 @@ scw edge-services route-rules set <route-stage-id ...> [arg=value ...]
713715
| route-rules.{index}.rule-http-match.method-filters.{index} | One of: `unknown_method_filter`, `get`, `post`, `put`, `patch`, `delete`, `head`, `options` | HTTP methods to filter for. A request using any of these methods will be considered to match the rule. Possible values are `get`, `post`, `put`, `patch`, `delete`, `head`, `options`. All methods will match if none is provided |
714716
| route-rules.{index}.rule-http-match.path-filter.path-filter-type | One of: `unknown_path_filter`, `regex` | Type of filter to match for the HTTP URL path. For now, all path filters must be written in regex and use the `regex` type |
715717
| route-rules.{index}.rule-http-match.path-filter.value | | Value to be matched for the HTTP URL path |
718+
| route-rules.{index}.rule-http-match.host-filter.host-filter-type | One of: `unknown_host_filter`, `regex` | |
719+
| route-rules.{index}.rule-http-match.host-filter.value | | |
716720
| route-rules.{index}.backend-stage-id | | ID of the backend stage that requests matching the rule should be forwarded to |
717721
| route-rules.{index}.waf-stage-id | | ID of the WAF stage that requests matching the rule should be forwarded to |
718722

internal/namespaces/edge_services/v1beta1/edge_services_cli.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,6 +2041,22 @@ func edgeServicesRouteRulesSet() *core.Command {
20412041
Deprecated: false,
20422042
Positional: false,
20432043
},
2044+
{
2045+
Name: "route-rules.{index}.rule-http-match.host-filter.host-filter-type",
2046+
Required: false,
2047+
Deprecated: false,
2048+
Positional: false,
2049+
EnumValues: []string{
2050+
"unknown_host_filter",
2051+
"regex",
2052+
},
2053+
},
2054+
{
2055+
Name: "route-rules.{index}.rule-http-match.host-filter.value",
2056+
Required: false,
2057+
Deprecated: false,
2058+
Positional: false,
2059+
},
20442060
{
20452061
Name: "route-rules.{index}.backend-stage-id",
20462062
Short: `ID of the backend stage that requests matching the rule should be forwarded to`,
@@ -2119,6 +2135,22 @@ func edgeServicesRouteRulesAdd() *core.Command {
21192135
Deprecated: false,
21202136
Positional: false,
21212137
},
2138+
{
2139+
Name: "route-rules.{index}.rule-http-match.host-filter.host-filter-type",
2140+
Required: false,
2141+
Deprecated: false,
2142+
Positional: false,
2143+
EnumValues: []string{
2144+
"unknown_host_filter",
2145+
"regex",
2146+
},
2147+
},
2148+
{
2149+
Name: "route-rules.{index}.rule-http-match.host-filter.value",
2150+
Required: false,
2151+
Deprecated: false,
2152+
Positional: false,
2153+
},
21222154
{
21232155
Name: "route-rules.{index}.backend-stage-id",
21242156
Short: `ID of the backend stage that requests matching the rule should be forwarded to`,

0 commit comments

Comments
 (0)