Skip to content

Commit cbd6a5e

Browse files
authored
feat(lb): add backend_id to GetLbStats (#195)
1 parent 3d6f59d commit cbd6a5e

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,11 +1903,13 @@ async def get_lb_stats(
19031903
*,
19041904
lb_id: str,
19051905
region: Optional[Region] = None,
1906+
backend_id: Optional[str] = None,
19061907
) -> LbStats:
19071908
"""
19081909
Get usage statistics of a given load balancer.
19091910
:param region: Region to target. If none is passed will use default region from the config.
19101911
:param lb_id: Load Balancer ID.
1912+
:param backend_id: ID of the backend.
19111913
:return: :class:`LbStats <LbStats>`
19121914
:deprecated
19131915
@@ -1925,6 +1927,9 @@ async def get_lb_stats(
19251927
res = self._request(
19261928
"GET",
19271929
f"/lb/v1/regions/{param_region}/lbs/{param_lb_id}/stats",
1930+
params={
1931+
"backend_id": backend_id,
1932+
},
19281933
)
19291934

19301935
self._throw_on_error(res)
@@ -4798,11 +4803,13 @@ async def get_lb_stats(
47984803
*,
47994804
lb_id: str,
48004805
zone: Optional[Zone] = None,
4806+
backend_id: Optional[str] = None,
48014807
) -> LbStats:
48024808
"""
48034809
Get usage statistics of a given Load Balancer.
48044810
:param zone: Zone to target. If none is passed will use default zone from the config.
48054811
:param lb_id: Load Balancer ID.
4812+
:param backend_id: ID of the backend.
48064813
:return: :class:`LbStats <LbStats>`
48074814
:deprecated
48084815
@@ -4818,6 +4825,9 @@ async def get_lb_stats(
48184825
res = self._request(
48194826
"GET",
48204827
f"/lb/v1/zones/{param_zone}/lbs/{param_lb_id}/stats",
4828+
params={
4829+
"backend_id": backend_id,
4830+
},
48214831
)
48224832

48234833
self._throw_on_error(res)

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2567,6 +2567,11 @@ class GetLbStatsRequest:
25672567
Load Balancer ID.
25682568
"""
25692569

2570+
backend_id: Optional[str]
2571+
"""
2572+
ID of the backend.
2573+
"""
2574+
25702575

25712576
@dataclass
25722577
class ListBackendStatsRequest:
@@ -4087,6 +4092,11 @@ class ZonedApiGetLbStatsRequest:
40874092
Load Balancer ID.
40884093
"""
40894094

4095+
backend_id: Optional[str]
4096+
"""
4097+
ID of the backend.
4098+
"""
4099+
40904100

40914101
@dataclass
40924102
class ZonedApiListBackendStatsRequest:

scaleway/scaleway/lb/v1/api.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,11 +1903,13 @@ def get_lb_stats(
19031903
*,
19041904
lb_id: str,
19051905
region: Optional[Region] = None,
1906+
backend_id: Optional[str] = None,
19061907
) -> LbStats:
19071908
"""
19081909
Get usage statistics of a given load balancer.
19091910
:param region: Region to target. If none is passed will use default region from the config.
19101911
:param lb_id: Load Balancer ID.
1912+
:param backend_id: ID of the backend.
19111913
:return: :class:`LbStats <LbStats>`
19121914
:deprecated
19131915
@@ -1925,6 +1927,9 @@ def get_lb_stats(
19251927
res = self._request(
19261928
"GET",
19271929
f"/lb/v1/regions/{param_region}/lbs/{param_lb_id}/stats",
1930+
params={
1931+
"backend_id": backend_id,
1932+
},
19281933
)
19291934

19301935
self._throw_on_error(res)
@@ -4796,11 +4801,13 @@ def get_lb_stats(
47964801
*,
47974802
lb_id: str,
47984803
zone: Optional[Zone] = None,
4804+
backend_id: Optional[str] = None,
47994805
) -> LbStats:
48004806
"""
48014807
Get usage statistics of a given Load Balancer.
48024808
:param zone: Zone to target. If none is passed will use default zone from the config.
48034809
:param lb_id: Load Balancer ID.
4810+
:param backend_id: ID of the backend.
48044811
:return: :class:`LbStats <LbStats>`
48054812
:deprecated
48064813
@@ -4816,6 +4823,9 @@ def get_lb_stats(
48164823
res = self._request(
48174824
"GET",
48184825
f"/lb/v1/zones/{param_zone}/lbs/{param_lb_id}/stats",
4826+
params={
4827+
"backend_id": backend_id,
4828+
},
48194829
)
48204830

48214831
self._throw_on_error(res)

scaleway/scaleway/lb/v1/types.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2567,6 +2567,11 @@ class GetLbStatsRequest:
25672567
Load Balancer ID.
25682568
"""
25692569

2570+
backend_id: Optional[str]
2571+
"""
2572+
ID of the backend.
2573+
"""
2574+
25702575

25712576
@dataclass
25722577
class ListBackendStatsRequest:
@@ -4087,6 +4092,11 @@ class ZonedApiGetLbStatsRequest:
40874092
Load Balancer ID.
40884093
"""
40894094

4095+
backend_id: Optional[str]
4096+
"""
4097+
ID of the backend.
4098+
"""
4099+
40904100

40914101
@dataclass
40924102
class ZonedApiListBackendStatsRequest:

0 commit comments

Comments
 (0)