Skip to content

feat(lb): publish flexible ip tags feature #513

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 3, 2024
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
24 changes: 24 additions & 0 deletions scaleway-async/scaleway_async/lb/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ async def list_i_ps(
organization_id: Optional[str] = None,
project_id: Optional[str] = None,
ip_type: Optional[ListIpsRequestIpType] = None,
tags: Optional[List[str]] = None,
) -> ListIpsResponse:
"""
List IP addresses.
Expand All @@ -596,6 +597,7 @@ async def list_i_ps(
:param organization_id: Organization ID to filter for, only Load Balancer IP addresses from this Organization will be returned.
:param project_id: Project ID to filter for, only Load Balancer IP addresses from this Project will be returned.
:param ip_type: IP type to filter for.
:param tags: Tag to filter for, only IPs with one or more matching tags will be returned.
:return: :class:`ListIpsResponse <ListIpsResponse>`

Usage:
Expand All @@ -617,6 +619,7 @@ async def list_i_ps(
"page": page,
"page_size": page_size or self.client.default_page_size,
"project_id": project_id or self.client.default_project_id,
"tags": tags,
},
)

Expand All @@ -633,6 +636,7 @@ async def list_i_ps_all(
organization_id: Optional[str] = None,
project_id: Optional[str] = None,
ip_type: Optional[ListIpsRequestIpType] = None,
tags: Optional[List[str]] = None,
) -> List[Ip]:
"""
List IP addresses.
Expand All @@ -644,6 +648,7 @@ async def list_i_ps_all(
:param organization_id: Organization ID to filter for, only Load Balancer IP addresses from this Organization will be returned.
:param project_id: Project ID to filter for, only Load Balancer IP addresses from this Project will be returned.
:param ip_type: IP type to filter for.
:param tags: Tag to filter for, only IPs with one or more matching tags will be returned.
:return: :class:`List[Ip] <List[Ip]>`

Usage:
Expand All @@ -664,6 +669,7 @@ async def list_i_ps_all(
"organization_id": organization_id,
"project_id": project_id,
"ip_type": ip_type,
"tags": tags,
},
)

Expand All @@ -675,6 +681,7 @@ async def create_ip(
organization_id: Optional[str] = None,
project_id: Optional[str] = None,
reverse: Optional[str] = None,
tags: Optional[List[str]] = None,
) -> Ip:
"""
Create an IP address.
Expand All @@ -686,6 +693,7 @@ async def create_ip(
:param project_id: Project ID of the Project where the IP address should be created.
One-Of ('project_identifier'): at most one of 'project_id', 'organization_id' could be set.
:param reverse: Reverse DNS (domain name) for the IP address.
:param tags: List of tags for the IP.
:return: :class:`Ip <Ip>`

Usage:
Expand All @@ -706,6 +714,7 @@ async def create_ip(
is_ipv6=is_ipv6,
zone=zone,
reverse=reverse,
tags=tags,
project_id=project_id,
organization_id=organization_id,
),
Expand Down Expand Up @@ -785,6 +794,7 @@ async def update_ip(
zone: Optional[Zone] = None,
reverse: Optional[str] = None,
lb_id: Optional[str] = None,
tags: Optional[List[str]] = None,
) -> Ip:
"""
Update an IP address.
Expand All @@ -793,6 +803,7 @@ async def update_ip(
:param zone: Zone to target. If none is passed will use default zone from the config.
:param reverse: Reverse DNS (domain name) for the IP address.
:param lb_id: ID of the server on which to attach the flexible IP.
:param tags: List of tags for the IP.
:return: :class:`Ip <Ip>`

Usage:
Expand All @@ -815,6 +826,7 @@ async def update_ip(
zone=zone,
reverse=reverse,
lb_id=lb_id,
tags=tags,
),
self.client,
),
Expand Down Expand Up @@ -3592,6 +3604,7 @@ async def list_i_ps(
organization_id: Optional[str] = None,
project_id: Optional[str] = None,
ip_type: Optional[ListIpsRequestIpType] = None,
tags: Optional[List[str]] = None,
) -> ListIpsResponse:
"""
List IPs.
Expand All @@ -3602,6 +3615,7 @@ async def list_i_ps(
:param organization_id: Organization ID to filter for, only Load Balancer IP addresses from this Organization will be returned.
:param project_id: Project ID to filter for, only Load Balancer IP addresses from this Project will be returned.
:param ip_type: IP type to filter for.
:param tags: Tag to filter for, only IPs with one or more matching tags will be returned.
:return: :class:`ListIpsResponse <ListIpsResponse>`

Usage:
Expand All @@ -3625,6 +3639,7 @@ async def list_i_ps(
"page": page,
"page_size": page_size or self.client.default_page_size,
"project_id": project_id or self.client.default_project_id,
"tags": tags,
},
)

Expand All @@ -3641,6 +3656,7 @@ async def list_i_ps_all(
organization_id: Optional[str] = None,
project_id: Optional[str] = None,
ip_type: Optional[ListIpsRequestIpType] = None,
tags: Optional[List[str]] = None,
) -> List[Ip]:
"""
List IPs.
Expand All @@ -3651,6 +3667,7 @@ async def list_i_ps_all(
:param organization_id: Organization ID to filter for, only Load Balancer IP addresses from this Organization will be returned.
:param project_id: Project ID to filter for, only Load Balancer IP addresses from this Project will be returned.
:param ip_type: IP type to filter for.
:param tags: Tag to filter for, only IPs with one or more matching tags will be returned.
:return: :class:`List[Ip] <List[Ip]>`

Usage:
Expand All @@ -3671,6 +3688,7 @@ async def list_i_ps_all(
"organization_id": organization_id,
"project_id": project_id,
"ip_type": ip_type,
"tags": tags,
},
)

