Skip to content

feat(lb): add access_logs field to frontend #996

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
May 22, 2025
Merged
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
14 changes: 14 additions & 0 deletions scaleway-async/scaleway_async/lb/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,7 @@ async def create_frontend(
lb_id: str,
backend_id: str,
enable_http3: bool,
enable_access_logs: bool,
zone: Optional[ScwZone] = None,
name: Optional[str] = None,
timeout_client: Optional[str] = None,
Expand All @@ -1526,6 +1527,7 @@ async def create_frontend(
:param lb_id: Load Balancer ID (ID of the Load Balancer to attach the frontend to).
:param backend_id: Backend ID (ID of the backend the frontend should pass traffic to).
:param enable_http3: Defines whether to enable HTTP/3 protocol on the frontend.
:param enable_access_logs: Defines wether to enable access logs on the frontend.
:param zone: Zone to target. If none is passed will use default zone from the config.
:param name: Name for the frontend.
:param timeout_client: Maximum allowed inactivity time on the client side.
Expand All @@ -1542,6 +1544,7 @@ async def create_frontend(
lb_id="example",
backend_id="example",
enable_http3=False,
enable_access_logs=False,
)
"""

Expand All @@ -1557,6 +1560,7 @@ async def create_frontend(
lb_id=lb_id,
backend_id=backend_id,
enable_http3=enable_http3,
enable_access_logs=enable_access_logs,
zone=zone,
name=name or random_name(prefix="lbf"),
timeout_client=timeout_client,
Expand Down Expand Up @@ -1616,6 +1620,7 @@ async def update_frontend(
certificate_id: Optional[str] = None,
certificate_ids: Optional[List[str]] = None,
connection_rate_limit: Optional[int] = None,
enable_access_logs: Optional[bool] = None,
) -> Frontend:
"""
Update a frontend.
Expand All @@ -1630,6 +1635,7 @@ async def update_frontend(
:param certificate_id: Certificate ID, deprecated in favor of certificate_ids array.
:param certificate_ids: List of SSL/TLS certificate IDs to bind to the frontend.
:param connection_rate_limit: Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.
:param enable_access_logs: Defines wether to enable access logs on the frontend.
:return: :class:`Frontend <Frontend>`

Usage:
Expand Down Expand Up @@ -1662,6 +1668,7 @@ async def update_frontend(
certificate_id=certificate_id,
certificate_ids=certificate_ids,
connection_rate_limit=connection_rate_limit,
enable_access_logs=enable_access_logs,
),
self.client,
),
Expand Down Expand Up @@ -4553,6 +4560,7 @@ async def create_frontend(
lb_id: str,
backend_id: str,
enable_http3: bool,
enable_access_logs: bool,
region: Optional[ScwRegion] = None,
name: Optional[str] = None,
timeout_client: Optional[str] = None,
Expand All @@ -4566,6 +4574,7 @@ async def create_frontend(
:param lb_id: Load Balancer ID (ID of the Load Balancer to attach the frontend to).
:param backend_id: Backend ID (ID of the backend the frontend should pass traffic to).
:param enable_http3: Defines whether to enable HTTP/3 protocol on the frontend.
:param enable_access_logs: Defines wether to enable access logs on the frontend.
:param region: Region to target. If none is passed will use default region from the config.
:param name: Name for the frontend.
:param timeout_client: Maximum allowed inactivity time on the client side.
Expand All @@ -4582,6 +4591,7 @@ async def create_frontend(
lb_id="example",
backend_id="example",
enable_http3=False,
enable_access_logs=False,
)
"""

Expand All @@ -4599,6 +4609,7 @@ async def create_frontend(
lb_id=lb_id,
backend_id=backend_id,
enable_http3=enable_http3,
enable_access_logs=enable_access_logs,
region=region,
name=name or random_name(prefix="lbf"),
timeout_client=timeout_client,
Expand Down Expand Up @@ -4659,6 +4670,7 @@ async def update_frontend(
certificate_id: Optional[str] = None,
certificate_ids: Optional[List[str]] = None,
connection_rate_limit: Optional[int] = None,
enable_access_logs: Optional[bool] = None,
) -> Frontend:
"""
Update a frontend.
Expand All @@ -4672,6 +4684,7 @@ async def update_frontend(
:param certificate_id: Certificate ID, deprecated in favor of certificate_ids array.
:param certificate_ids: List of SSL/TLS certificate IDs to bind to the frontend.
:param connection_rate_limit: Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.
:param enable_access_logs: Defines wether to enable access logs on the frontend.
:return: :class:`Frontend <Frontend>`

Usage:
Expand Down Expand Up @@ -4706,6 +4719,7 @@ async def update_frontend(
certificate_id=certificate_id,
certificate_ids=certificate_ids,
connection_rate_limit=connection_rate_limit,
enable_access_logs=enable_access_logs,
),
self.client,
),
Expand Down
24 changes: 20 additions & 4 deletions scaleway-async/scaleway_async/lb/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,10 +816,6 @@ def unmarshal_Frontend(data: Any) -> Frontend:
if field is not None:
args["certificate_ids"] = field

field = data.get("enable_http3", None)
if field is not None:
args["enable_http3"] = field

field = data.get("backend", None)
if field is not None:
args["backend"] = unmarshal_Backend(field)
Expand All @@ -838,6 +834,14 @@ def unmarshal_Frontend(data: Any) -> Frontend:
else:
args["timeout_client"] = None

field = data.get("enable_http3", None)
if field is not None:
args["enable_http3"] = field

field = data.get("enable_access_logs", None)
if field is not None:
args["enable_access_logs"] = field

field = data.get("certificate", None)
if field is not None:
args["certificate"] = unmarshal_Certificate(field)
Expand Down Expand Up @@ -1940,6 +1944,9 @@ def marshal_CreateFrontendRequest(
if request.enable_http3 is not None:
output["enable_http3"] = request.enable_http3

if request.enable_access_logs is not None:
output["enable_access_logs"] = request.enable_access_logs

if request.name is not None:
output["name"] = request.name

Expand Down Expand Up @@ -2317,6 +2324,9 @@ def marshal_UpdateFrontendRequest(
if request.connection_rate_limit is not None:
output["connection_rate_limit"] = request.connection_rate_limit

if request.enable_access_logs is not None:
output["enable_access_logs"] = request.enable_access_logs

return output


Expand Down Expand Up @@ -2601,6 +2611,9 @@ def marshal_ZonedApiCreateFrontendRequest(
if request.enable_http3 is not None:
output["enable_http3"] = request.enable_http3

if request.enable_access_logs is not None:
output["enable_access_logs"] = request.enable_access_logs

if request.name is not None:
output["name"] = request.name

Expand Down Expand Up @@ -2981,6 +2994,9 @@ def marshal_ZonedApiUpdateFrontendRequest(
if request.connection_rate_limit is not None:
output["connection_rate_limit"] = request.connection_rate_limit

if request.enable_access_logs is not None:
output["enable_access_logs"] = request.enable_access_logs

return output


Expand Down
35 changes: 30 additions & 5 deletions scaleway-async/scaleway_async/lb/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,11 +914,6 @@ class Frontend:
List of SSL/TLS certificate IDs to bind to the frontend.
"""

enable_http3: bool
"""
Defines whether to enable HTTP/3 protocol on the frontend.
"""

backend: Optional[Backend]
"""
Backend object the frontend is attached to.
Expand All @@ -934,6 +929,16 @@ class Frontend:
Maximum allowed inactivity time on the client side.
"""

enable_http3: bool
"""
Defines whether to enable HTTP/3 protocol on the frontend.
"""

enable_access_logs: bool
"""
Defines wether to enable access logs on the frontend.
"""

certificate: Optional[Certificate]
"""
Certificate, deprecated in favor of certificate_ids array.
Expand Down Expand Up @@ -1468,6 +1473,11 @@ class CreateFrontendRequest:
Defines whether to enable HTTP/3 protocol on the frontend.
"""

enable_access_logs: bool
"""
Defines wether to enable access logs on the frontend.
"""

region: Optional[ScwRegion]
"""
Region to target. If none is passed will use default region from the config.
Expand Down Expand Up @@ -2707,6 +2717,11 @@ class UpdateFrontendRequest:
Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.
"""

enable_access_logs: Optional[bool]
"""
Defines wether to enable access logs on the frontend.
"""


@dataclass
class UpdateHealthCheckRequest:
Expand Down Expand Up @@ -3122,6 +3137,11 @@ class ZonedApiCreateFrontendRequest:
Defines whether to enable HTTP/3 protocol on the frontend.
"""

enable_access_logs: bool
"""
Defines wether to enable access logs on the frontend.
"""

zone: Optional[ScwZone]
"""
Zone to target. If none is passed will use default zone from the config.
Expand Down Expand Up @@ -4215,6 +4235,11 @@ class ZonedApiUpdateFrontendRequest:
Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.
"""

enable_access_logs: Optional[bool]
"""
Defines wether to enable access logs on the frontend.
"""


@dataclass
class ZonedApiUpdateHealthCheckRequest:
Expand Down
14 changes: 14 additions & 0 deletions scaleway/scaleway/lb/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,7 @@ def create_frontend(
lb_id: str,
backend_id: str,
enable_http3: bool,
enable_access_logs: bool,
zone: Optional[ScwZone] = None,
name: Optional[str] = None,
timeout_client: Optional[str] = None,
Expand All @@ -1526,6 +1527,7 @@ def create_frontend(
:param lb_id: Load Balancer ID (ID of the Load Balancer to attach the frontend to).
:param backend_id: Backend ID (ID of the backend the frontend should pass traffic to).
:param enable_http3: Defines whether to enable HTTP/3 protocol on the frontend.
:param enable_access_logs: Defines wether to enable access logs on the frontend.
:param zone: Zone to target. If none is passed will use default zone from the config.
:param name: Name for the frontend.
:param timeout_client: Maximum allowed inactivity time on the client side.
Expand All @@ -1542,6 +1544,7 @@ def create_frontend(
lb_id="example",
backend_id="example",
enable_http3=False,
enable_access_logs=False,
)
"""

Expand All @@ -1557,6 +1560,7 @@ def create_frontend(
lb_id=lb_id,
backend_id=backend_id,
enable_http3=enable_http3,
enable_access_logs=enable_access_logs,
zone=zone,
name=name or random_name(prefix="lbf"),
timeout_client=timeout_client,
Expand Down Expand Up @@ -1616,6 +1620,7 @@ def update_frontend(
certificate_id: Optional[str] = None,
certificate_ids: Optional[List[str]] = None,
connection_rate_limit: Optional[int] = None,
enable_access_logs: Optional[bool] = None,
) -> Frontend:
"""
Update a frontend.
Expand All @@ -1630,6 +1635,7 @@ def update_frontend(
:param certificate_id: Certificate ID, deprecated in favor of certificate_ids array.
:param certificate_ids: List of SSL/TLS certificate IDs to bind to the frontend.
:param connection_rate_limit: Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.
:param enable_access_logs: Defines wether to enable access logs on the frontend.
:return: :class:`Frontend <Frontend>`

Usage:
Expand Down Expand Up @@ -1662,6 +1668,7 @@ def update_frontend(
certificate_id=certificate_id,
certificate_ids=certificate_ids,
connection_rate_limit=connection_rate_limit,
enable_access_logs=enable_access_logs,
),
self.client,
),
Expand Down Expand Up @@ -4551,6 +4558,7 @@ def create_frontend(
lb_id: str,
backend_id: str,
enable_http3: bool,
enable_access_logs: bool,
region: Optional[ScwRegion] = None,
name: Optional[str] = None,
timeout_client: Optional[str] = None,
Expand All @@ -4564,6 +4572,7 @@ def create_frontend(
:param lb_id: Load Balancer ID (ID of the Load Balancer to attach the frontend to).
:param backend_id: Backend ID (ID of the backend the frontend should pass traffic to).
:param enable_http3: Defines whether to enable HTTP/3 protocol on the frontend.
:param enable_access_logs: Defines wether to enable access logs on the frontend.
:param region: Region to target. If none is passed will use default region from the config.
:param name: Name for the frontend.
:param timeout_client: Maximum allowed inactivity time on the client side.
Expand All @@ -4580,6 +4589,7 @@ def create_frontend(
lb_id="example",
backend_id="example",
enable_http3=False,
enable_access_logs=False,
)
"""

Expand All @@ -4597,6 +4607,7 @@ def create_frontend(
lb_id=lb_id,
backend_id=backend_id,
enable_http3=enable_http3,
enable_access_logs=enable_access_logs,
region=region,
name=name or random_name(prefix="lbf"),
timeout_client=timeout_client,
Expand Down Expand Up @@ -4657,6 +4668,7 @@ def update_frontend(
certificate_id: Optional[str] = None,
certificate_ids: Optional[List[str]] = None,
connection_rate_limit: Optional[int] = None,
enable_access_logs: Optional[bool] = None,
) -> Frontend:
"""
Update a frontend.
Expand All @@ -4670,6 +4682,7 @@ def update_frontend(
:param certificate_id: Certificate ID, deprecated in favor of certificate_ids array.
:param certificate_ids: List of SSL/TLS certificate IDs to bind to the frontend.
:param connection_rate_limit: Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.
:param enable_access_logs: Defines wether to enable access logs on the frontend.
:return: :class:`Frontend <Frontend>`

Usage:
Expand Down Expand Up @@ -4704,6 +4717,7 @@ def update_frontend(
certificate_id=certificate_id,
certificate_ids=certificate_ids,
connection_rate_limit=connection_rate_limit,
enable_access_logs=enable_access_logs,
),
self.client,
),
Expand Down
Loading