Skip to content

Commit 89e0dc9

Browse files
authored
feat(lb): publish flexible ip tags feature (#513)
1 parent 79a529d commit 89e0dc9

File tree

6 files changed

+150
-0
lines changed

6 files changed

+150
-0
lines changed

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ async def list_i_ps(
585585
organization_id: Optional[str] = None,
586586
project_id: Optional[str] = None,
587587
ip_type: Optional[ListIpsRequestIpType] = None,
588+
tags: Optional[List[str]] = None,
588589
) -> ListIpsResponse:
589590
"""
590591
List IP addresses.
@@ -596,6 +597,7 @@ async def list_i_ps(
596597
:param organization_id: Organization ID to filter for, only Load Balancer IP addresses from this Organization will be returned.
597598
:param project_id: Project ID to filter for, only Load Balancer IP addresses from this Project will be returned.
598599
:param ip_type: IP type to filter for.
600+
:param tags: Tag to filter for, only IPs with one or more matching tags will be returned.
599601
:return: :class:`ListIpsResponse <ListIpsResponse>`
600602
601603
Usage:
@@ -617,6 +619,7 @@ async def list_i_ps(
617619
"page": page,
618620
"page_size": page_size or self.client.default_page_size,
619621
"project_id": project_id or self.client.default_project_id,
622+
"tags": tags,
620623
},
621624
)
622625

@@ -633,6 +636,7 @@ async def list_i_ps_all(
633636
organization_id: Optional[str] = None,
634637
project_id: Optional[str] = None,
635638
ip_type: Optional[ListIpsRequestIpType] = None,
639+
tags: Optional[List[str]] = None,
636640
) -> List[Ip]:
637641
"""
638642
List IP addresses.
@@ -644,6 +648,7 @@ async def list_i_ps_all(
644648
:param organization_id: Organization ID to filter for, only Load Balancer IP addresses from this Organization will be returned.
645649
:param project_id: Project ID to filter for, only Load Balancer IP addresses from this Project will be returned.
646650
:param ip_type: IP type to filter for.
651+
:param tags: Tag to filter for, only IPs with one or more matching tags will be returned.
647652
:return: :class:`List[Ip] <List[Ip]>`
648653
649654
Usage:
@@ -664,6 +669,7 @@ async def list_i_ps_all(
664669
"organization_id": organization_id,
665670
"project_id": project_id,
666671
"ip_type": ip_type,
672+
"tags": tags,
667673
},
668674
)
669675

@@ -675,6 +681,7 @@ async def create_ip(
675681
organization_id: Optional[str] = None,
676682
project_id: Optional[str] = None,
677683
reverse: Optional[str] = None,
684+
tags: Optional[List[str]] = None,
678685
) -> Ip:
679686
"""
680687
Create an IP address.
@@ -686,6 +693,7 @@ async def create_ip(
686693
:param project_id: Project ID of the Project where the IP address should be created.
687694
One-Of ('project_identifier'): at most one of 'project_id', 'organization_id' could be set.
688695
:param reverse: Reverse DNS (domain name) for the IP address.
696+
:param tags: List of tags for the IP.
689697
:return: :class:`Ip <Ip>`
690698
691699
Usage:
@@ -706,6 +714,7 @@ async def create_ip(
706714
is_ipv6=is_ipv6,
707715
zone=zone,
708716
reverse=reverse,
717+
tags=tags,
709718
project_id=project_id,
710719
organization_id=organization_id,
711720
),
@@ -785,6 +794,7 @@ async def update_ip(
785794
zone: Optional[Zone] = None,
786795
reverse: Optional[str] = None,
787796
lb_id: Optional[str] = None,
797+
tags: Optional[List[str]] = None,
788798
) -> Ip:
789799
"""
790800
Update an IP address.
@@ -793,6 +803,7 @@ async def update_ip(
793803
:param zone: Zone to target. If none is passed will use default zone from the config.
794804
:param reverse: Reverse DNS (domain name) for the IP address.
795805
:param lb_id: ID of the server on which to attach the flexible IP.
806+
:param tags: List of tags for the IP.
796807
:return: :class:`Ip <Ip>`
797808
798809
Usage:
@@ -815,6 +826,7 @@ async def update_ip(
815826
zone=zone,
816827
reverse=reverse,
817828
lb_id=lb_id,
829+
tags=tags,
818830
),
819831
self.client,
820832
),
@@ -3592,6 +3604,7 @@ async def list_i_ps(
35923604
organization_id: Optional[str] = None,
35933605
project_id: Optional[str] = None,
35943606
ip_type: Optional[ListIpsRequestIpType] = None,
3607+
tags: Optional[List[str]] = None,
35953608
) -> ListIpsResponse:
35963609
"""
35973610
List IPs.
@@ -3602,6 +3615,7 @@ async def list_i_ps(
36023615
:param organization_id: Organization ID to filter for, only Load Balancer IP addresses from this Organization will be returned.
36033616
:param project_id: Project ID to filter for, only Load Balancer IP addresses from this Project will be returned.
36043617
:param ip_type: IP type to filter for.
3618+
:param tags: Tag to filter for, only IPs with one or more matching tags will be returned.
36053619
:return: :class:`ListIpsResponse <ListIpsResponse>`
36063620
36073621
Usage:
@@ -3625,6 +3639,7 @@ async def list_i_ps(
36253639
"page": page,
36263640
"page_size": page_size or self.client.default_page_size,
36273641
"project_id": project_id or self.client.default_project_id,
3642+
"tags": tags,
36283643
},
36293644
)
36303645

@@ -3641,6 +3656,7 @@ async def list_i_ps_all(
36413656
organization_id: Optional[str] = None,
36423657
project_id: Optional[str] = None,
36433658
ip_type: Optional[ListIpsRequestIpType] = None,
3659+
tags: Optional[List[str]] = None,
36443660
) -> List[Ip]:
36453661
"""
36463662
List IPs.
@@ -3651,6 +3667,7 @@ async def list_i_ps_all(
36513667
:param organization_id: Organization ID to filter for, only Load Balancer IP addresses from this Organization will be returned.
36523668
:param project_id: Project ID to filter for, only Load Balancer IP addresses from this Project will be returned.
36533669
:param ip_type: IP type to filter for.
3670+
:param tags: Tag to filter for, only IPs with one or more matching tags will be returned.
36543671
:return: :class:`List[Ip] <List[Ip]>`
36553672
36563673
Usage:
@@ -3671,6 +3688,7 @@ async def list_i_ps_all(
36713688
"organization_id": organization_id,
36723689
"project_id": project_id,
36733690
"ip_type": ip_type,
3691+
"tags": tags,
36743692
},
36753693
)
36763694

@@ -3682,6 +3700,7 @@ async def create_ip(
36823700
organization_id: Optional[str] = None,
36833701
project_id: Optional[str] = None,
36843702
reverse: Optional[str] = None,
3703+
tags: Optional[List[str]] = None,
36853704
) -> Ip:
36863705
"""
36873706
Create an IP.
@@ -3692,6 +3711,7 @@ async def create_ip(
36923711
:param project_id: Project ID of the Project where the IP address should be created.
36933712
One-Of ('project_identifier'): at most one of 'project_id', 'organization_id' could be set.
36943713
:param reverse: Reverse DNS (domain name) for the IP address.
3714+
:param tags: List of tags for the IP.
36953715
:return: :class:`Ip <Ip>`
36963716
36973717
Usage:
@@ -3714,6 +3734,7 @@ async def create_ip(
37143734
is_ipv6=is_ipv6,
37153735
region=region,
37163736
reverse=reverse,
3737+
tags=tags,
37173738
project_id=project_id,
37183739
organization_id=organization_id,
37193740
),
@@ -3795,13 +3816,15 @@ async def update_ip(
37953816
region: Optional[Region] = None,
37963817
reverse: Optional[str] = None,
37973818
lb_id: Optional[str] = None,
3819+
tags: Optional[List[str]] = None,
37983820
) -> Ip:
37993821
"""
38003822
Update an IP.
38013823
:param ip_id: IP address ID.
38023824
:param region: Region to target. If none is passed will use default region from the config.
38033825
:param reverse: Reverse DNS (domain name) for the IP address.
38043826
:param lb_id: ID of the server on which to attach the flexible IP.
3827+
:param tags: List of tags for the IP.
38053828
:return: :class:`Ip <Ip>`
38063829
38073830
Usage:
@@ -3826,6 +3849,7 @@ async def update_ip(
38263849
region=region,
38273850
reverse=reverse,
38283851
lb_id=lb_id,
3852+
tags=tags,
38293853
),
38303854
self.client,
38313855
),

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ def unmarshal_Ip(data: Any) -> Ip:
133133
if field is not None:
134134
args["reverse"] = field
135135