Expand All @@ -3682,6 +3700,7 @@ async def create_ip(
organization_id: Optional[str] = None,
project_id: Optional[str] = None,
reverse: Optional[str] = None,
tags: Optional[List[str]] = None,
) -> Ip:
"""
Create an IP.
Expand All @@ -3692,6 +3711,7 @@ async def create_ip(
:param project_id: Project ID of the Project where the IP address should be created.
One-Of ('project_identifier'): at most one of 'project_id', 'organization_id' could be set.
:param reverse: Reverse DNS (domain name) for the IP address.
:param tags: List of tags for the IP.
:return: :class:`Ip <Ip>`

Usage:
Expand All @@ -3714,6 +3734,7 @@ async def create_ip(
is_ipv6=is_ipv6,
region=region,
reverse=reverse,
tags=tags,
project_id=project_id,
organization_id=organization_id,
),
Expand Down Expand Up @@ -3795,13 +3816,15 @@ async def update_ip(
region: Optional[Region] = None,
reverse: Optional[str] = None,
lb_id: Optional[str] = None,
tags: Optional[List[str]] = None,
) -> Ip:
"""
Update an IP.
:param ip_id: IP address ID.
:param region: Region to target. If none is passed will use default region from the config.
:param reverse: Reverse DNS (domain name) for the IP address.
:param lb_id: ID of the server on which to attach the flexible IP.
:param tags: List of tags for the IP.
:return: :class:`Ip <Ip>`

Usage:
Expand All @@ -3826,6 +3849,7 @@ async def update_ip(
region=region,
reverse=reverse,
lb_id=lb_id,
tags=tags,
),
self.client,
),
Expand Down
16 changes: 16 additions & 0 deletions scaleway-async/scaleway_async/lb/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ def unmarshal_Ip(data: Any) -> Ip:
if field is not None:
args["reverse"] = field

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

field = data.get("zone", None)
if field is not None:
args["zone"] = field
Expand Down Expand Up @@ -1950,6 +1954,9 @@ def marshal_CreateIpRequest(
if request.reverse is not None:
output["reverse"] = request.reverse

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

return output


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

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

return output


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

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

return output


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

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

return output


Expand Down
35 changes: 35 additions & 0 deletions scaleway-async/scaleway_async/lb/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,11 @@ class Ip:
Reverse DNS (domain name) of the IP address.
"""

tags: List[str]
"""
IP tags.
"""

zone: Zone
"""
The zone the IP address is in.
Expand Down Expand Up @@ -1484,6 +1489,11 @@ class CreateIpRequest:
Reverse DNS (domain name) for the IP address.
"""

tags: Optional[List[str]]
"""
List of tags for the IP.
"""

project_id: Optional[str]

organization_id: Optional[str]
Expand Down Expand Up @@ -2104,6 +2114,11 @@ class ListIPsRequest:
IP type to filter for.
"""

tags: Optional[List[str]]
"""
Tag to filter for, only IPs with one or more matching tags will be returned.
"""


@dataclass
class ListIpsResponse:
Expand Down Expand Up @@ -2740,6 +2755,11 @@ class UpdateIpRequest:
ID of the server on which to attach the flexible IP.
"""

tags: Optional[List[str]]
"""
List of tags for the IP.
"""


@dataclass
class UpdateLbRequest:
Expand Down Expand Up @@ -3108,6 +3128,11 @@ class ZonedApiCreateIpRequest:
Reverse DNS (domain name) for the IP address.
"""

tags: Optional[List[str]]
"""
List of tags for the IP.
"""

project_id: Optional[str]

organization_id: Optional[str]
Expand Down Expand Up @@ -3655,6 +3680,11 @@ class ZonedApiListIPsRequest:
IP type to filter for.
"""

tags: Optional[List[str]]
"""
Tag to filter for, only IPs with one or more matching tags will be returned.
"""


@dataclass
class ZonedApiListLbPrivateNetworksRequest:
Expand Down Expand Up @@ -4218,6 +4248,11 @@ class ZonedApiUpdateIpRequest:
ID of the server on which to attach the flexible IP.
"""

tags: Optional[List[str]]
"""
List of tags for the IP.
"""


@dataclass
class ZonedApiUpdateLbRequest:
Expand Down
Loading