Skip to content

Commit 14df9d2

Browse files
authored
feat(lb): add support for match_subdomains (scaleway#877)
1 parent 946c57a commit 14df9d2

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

scaleway-async/scaleway_async/lb/v1/marshalling.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,10 @@ def unmarshal_RouteMatch(data: Any) -> RouteMatch:
11121112

11131113
args: Dict[str, Any] = {}
11141114

1115+
field = data.get("match_subdomains", None)
1116+
if field is not None:
1117+
args["match_subdomains"] = field
1118+
11151119
field = data.get("sni", None)
11161120
if field is not None:
11171121
args["sni"] = field
@@ -2036,6 +2040,9 @@ def marshal_RouteMatch(
20362040
),
20372041
)
20382042

2043+
if request.match_subdomains is not None:
2044+
output["match_subdomains"] = request.match_subdomains
2045+
20392046
return output
20402047

20412048

scaleway-async/scaleway_async/lb/v1/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,11 @@ class PrivateNetworkStaticConfig:
970970

971971
@dataclass
972972
class RouteMatch:
973+
match_subdomains: bool
974+
"""
975+
If true, all subdomains will match.
976+
"""
977+
973978
sni: Optional[str]
974979

975980
host_header: Optional[str]

scaleway/scaleway/lb/v1/marshalling.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,10 @@ def unmarshal_RouteMatch(data: Any) -> RouteMatch:
11121112

11131113
args: Dict[str, Any] = {}
11141114

1115+
field = data.get("match_subdomains", None)
1116+
if field is not None:
1117+
args["match_subdomains"] = field
1118+
11151119
field = data.get("sni", None)
11161120
if field is not None:
11171121
args["sni"] = field
@@ -2036,6 +2040,9 @@ def marshal_RouteMatch(
20362040
),
20372041
)
20382042

2043+
if request.match_subdomains is not None:
2044+
output["match_subdomains"] = request.match_subdomains
2045+
20392046
return output
20402047

20412048

scaleway/scaleway/lb/v1/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,11 @@ class PrivateNetworkStaticConfig:
970970

971971
@dataclass
972972
class RouteMatch:
973+
match_subdomains: bool
974+
"""
975+
If true, all subdomains will match.
976+
"""
977+
973978
sni: Optional[str]
974979

975980
host_header: Optional[str]

0 commit comments

Comments
 (0)