Skip to content

Commit b3050f9

Browse files
Generate loadbalancer
1 parent be79f44 commit b3050f9

3 files changed

Lines changed: 33 additions & 5 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+
2ee484f69bcd0c059c445ae4a3173a01cc948a1c

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

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
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 BaseModel, ConfigDict, Field, StrictStr, field_validator
2122
from pydantic_core import to_jsonable_python
22-
from typing_extensions import Self
23+
from typing_extensions import Annotated, Self
2324

2425
from stackit.loadbalancer.models.tls_config import TlsConfig
2526

@@ -32,10 +33,25 @@ class HttpHealthChecks(BaseModel):
3233
ok_statuses: Optional[List[StrictStr]] = Field(
3334
default=None, description="List of HTTP status codes that indicate a healthy response", alias="okStatuses"
3435
)
35-
path: Optional[StrictStr] = Field(default=None, description="Path to send the health check request to")
36+
path: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=253)]] = Field(
37+
default=None, description="Path to send the health check request to"
38+
)
3639
tls: Optional[TlsConfig] = None
3740
__properties: ClassVar[List[str]] = ["okStatuses", "path", "tls"]
3841

42+
@field_validator("path")
43+
def path_validate_regular_expression(cls, value):
44+
"""Validates the regular expression"""
45+
if value is None:
46+
return value
47+
48+
if not isinstance(value, str):
49+
value = str(value)
50+
51+
if not re.match(r"^(?:\/[a-zA-Z0-9\-._]+)*\/?$", value):
52+
raise ValueError(r"must validate the regular expression /^(?:\/[a-zA-Z0-9\-._]+)*\/?$/")
53+
return value
54+
3955
model_config = ConfigDict(
4056
validate_by_name=True,
4157
validate_by_alias=True,

‎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)