136+
field = data.get("tags", None)
137+
if field is not None:
138+
args["tags"] = field
139+
136140
field = data.get("zone", None)
137141
if field is not None:
138142
args["zone"] = field
@@ -1950,6 +1954,9 @@ def marshal_CreateIpRequest(
19501954
if request.reverse is not None:
19511955
output["reverse"] = request.reverse
19521956

1957+
if request.tags is not None:
1958+
output["tags"] = request.tags
1959+
19531960
return output
19541961

19551962

@@ -2328,6 +2335,9 @@ def marshal_UpdateIpRequest(
23282335
if request.lb_id is not None:
23292336
output["lb_id"] = request.lb_id
23302337

2338+
if request.tags is not None:
2339+
output["tags"] = request.tags
2340+
23312341
return output
23322342

23332343

@@ -2589,6 +2599,9 @@ def marshal_ZonedApiCreateIpRequest(
25892599
if request.reverse is not None:
25902600
output["reverse"] = request.reverse
25912601

2602+
if request.tags is not None:
2603+
output["tags"] = request.tags
2604+
25922605
return output
25932606

25942607

@@ -2962,6 +2975,9 @@ def marshal_ZonedApiUpdateIpRequest(
29622975
if request.lb_id is not None:
29632976
output["lb_id"] = request.lb_id
29642977

2978+
if request.tags is not None:
2979+
output["tags"] = request.tags
2980+
29652981
return output
29662982

29672983

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,11 @@ class Ip:
440440
Reverse DNS (domain name) of the IP address.
441441
"""
442442

443+
tags: List[str]
444+
"""
445+
IP tags.
446+
"""
447+
443448
zone: Zone
444449
"""
445450
The zone the IP address is in.
@@ -1484,6 +1489,11 @@ class CreateIpRequest:
14841489
Reverse DNS (domain name) for the IP address.
14851490
"""
14861491

1492+
tags: Optional[List[str]]
1493+
"""
1494+
List of tags for the IP.
1495+
"""
1496+
14871497
project_id: Optional[str]
14881498

14891499
organization_id: Optional[str]
@@ -2104,6 +2114,11 @@ class ListIPsRequest:
21042114
IP type to filter for.
21052115
"""
21062116

2117+
tags: Optional[List[str]]
2118+
"""
2119+
Tag to filter for, only IPs with one or more matching tags will be returned.
2120+
"""
2121+
21072122

21082123
@dataclass
21092124
class ListIpsResponse:
@@ -2740,6 +2755,11 @@ class UpdateIpRequest:
27402755
ID of the server on which to attach the flexible IP.
27412756
"""
27422757

2758+
tags: Optional[List[str]]
2759+
"""
2760+
List of tags for the IP.
2761+
"""
2762+
27432763

27442764
@dataclass
27452765
class UpdateLbRequest:
@@ -3108,6 +3128,11 @@ class ZonedApiCreateIpRequest:
31083128
Reverse DNS (domain name) for the IP address.
31093129
"""
31103130

3131+
tags: Optional[List[str]]
3132+
"""
3133+
List of tags for the IP.
3134+
"""
3135+
31113136
project_id: Optional[str]
31123137

31133138
organization_id: Optional[str]
@@ -3655,6 +3680,11 @@ class ZonedApiListIPsRequest:
36553680
IP type to filter for.
36563681
"""
36573682

3683+
tags: Optional[List[str]]
3684+
"""
3685+
Tag to filter for, only IPs with one or more matching tags will be returned.
3686+
"""
3687+
36583688

36593689
@dataclass
36603690
class ZonedApiListLbPrivateNetworksRequest:
@@ -4218,6 +4248,11 @@ class ZonedApiUpdateIpRequest:
42184248
ID of the server on which to attach the flexible IP.
42194249
"""
42204250

4251+
tags: Optional[List[str]]
4252+
"""
4253+
List of tags for the IP.
4254+
"""
4255+
42214256

42224257
@dataclass
42234258
class ZonedApiUpdateLbRequest:

0 commit comments

Comments
 (0)