Skip to content

Commit 803d121

Browse files
feat(lb): add access_logs field to frontend (#996)
Co-authored-by: Jonathan R. <jremy@scaleway.com>
1 parent ce0758a commit 803d121

File tree

6 files changed

+128
-18
lines changed

6 files changed

+128
-18
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,7 @@ async def create_frontend(
15121512
lb_id: str,
15131513
backend_id: str,
15141514
enable_http3: bool,
1515+
enable_access_logs: bool,
15151516
zone: Optional[ScwZone] = None,
15161517
name: Optional[str] = None,
15171518
timeout_client: Optional[str] = None,
@@ -1526,6 +1527,7 @@ async def create_frontend(
15261527
:param lb_id: Load Balancer ID (ID of the Load Balancer to attach the frontend to).
15271528
:param backend_id: Backend ID (ID of the backend the frontend should pass traffic to).
15281529
:param enable_http3: Defines whether to enable HTTP/3 protocol on the frontend.
1530+
:param enable_access_logs: Defines wether to enable access logs on the frontend.
15291531
:param zone: Zone to target. If none is passed will use default zone from the config.
15301532
:param name: Name for the frontend.
15311533
:param timeout_client: Maximum allowed inactivity time on the client side.
@@ -1542,6 +1544,7 @@ async def create_frontend(
15421544
lb_id="example",
15431545
backend_id="example",
15441546
enable_http3=False,
1547+
enable_access_logs=False,
15451548
)
15461549
"""
15471550

@@ -1557,6 +1560,7 @@ async def create_frontend(
15571560
lb_id=lb_id,
15581561
backend_id=backend_id,
15591562
enable_http3=enable_http3,
1563+
enable_access_logs=enable_access_logs,
15601564
zone=zone,
15611565
name=name or random_name(prefix="lbf"),
15621566
timeout_client=timeout_client,
@@ -1616,6 +1620,7 @@ async def update_frontend(
16161620
certificate_id: Optional[str] = None,
16171621
certificate_ids: Optional[List[str]] = None,
16181622
connection_rate_limit: Optional[int] = None,
1623+
enable_access_logs: Optional[bool] = None,
16191624
) -> Frontend:
16201625
"""
16211626
Update a frontend.
@@ -1630,6 +1635,7 @@ async def update_frontend(
16301635
:param certificate_id: Certificate ID, deprecated in favor of certificate_ids array.
16311636
:param certificate_ids: List of SSL/TLS certificate IDs to bind to the frontend.
16321637
:param connection_rate_limit: Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.
1638+
:param enable_access_logs: Defines wether to enable access logs on the frontend.
16331639
:return: :class:`Frontend <Frontend>`
16341640
16351641
Usage:
@@ -1662,6 +1668,7 @@ async def update_frontend(
16621668
certificate_id=certificate_id,
16631669
certificate_ids=certificate_ids,
16641670
connection_rate_limit=connection_rate_limit,
1671+
enable_access_logs=enable_access_logs,
16651672
),
16661673
self.client,
16671674
),
@@ -4553,6 +4560,7 @@ async def create_frontend(
45534560
lb_id: str,
45544561
backend_id: str,
45554562
enable_http3: bool,
4563+
enable_access_logs: bool,
45564564
region: Optional[ScwRegion] = None,
45574565
name: Optional[str] = None,
45584566
timeout_client: Optional[str] = None,
@@ -4566,6 +4574,7 @@ async def create_frontend(
45664574
:param lb_id: Load Balancer ID (ID of the Load Balancer to attach the frontend to).
45674575
:param backend_id: Backend ID (ID of the backend the frontend should pass traffic to).
45684576
:param enable_http3: Defines whether to enable HTTP/3 protocol on the frontend.
4577+
:param enable_access_logs: Defines wether to enable access logs on the frontend.
45694578
:param region: Region to target. If none is passed will use default region from the config.
45704579
:param name: Name for the frontend.
45714580
:param timeout_client: Maximum allowed inactivity time on the client side.
@@ -4582,6 +4591,7 @@ async def create_frontend(
45824591
lb_id="example",
45834592
backend_id="example",
45844593
enable_http3=False,
4594+
enable_access_logs=False,
45854595
)
45864596
"""
45874597

@@ -4599,6 +4609,7 @@ async def create_frontend(
45994609
lb_id=lb_id,
46004610
backend_id=backend_id,
46014611
enable_http3=enable_http3,
4612+
enable_access_logs=enable_access_logs,
46024613
region=region,
46034614
name=name or random_name(prefix="lbf"),
46044615
timeout_client=timeout_client,
@@ -4659,6 +4670,7 @@ async def update_frontend(
46594670
certificate_id: Optional[str] = None,
46604671
certificate_ids: Optional[List[str]] = None,
46614672
connection_rate_limit: Optional[int] = None,
4673+
enable_access_logs: Optional[bool] = None,
46624674
) -> Frontend:
46634675
"""
46644676
Update a frontend.
@@ -4672,6 +4684,7 @@ async def update_frontend(
46724684
:param certificate_id: Certificate ID, deprecated in favor of certificate_ids array.
46734685
:param certificate_ids: List of SSL/TLS certificate IDs to bind to the frontend.
46744686
:param connection_rate_limit: Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.
4687+
:param enable_access_logs: Defines wether to enable access logs on the frontend.
46754688
:return: :class:`Frontend <Frontend>`
46764689
46774690
Usage:
@@ -4706,6 +4719,7 @@ async def update_frontend(
47064719
certificate_id=certificate_id,
47074720
certificate_ids=certificate_ids,
47084721
connection_rate_limit=connection_rate_limit,
4722+
enable_access_logs=enable_access_logs,
47094723
),
47104724
self.client,
47114725
),

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -816,10 +816,6 @@ def unmarshal_Frontend(data: Any) -> Frontend:
816816
if field is not None:
817817
args["certificate_ids"] = field
818818

819-
field = data.get("enable_http3", None)
820-
if field is not None:
821-
args["enable_http3"] = field
822-
823819
field = data.get("backend", None)
824820
if field is not None:
825821
args["backend"] = unmarshal_Backend(field)
@@ -838,6 +834,14 @@ def unmarshal_Frontend(data: Any) -> Frontend:
838834
else:
839835
args["timeout_client"] = None
840836

837+
field = data.get("enable_http3", None)
838+
if field is not None:
839+
args["enable_http3"] = field
840+
841+
field = data.get("enable_access_logs", None)
842+
if field is not None:
843+
args["enable_access_logs"] = field
844+
841845
field = data.get("certificate", None)
842846
if field is not None:
843847
args["certificate"] = unmarshal_Certificate(field)
@@ -1940,6 +1944,9 @@ def marshal_CreateFrontendRequest(
19401944
if request.enable_http3 is not None:
19411945
output["enable_http3"] = request.enable_http3
19421946

1947+
if request.enable_access_logs is not None:
1948+
output["enable_access_logs"] = request.enable_access_logs
1949+
19431950
if request.name is not None:
19441951
output["name"] = request.name
19451952

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

2327+
if request.enable_access_logs is not None:
2328+
output["enable_access_logs"] = request.enable_access_logs
2329+
23202330
return output
23212331

23222332

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

2614+
if request.enable_access_logs is not None:
2615+
output["enable_access_logs"] = request.enable_access_logs
2616+
26042617
if request.name is not None:
26052618
output["name"] = request.name
26062619

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

2997+
if request.enable_access_logs is not None:
2998+
output["enable_access_logs"] = request.enable_access_logs
2999+
29843000
return output
29853001

29863002

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

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -914,11 +914,6 @@ class Frontend:
914914
List of SSL/TLS certificate IDs to bind to the frontend.
915915
"""
916916

917-
enable_http3: bool
918-
"""
919-
Defines whether to enable HTTP/3 protocol on the frontend.
920-
"""
921-
922917
backend: Optional[Backend]
923918
"""
924919
Backend object the frontend is attached to.
@@ -934,6 +929,16 @@ class Frontend:
934929
Maximum allowed inactivity time on the client side.
935930
"""
936931

932+
enable_http3: bool
933+
"""
934+
Defines whether to enable HTTP/3 protocol on the frontend.
935+
"""
936+
937+
enable_access_logs: bool
938+
"""
939+
Defines wether to enable access logs on the frontend.
940+
"""
941+
937942
certificate: Optional[Certificate]
938943
"""
939944
Certificate, deprecated in favor of certificate_ids array.
@@ -1468,6 +1473,11 @@ class CreateFrontendRequest:
14681473
Defines whether to enable HTTP/3 protocol on the frontend.
14691474
"""
14701475

1476+
enable_access_logs: bool
1477+
"""
1478+
Defines wether to enable access logs on the frontend.
1479+
"""
1480+
14711481
region: Optional[ScwRegion]
14721482
"""
14731483
Region to target. If none is passed will use default region from the config.
@@ -2707,6 +2717,11 @@ class UpdateFrontendRequest:
27072717
Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.
27082718
"""
27092719

2720+
enable_access_logs: Optional[bool]
2721+
"""
2722+
Defines wether to enable access logs on the frontend.
2723+
"""
2724+
27102725

27112726
@dataclass
27122727
class UpdateHealthCheckRequest:
@@ -3122,6 +3137,11 @@ class ZonedApiCreateFrontendRequest:
31223137
Defines whether to enable HTTP/3 protocol on the frontend.
31233138
"""
31243139

3140+
enable_access_logs: bool
3141+
"""
3142+
Defines wether to enable access logs on the frontend.
3143+
"""
3144+
31253145
zone: Optional[ScwZone]
31263146
"""
31273147
Zone to target. If none is passed will use default zone from the config.
@@ -4215,6 +4235,11 @@ class ZonedApiUpdateFrontendRequest:
42154235
Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.
42164236
"""
42174237

4238+
enable_access_logs: Optional[bool]
4239+
"""
4240+
Defines wether to enable access logs on the frontend.
4241+
"""
4242+
42184243

42194244
@dataclass
42204245
class ZonedApiUpdateHealthCheckRequest:

scaleway/scaleway/lb/v1/api.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,7 @@ def create_frontend(
15121512
lb_id: str,
15131513
backend_id: str,
15141514
enable_http3: bool,
1515+
enable_access_logs: bool,
15151516
zone: Optional[ScwZone] = None,
15161517
name: Optional[str] = None,
15171518
timeout_client: Optional[str] = None,
@@ -1526,6 +1527,7 @@ def create_frontend(
15261527
:param lb_id: Load Balancer ID (ID of the Load Balancer to attach the frontend to).
15271528
:param backend_id: Backend ID (ID of the backend the frontend should pass traffic to).
15281529
:param enable_http3: Defines whether to enable HTTP/3 protocol on the frontend.
1530+
:param enable_access_logs: Defines wether to enable access logs on the frontend.
15291531
:param zone: Zone to target. If none is passed will use default zone from the config.
15301532
:param name: Name for the frontend.
15311533
:param timeout_client: Maximum allowed inactivity time on the client side.
@@ -1542,6 +1544,7 @@ def create_frontend(
15421544
lb_id="example",
15431545
backend_id="example",
15441546
enable_http3=False,
1547+
enable_access_logs=False,
15451548
)
15461549
"""
15471550

@@ -1557,6 +1560,7 @@ def create_frontend(
15571560
lb_id=lb_id,
15581561
backend_id=backend_id,
15591562
enable_http3=enable_http3,
1563+
enable_access_logs=enable_access_logs,
15601564
zone=zone,
15611565
name=name or random_name(prefix="lbf"),
15621566
timeout_client=timeout_client,
@@ -1616,6 +1620,7 @@ def update_frontend(
16161620
certificate_id: Optional[str] = None,
16171621
certificate_ids: Optional[List[str]] = None,
16181622
connection_rate_limit: Optional[int] = None,
1623+
enable_access_logs: Optional[bool] = None,
16191624
) -> Frontend:
16201625
"""
16211626
Update a frontend.
@@ -1630,6 +1635,7 @@ def update_frontend(
16301635
:param certificate_id: Certificate ID, deprecated in favor of certificate_ids array.
16311636
:param certificate_ids: List of SSL/TLS certificate IDs to bind to the frontend.
16321637
:param connection_rate_limit: Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.
1638+
:param enable_access_logs: Defines wether to enable access logs on the frontend.
16331639
:return: :class:`Frontend <Frontend>`
16341640
16351641
Usage:
@@ -1662,6 +1668,7 @@ def update_frontend(
16621668
certificate_id=certificate_id,
16631669
certificate_ids=certificate_ids,
16641670
connection_rate_limit=connection_rate_limit,
1671+
enable_access_logs=enable_access_logs,
16651672
),
16661673
self.client,
16671674
),
@@ -4551,6 +4558,7 @@ def create_frontend(
45514558
lb_id: str,
45524559
backend_id: str,
45534560
enable_http3: bool,
4561+
enable_access_logs: bool,
45544562
region: Optional[ScwRegion] = None,
45554563
name: Optional[str] = None,
45564564
timeout_client: Optional[str] = None,
@@ -4564,6 +4572,7 @@ def create_frontend(
45644572
:param lb_id: Load Balancer ID (ID of the Load Balancer to attach the frontend to).
45654573
:param backend_id: Backend ID (ID of the backend the frontend should pass traffic to).
45664574
:param enable_http3: Defines whether to enable HTTP/3 protocol on the frontend.
4575+
:param enable_access_logs: Defines wether to enable access logs on the frontend.
45674576
:param region: Region to target. If none is passed will use default region from the config.
45684577
:param name: Name for the frontend.
45694578
:param timeout_client: Maximum allowed inactivity time on the client side.
@@ -4580,6 +4589,7 @@ def create_frontend(
45804589
lb_id="example",
45814590
backend_id="example",
45824591
enable_http3=False,
4592+
enable_access_logs=False,
45834593
)
45844594
"""
45854595

@@ -4597,6 +4607,7 @@ def create_frontend(
45974607
lb_id=lb_id,
45984608
backend_id=backend_id,
45994609
enable_http3=enable_http3,
4610+
enable_access_logs=enable_access_logs,
46004611
region=region,
46014612
name=name or random_name(prefix="lbf"),
46024613
timeout_client=timeout_client,
@@ -4657,6 +4668,7 @@ def update_frontend(
46574668
certificate_id: Optional[str] = None,
46584669
certificate_ids: Optional[List[str]] = None,
46594670
connection_rate_limit: Optional[int] = None,
4671+
enable_access_logs: Optional[bool] = None,
46604672
) -> Frontend:
46614673
"""
46624674
Update a frontend.
@@ -4670,6 +4682,7 @@ def update_frontend(
46704682
:param certificate_id: Certificate ID, deprecated in favor of certificate_ids array.
46714683
:param certificate_ids: List of SSL/TLS certificate IDs to bind to the frontend.
46724684
:param connection_rate_limit: Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.
4685+
:param enable_access_logs: Defines wether to enable access logs on the frontend.
46734686
:return: :class:`Frontend <Frontend>`
46744687
46754688
Usage:
@@ -4704,6 +4717,7 @@ def update_frontend(
47044717
certificate_id=certificate_id,
47054718
certificate_ids=certificate_ids,
47064719
connection_rate_limit=connection_rate_limit,
4720+
enable_access_logs=enable_access_logs,
47074721
),
47084722
self.client,
47094723
),

0 commit comments

Comments
 (0)