Skip to content

feat(ipam): allow to list available IPs for given resource types #593

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
Jul 10, 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
6 changes: 6 additions & 0 deletions scaleway-async/scaleway_async/ipam/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ async def list_i_ps(
organization_id: Optional[str] = None,
is_ipv6: Optional[bool] = None,
resource_name: Optional[str] = None,
resource_types: Optional[List[ResourceType]] = None,
) -> ListIPsResponse:
"""
List existing IPs.
Expand All @@ -283,6 +284,7 @@ async def list_i_ps(
:param organization_id: Organization ID to filter for. Only IPs belonging to this Organization will be returned.
:param is_ipv6: Defines whether to filter only for IPv4s or IPv6s.
:param resource_name: Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned.
:param resource_types: Resource types to filter for. Only IPs attached to these types of resources will be returned.
:return: :class:`ListIPsResponse <ListIPsResponse>`

Usage:
Expand Down Expand Up @@ -311,6 +313,7 @@ async def list_i_ps(
"resource_id": resource_id,
"resource_name": resource_name,
"resource_type": resource_type,
"resource_types": resource_types,
"tags": tags,
"vpc_id": vpc_id,
**resolve_one_of(
Expand Down Expand Up @@ -346,6 +349,7 @@ async def list_i_ps_all(
organization_id: Optional[str] = None,
is_ipv6: Optional[bool] = None,
resource_name: Optional[str] = None,
resource_types: Optional[List[ResourceType]] = None,
) -> List[IP]:
"""
List existing IPs.
Expand All @@ -370,6 +374,7 @@ async def list_i_ps_all(
:param organization_id: Organization ID to filter for. Only IPs belonging to this Organization will be returned.
:param is_ipv6: Defines whether to filter only for IPv4s or IPv6s.
:param resource_name: Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned.
:param resource_types: Resource types to filter for. Only IPs attached to these types of resources will be returned.
:return: :class:`List[IP] <List[IP]>`

Usage:
Expand Down Expand Up @@ -397,6 +402,7 @@ async def list_i_ps_all(
"organization_id": organization_id,
"is_ipv6": is_ipv6,
"resource_name": resource_name,
"resource_types": resource_types,
"zonal": zonal,
"private_network_id": private_network_id,
"subnet_id": subnet_id,
Expand Down
5 changes: 5 additions & 0 deletions scaleway-async/scaleway_async/ipam/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ class ListIPsRequest:
Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned.
"""

resource_types: Optional[List[ResourceType]]
"""
Resource types to filter for. Only IPs attached to these types of resources will be returned.
"""

zonal: Optional[str]

private_network_id: Optional[str]
Expand Down
6 changes: 6 additions & 0 deletions scaleway/scaleway/ipam/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ def list_i_ps(
organization_id: Optional[str] = None,
is_ipv6: Optional[bool] = None,
resource_name: Optional[str] = None,
resource_types: Optional[List[ResourceType]] = None,
) -> ListIPsResponse:
"""
List existing IPs.
Expand All @@ -283,6 +284,7 @@ def list_i_ps(
:param organization_id: Organization ID to filter for. Only IPs belonging to this Organization will be returned.
:param is_ipv6: Defines whether to filter only for IPv4s or IPv6s.
:param resource_name: Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned.
:param resource_types: Resource types to filter for. Only IPs attached to these types of resources will be returned.
:return: :class:`ListIPsResponse <ListIPsResponse>`

Usage:
Expand Down Expand Up @@ -311,6 +313,7 @@ def list_i_ps(
"resource_id": resource_id,
"resource_name": resource_name,
"resource_type": resource_type,
"resource_types": resource_types,
"tags": tags,
"vpc_id": vpc_id,
**resolve_one_of(
Expand Down Expand Up @@ -346,6 +349,7 @@ def list_i_ps_all(
organization_id: Optional[str] = None,
is_ipv6: Optional[bool] = None,
resource_name: Optional[str] = None,
resource_types: Optional[List[ResourceType]] = None,
) -> List[IP]:
"""
List existing IPs.
Expand All @@ -370,6 +374,7 @@ def list_i_ps_all(
:param organization_id: Organization ID to filter for. Only IPs belonging to this Organization will be returned.
:param is_ipv6: Defines whether to filter only for IPv4s or IPv6s.
:param resource_name: Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned.
:param resource_types: Resource types to filter for. Only IPs attached to these types of resources will be returned.
:return: :class:`List[IP] <List[IP]>`

Usage:
Expand Down Expand Up @@ -397,6 +402,7 @@ def list_i_ps_all(
"organization_id": organization_id,
"is_ipv6": is_ipv6,
"resource_name": resource_name,
"resource_types": resource_types,
"zonal": zonal,
"private_network_id": private_network_id,
"subnet_id": subnet_id,
Expand Down
5 changes: 5 additions & 0 deletions scaleway/scaleway/ipam/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ class ListIPsRequest:
Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned.
"""

resource_types: Optional[List[ResourceType]]
"""
Resource types to filter for. Only IPs attached to these types of resources will be returned.
"""

zonal: Optional[str]

private_network_id: Optional[str]
Expand Down