Skip to content

Commit ee57902

Browse files
Generate loadbalancer
1 parent f57da4e commit ee57902

3 files changed

Lines changed: 47 additions & 6 deletions

File tree

‎services/loadbalancer/oas_commit‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
425d0d7efa3593494efd4f608f4f887187465c1d
1+
4cd5a53efd662031e40a9debd4148cedd9e980a5

‎services/loadbalancer/src/stackit/loadbalancer/models/http_health_checks.py‎

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,19 @@
1515

1616
import json
1717
import pprint
18+
import re # noqa: F401
1819
from typing import Any, ClassVar, Dict, List, Optional, Set
1920

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
21+
from pydantic import (
22+
BaseModel,
23+
ConfigDict,
24+
Field,
25+
StrictBool,
26+
StrictStr,
27+
field_validator,
28+
)
2129
from pydantic_core import to_jsonable_python
22-
from typing_extensions import Self
30+
from typing_extensions import Annotated, Self
2331

2432
from stackit.loadbalancer.models.tls_config import TlsConfig
2533

@@ -29,12 +37,32 @@ class HttpHealthChecks(BaseModel):
2937
Options for the HTTP health checking.
3038
""" # noqa: E501
3139

40+
disable_connection_reuse: Optional[StrictBool] = Field(
41+
default=None,
42+
description="If true, each HTTP health check probe opens a new TCP connection instead of reusing an existing one. Defaults to false (connections are reused across consecutive probes).",
43+
alias="disableConnectionReuse",
44+
)
3245
ok_statuses: Optional[List[StrictStr]] = Field(
3346
default=None, description="List of HTTP status codes that indicate a healthy response", alias="okStatuses"
3447
)
35-
path: Optional[StrictStr] = Field(default=None, description="Path to send the health check request to")
48+
path: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=253)]] = Field(
49+
default=None, description="Path to send the health check request to"
50+
)
3651
tls: Optional[TlsConfig] = None
37-
__properties: ClassVar[List[str]] = ["okStatuses", "path", "tls"]
52+
__properties: ClassVar[List[str]] = ["disableConnectionReuse", "okStatuses", "path", "tls"]
53+
54+
@field_validator("path")
55+
def path_validate_regular_expression(cls, value):
56+
"""Validates the regular expression"""
57+
if value is None:
58+
return value
59+
60+
if not isinstance(value, str):
61+
value = str(value)
62+
63+
if not re.match(r"^(?:\/[a-zA-Z0-9\-._]+)*\/?$", value):
64+
raise ValueError(r"must validate the regular expression /^(?:\/[a-zA-Z0-9\-._]+)*\/?$/")
65+
return value
3866

3967
model_config = ConfigDict(
4068
validate_by_name=True,
@@ -89,6 +117,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89117

90118
_obj = cls.model_validate(
91119
{
120+
"disableConnectionReuse": obj.get("disableConnectionReuse"),
92121
"okStatuses": obj.get("okStatuses"),
93122
"path": obj.get("path"),
94123
"tls": TlsConfig.from_dict(obj["tls"]) if obj.get("tls") is not None else None,

‎services/loadbalancer/src/stackit/loadbalancer/models/load_balancer_options.py‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,25 @@ class LoadBalancerOptions(BaseModel):
3535
""" # noqa: E501
3636

3737
access_control: Optional[LoadbalancerOptionAccessControl] = Field(default=None, alias="accessControl")
38+
access_logs: Optional[StrictBool] = Field(
39+
default=None,
40+
description="Enable per-request access logs on the Load Balancer. Defaults to false. Enable only when the Load Balancer's expected traffic volume can be sustained by the downstream logging pipeline, as access-log volume scales linearly with request rate. Requires a STACKIT Telemetry Router to be set up for the logs to be viewable.",
41+
alias="accessLogs",
42+
)
3843
ephemeral_address: Optional[StrictBool] = Field(default=None, alias="ephemeralAddress")
3944
observability: Optional[LoadbalancerOptionObservability] = None
4045
private_network_only: Optional[StrictBool] = Field(
4146
default=None,
4247
description="Load Balancer is accessible only via a private network ip address. Not changeable after creation.",
4348
alias="privateNetworkOnly",
4449
)
45-
__properties: ClassVar[List[str]] = ["accessControl", "ephemeralAddress", "observability", "privateNetworkOnly"]
50+
__properties: ClassVar[List[str]] = [
51+
"accessControl",
52+
"accessLogs",
53+
"ephemeralAddress",
54+
"observability",
55+
"privateNetworkOnly",
56+
]
4657

4758
model_config = ConfigDict(
4859
validate_by_name=True,
@@ -105,6 +116,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
105116
if obj.get("accessControl") is not None
106117
else None
107118
),
119+
"accessLogs": obj.get("accessLogs"),
108120
"ephemeralAddress": obj.get("ephemeralAddress"),
109121
"observability": (
110122
LoadbalancerOptionObservability.from_dict(obj["observability"])

0 commit comments

Comments
 (0)