From fac015688b744f541ddcf5d658cdc937e34c887e Mon Sep 17 00:00:00 2001 From: Scaleway Bot Date: Wed, 11 Dec 2024 16:05:56 +0100 Subject: [PATCH] feat(ipam): support filtering ips on ids (#789) --- scaleway-async/scaleway_async/ipam/v1/api.py | 26 ++++++++++++------- .../scaleway_async/ipam/v1/types.py | 19 +++++++++----- scaleway/scaleway/ipam/v1/api.py | 26 ++++++++++++------- scaleway/scaleway/ipam/v1/types.py | 19 +++++++++----- 4 files changed, 56 insertions(+), 34 deletions(-) diff --git a/scaleway-async/scaleway_async/ipam/v1/api.py b/scaleway-async/scaleway_async/ipam/v1/api.py index 6c8c1fca..9a82e016 100644 --- a/scaleway-async/scaleway_async/ipam/v1/api.py +++ b/scaleway-async/scaleway_async/ipam/v1/api.py @@ -262,15 +262,16 @@ async def list_i_ps( subnet_id: Optional[str] = None, vpc_id: Optional[str] = None, attached: Optional[bool] = None, + resource_name: Optional[str] = None, resource_id: Optional[str] = None, resource_ids: Optional[List[str]] = None, resource_type: Optional[ResourceType] = None, + resource_types: Optional[List[ResourceType]] = None, mac_address: Optional[str] = None, tags: Optional[List[str]] = None, organization_id: Optional[str] = None, is_ipv6: Optional[bool] = None, - resource_name: Optional[str] = None, - resource_types: Optional[List[ResourceType]] = None, + ip_ids: Optional[List[str]] = None, ) -> ListIPsResponse: """ List existing IPs. @@ -288,15 +289,16 @@ async def list_i_ps( One-Of ('source'): at most one of 'zonal', 'private_network_id', 'subnet_id' could be set. :param vpc_id: Only IPs owned by resources in this VPC will be returned. :param attached: Defines whether to filter only for IPs which are attached to a resource. + :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_id: Resource ID to filter for. Only IPs attached to this resource will be returned. :param resource_ids: Resource IDs to filter for. Only IPs attached to at least one of these resources will be returned. :param resource_type: Resource type to filter for. Only IPs attached to this type of resource will be returned. + :param resource_types: Resource types to filter for. Only IPs attached to these types of resources will be returned. :param mac_address: MAC address to filter for. Only IPs attached to a resource with this MAC address will be returned. :param tags: Tags to filter for, only IPs with one or more matching tags will be returned. :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. + :param ip_ids: IP IDs to filter for. Only IPs with these UUIDs will be returned. :return: :class:`ListIPsResponse ` Usage: @@ -314,6 +316,7 @@ async def list_i_ps( f"/ipam/v1/regions/{param_region}/ips", params={ "attached": attached, + "ip_ids": ip_ids, "is_ipv6": is_ipv6, "mac_address": mac_address, "order_by": order_by, @@ -355,15 +358,16 @@ async def list_i_ps_all( subnet_id: Optional[str] = None, vpc_id: Optional[str] = None, attached: Optional[bool] = None, + resource_name: Optional[str] = None, resource_id: Optional[str] = None, resource_ids: Optional[List[str]] = None, resource_type: Optional[ResourceType] = None, + resource_types: Optional[List[ResourceType]] = None, mac_address: Optional[str] = None, tags: Optional[List[str]] = None, organization_id: Optional[str] = None, is_ipv6: Optional[bool] = None, - resource_name: Optional[str] = None, - resource_types: Optional[List[ResourceType]] = None, + ip_ids: Optional[List[str]] = None, ) -> List[IP]: """ List existing IPs. @@ -381,15 +385,16 @@ async def list_i_ps_all( One-Of ('source'): at most one of 'zonal', 'private_network_id', 'subnet_id' could be set. :param vpc_id: Only IPs owned by resources in this VPC will be returned. :param attached: Defines whether to filter only for IPs which are attached to a resource. + :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_id: Resource ID to filter for. Only IPs attached to this resource will be returned. :param resource_ids: Resource IDs to filter for. Only IPs attached to at least one of these resources will be returned. :param resource_type: Resource type to filter for. Only IPs attached to this type of resource will be returned. + :param resource_types: Resource types to filter for. Only IPs attached to these types of resources will be returned. :param mac_address: MAC address to filter for. Only IPs attached to a resource with this MAC address will be returned. :param tags: Tags to filter for, only IPs with one or more matching tags will be returned. :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. + :param ip_ids: IP IDs to filter for. Only IPs with these UUIDs will be returned. :return: :class:`List[IP] ` Usage: @@ -410,15 +415,16 @@ async def list_i_ps_all( "project_id": project_id, "vpc_id": vpc_id, "attached": attached, + "resource_name": resource_name, "resource_id": resource_id, "resource_ids": resource_ids, "resource_type": resource_type, + "resource_types": resource_types, "mac_address": mac_address, "tags": tags, "organization_id": organization_id, "is_ipv6": is_ipv6, - "resource_name": resource_name, - "resource_types": resource_types, + "ip_ids": ip_ids, "zonal": zonal, "private_network_id": private_network_id, "subnet_id": subnet_id, diff --git a/scaleway-async/scaleway_async/ipam/v1/types.py b/scaleway-async/scaleway_async/ipam/v1/types.py index fc2ebc59..f9504238 100644 --- a/scaleway-async/scaleway_async/ipam/v1/types.py +++ b/scaleway-async/scaleway_async/ipam/v1/types.py @@ -298,6 +298,11 @@ class ListIPsRequest: Defines whether to filter only for IPs which are attached to a resource. """ + resource_name: Optional[str] + """ + Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned. + """ + resource_id: Optional[str] """ Resource ID to filter for. Only IPs attached to this resource will be returned. @@ -313,6 +318,11 @@ class ListIPsRequest: Resource type to filter for. Only IPs attached to this type of resource will be returned. """ + resource_types: Optional[List[ResourceType]] + """ + Resource types to filter for. Only IPs attached to these types of resources will be returned. + """ + mac_address: Optional[str] """ MAC address to filter for. Only IPs attached to a resource with this MAC address will be returned. @@ -333,14 +343,9 @@ class ListIPsRequest: Defines whether to filter only for IPv4s or IPv6s. """ - resource_name: Optional[str] - """ - 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]] + ip_ids: Optional[List[str]] """ - Resource types to filter for. Only IPs attached to these types of resources will be returned. + IP IDs to filter for. Only IPs with these UUIDs will be returned. """ zonal: Optional[str] diff --git a/scaleway/scaleway/ipam/v1/api.py b/scaleway/scaleway/ipam/v1/api.py index bbbe3960..8b6e3f35 100644 --- a/scaleway/scaleway/ipam/v1/api.py +++ b/scaleway/scaleway/ipam/v1/api.py @@ -262,15 +262,16 @@ def list_i_ps( subnet_id: Optional[str] = None, vpc_id: Optional[str] = None, attached: Optional[bool] = None, + resource_name: Optional[str] = None, resource_id: Optional[str] = None, resource_ids: Optional[List[str]] = None, resource_type: Optional[ResourceType] = None, + resource_types: Optional[List[ResourceType]] = None, mac_address: Optional[str] = None, tags: Optional[List[str]] = None, organization_id: Optional[str] = None, is_ipv6: Optional[bool] = None, - resource_name: Optional[str] = None, - resource_types: Optional[List[ResourceType]] = None, + ip_ids: Optional[List[str]] = None, ) -> ListIPsResponse: """ List existing IPs. @@ -288,15 +289,16 @@ def list_i_ps( One-Of ('source'): at most one of 'zonal', 'private_network_id', 'subnet_id' could be set. :param vpc_id: Only IPs owned by resources in this VPC will be returned. :param attached: Defines whether to filter only for IPs which are attached to a resource. + :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_id: Resource ID to filter for. Only IPs attached to this resource will be returned. :param resource_ids: Resource IDs to filter for. Only IPs attached to at least one of these resources will be returned. :param resource_type: Resource type to filter for. Only IPs attached to this type of resource will be returned. + :param resource_types: Resource types to filter for. Only IPs attached to these types of resources will be returned. :param mac_address: MAC address to filter for. Only IPs attached to a resource with this MAC address will be returned. :param tags: Tags to filter for, only IPs with one or more matching tags will be returned. :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. + :param ip_ids: IP IDs to filter for. Only IPs with these UUIDs will be returned. :return: :class:`ListIPsResponse ` Usage: @@ -314,6 +316,7 @@ def list_i_ps( f"/ipam/v1/regions/{param_region}/ips", params={ "attached": attached, + "ip_ids": ip_ids, "is_ipv6": is_ipv6, "mac_address": mac_address, "order_by": order_by, @@ -355,15 +358,16 @@ def list_i_ps_all( subnet_id: Optional[str] = None, vpc_id: Optional[str] = None, attached: Optional[bool] = None, + resource_name: Optional[str] = None, resource_id: Optional[str] = None, resource_ids: Optional[List[str]] = None, resource_type: Optional[ResourceType] = None, + resource_types: Optional[List[ResourceType]] = None, mac_address: Optional[str] = None, tags: Optional[List[str]] = None, organization_id: Optional[str] = None, is_ipv6: Optional[bool] = None, - resource_name: Optional[str] = None, - resource_types: Optional[List[ResourceType]] = None, + ip_ids: Optional[List[str]] = None, ) -> List[IP]: """ List existing IPs. @@ -381,15 +385,16 @@ def list_i_ps_all( One-Of ('source'): at most one of 'zonal', 'private_network_id', 'subnet_id' could be set. :param vpc_id: Only IPs owned by resources in this VPC will be returned. :param attached: Defines whether to filter only for IPs which are attached to a resource. + :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_id: Resource ID to filter for. Only IPs attached to this resource will be returned. :param resource_ids: Resource IDs to filter for. Only IPs attached to at least one of these resources will be returned. :param resource_type: Resource type to filter for. Only IPs attached to this type of resource will be returned. + :param resource_types: Resource types to filter for. Only IPs attached to these types of resources will be returned. :param mac_address: MAC address to filter for. Only IPs attached to a resource with this MAC address will be returned. :param tags: Tags to filter for, only IPs with one or more matching tags will be returned. :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. + :param ip_ids: IP IDs to filter for. Only IPs with these UUIDs will be returned. :return: :class:`List[IP] ` Usage: @@ -410,15 +415,16 @@ def list_i_ps_all( "project_id": project_id, "vpc_id": vpc_id, "attached": attached, + "resource_name": resource_name, "resource_id": resource_id, "resource_ids": resource_ids, "resource_type": resource_type, + "resource_types": resource_types, "mac_address": mac_address, "tags": tags, "organization_id": organization_id, "is_ipv6": is_ipv6, - "resource_name": resource_name, - "resource_types": resource_types, + "ip_ids": ip_ids, "zonal": zonal, "private_network_id": private_network_id, "subnet_id": subnet_id, diff --git a/scaleway/scaleway/ipam/v1/types.py b/scaleway/scaleway/ipam/v1/types.py index fc2ebc59..f9504238 100644 --- a/scaleway/scaleway/ipam/v1/types.py +++ b/scaleway/scaleway/ipam/v1/types.py @@ -298,6 +298,11 @@ class ListIPsRequest: Defines whether to filter only for IPs which are attached to a resource. """ + resource_name: Optional[str] + """ + Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned. + """ + resource_id: Optional[str] """ Resource ID to filter for. Only IPs attached to this resource will be returned. @@ -313,6 +318,11 @@ class ListIPsRequest: Resource type to filter for. Only IPs attached to this type of resource will be returned. """ + resource_types: Optional[List[ResourceType]] + """ + Resource types to filter for. Only IPs attached to these types of resources will be returned. + """ + mac_address: Optional[str] """ MAC address to filter for. Only IPs attached to a resource with this MAC address will be returned. @@ -333,14 +343,9 @@ class ListIPsRequest: Defines whether to filter only for IPv4s or IPv6s. """ - resource_name: Optional[str] - """ - 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]] + ip_ids: Optional[List[str]] """ - Resource types to filter for. Only IPs attached to these types of resources will be returned. + IP IDs to filter for. Only IPs with these UUIDs will be returned. """ zonal: Optional[str]