Skip to content

Commit 4b1a765

Browse files
authored
feat(ipam): allow to list available IPs for given resource types (#593)
1 parent cfd8ee4 commit 4b1a765

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ async def list_i_ps(
259259
organization_id: Optional[str] = None,
260260
is_ipv6: Optional[bool] = None,
261261
resource_name: Optional[str] = None,
262+
resource_types: Optional[List[ResourceType]] = None,
262263
) -> ListIPsResponse:
263264
"""
264265
List existing IPs.
@@ -283,6 +284,7 @@ async def list_i_ps(
283284
:param organization_id: Organization ID to filter for. Only IPs belonging to this Organization will be returned.
284285
:param is_ipv6: Defines whether to filter only for IPv4s or IPv6s.
285286
:param resource_name: Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned.
287+
:param resource_types: Resource types to filter for. Only IPs attached to these types of resources will be returned.
286288
:return: :class:`ListIPsResponse <ListIPsResponse>`
287289
288290
Usage:
@@ -311,6 +313,7 @@ async def list_i_ps(
311313
"resource_id": resource_id,
312314
"resource_name": resource_name,
313315
"resource_type": resource_type,
316+
"resource_types": resource_types,
314317
"tags": tags,
315318
"vpc_id": vpc_id,
316319
**resolve_one_of(
@@ -346,6 +349,7 @@ async def list_i_ps_all(
346349
organization_id: Optional[str] = None,
347350
is_ipv6: Optional[bool] = None,
348351
resource_name: Optional[str] = None,
352+
resource_types: Optional[List[ResourceType]] = None,
349353
) -> List[IP]:
350354
"""
351355
List existing IPs.
@@ -370,6 +374,7 @@ async def list_i_ps_all(
370374
:param organization_id: Organization ID to filter for. Only IPs belonging to this Organization will be returned.
371375
:param is_ipv6: Defines whether to filter only for IPv4s or IPv6s.
372376
:param resource_name: Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned.
377+
:param resource_types: Resource types to filter for. Only IPs attached to these types of resources will be returned.
373378
:return: :class:`List[IP] <List[IP]>`
374379
375380
Usage:
@@ -397,6 +402,7 @@ async def list_i_ps_all(
397402
"organization_id": organization_id,
398403
"is_ipv6": is_ipv6,
399404
"resource_name": resource_name,
405+
"resource_types": resource_types,
400406
"zonal": zonal,
401407
"private_network_id": private_network_id,
402408
"subnet_id": subnet_id,

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,11 @@ class ListIPsRequest:
275275
Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned.
276276
"""
277277

278+
resource_types: Optional[List[ResourceType]]
279+
"""
280+
Resource types to filter for. Only IPs attached to these types of resources will be returned.
281+
"""
282+
278283
zonal: Optional[str]
279284

280285
private_network_id: Optional[str]

scaleway/scaleway/ipam/v1/api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ def list_i_ps(
259259
organization_id: Optional[str] = None,
260260
is_ipv6: Optional[bool] = None,
261261
resource_name: Optional[str] = None,
262+
resource_types: Optional[List[ResourceType]] = None,
262263
) -> ListIPsResponse:
263264
"""
264265
List existing IPs.
@@ -283,6 +284,7 @@ def list_i_ps(
283284
:param organization_id: Organization ID to filter for. Only IPs belonging to this Organization will be returned.
284285
:param is_ipv6: Defines whether to filter only for IPv4s or IPv6s.
285286
:param resource_name: Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned.
287+
:param resource_types: Resource types to filter for. Only IPs attached to these types of resources will be returned.
286288
:return: :class:`ListIPsResponse <ListIPsResponse>`
287289
288290
Usage:
@@ -311,6 +313,7 @@ def list_i_ps(
311313
"resource_id": resource_id,
312314
"resource_name": resource_name,
313315
"resource_type": resource_type,
316+
"resource_types": resource_types,
314317
"tags": tags,
315318
"vpc_id": vpc_id,
316319
**resolve_one_of(
@@ -346,6 +349,7 @@ def list_i_ps_all(
346349
organization_id: Optional[str] = None,
347350
is_ipv6: Optional[bool] = None,
348351
resource_name: Optional[str] = None,
352+
resource_types: Optional[List[ResourceType]] = None,
349353
) -> List[IP]:
350354
"""
351355
List existing IPs.
@@ -370,6 +374,7 @@ def list_i_ps_all(
370374
:param organization_id: Organization ID to filter for. Only IPs belonging to this Organization will be returned.
371375
:param is_ipv6: Defines whether to filter only for IPv4s or IPv6s.
372376
:param resource_name: Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned.
377+
:param resource_types: Resource types to filter for. Only IPs attached to these types of resources will be returned.
373378
:return: :class:`List[IP] <List[IP]>`
374379
375380
Usage:
@@ -397,6 +402,7 @@ def list_i_ps_all(
397402
"organization_id": organization_id,
398403
"is_ipv6": is_ipv6,
399404
"resource_name": resource_name,
405+
"resource_types": resource_types,
400406
"zonal": zonal,
401407
"private_network_id": private_network_id,
402408
"subnet_id": subnet_id,

scaleway/scaleway/ipam/v1/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,11 @@ class ListIPsRequest:
275275
Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned.
276276
"""
277277

278+
resource_types: Optional[List[ResourceType]]
279+
"""
280+
Resource types to filter for. Only IPs attached to these types of resources will be returned.
281+
"""
282+
278283
zonal: Optional[str]
279284

280285
private_network_id: Optional[str]

0 commit comments

Comments
 (0)