Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion services/loadbalancer/oas_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
425d0d7efa3593494efd4f608f4f887187465c1d
716f4d2bf40383fc9a9c3ee0f67a0490d4a15d81
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@

import json
import pprint
import re # noqa: F401
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from pydantic_core import to_jsonable_python
from typing_extensions import Self
from typing_extensions import Annotated, Self

from stackit.loadbalancer.models.tls_config import TlsConfig

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

@field_validator("path")
def path_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"^(?:\/[a-zA-Z0-9\-._]+)*\/?$", value):
raise ValueError(r"must validate the regular expression /^(?:\/[a-zA-Z0-9\-._]+)*\/?$/")
return value

model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,25 @@ class LoadBalancerOptions(BaseModel):
""" # noqa: E501

access_control: Optional[LoadbalancerOptionAccessControl] = Field(default=None, alias="accessControl")
access_logs: Optional[StrictBool] = Field(
default=None,
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.",
alias="accessLogs",
)
ephemeral_address: Optional[StrictBool] = Field(default=None, alias="ephemeralAddress")
observability: Optional[LoadbalancerOptionObservability] = None
private_network_only: Optional[StrictBool] = Field(
default=None,
description="Load Balancer is accessible only via a private network ip address. Not changeable after creation.",
alias="privateNetworkOnly",
)
__properties: ClassVar[List[str]] = ["accessControl", "ephemeralAddress", "observability", "privateNetworkOnly"]
__properties: ClassVar[List[str]] = [
"accessControl",
"accessLogs",
"ephemeralAddress",
"observability",
"privateNetworkOnly",
]

model_config = ConfigDict(
validate_by_name=True,
Expand Down Expand Up @@ -105,6 +116,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
if obj.get("accessControl") is not None
else None
),
"accessLogs": obj.get("accessLogs"),
"ephemeralAddress": obj.get("ephemeralAddress"),
"observability": (
LoadbalancerOptionObservability.from_dict(obj["observability"])
Expand Down
Loading