scaleway_async.ipam.v1 package

Submodules

scaleway_async.ipam.v1.api module

class scaleway_async.ipam.v1.api.IpamV1API(client: Client, *, bypass_validation: bool = False)

Bases: API

This API allows you to manage your Scaleway IP addresses with our IP Address Management tool.

async attach_ip(*, ip_id: str, resource: CustomResource, region: str | None = None) IP

Attach IP to custom resource. Attach an existing reserved IP from a Private Network subnet to a custom, named resource via its MAC address. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this method for attaching IP addresses to standard Scaleway resources as it will fail - see the relevant product API for an equivalent method. :param ip_id: IP ID. :param resource: Custom resource to be attached to the IP. :param region: Region to target. If none is passed will use default region from the config. :return: IP

Usage:

result = await api.attach_ip(
    ip_id="example",
    resource=CustomResource(),
)
async book_ip(*, source: Source, is_ipv6: bool, region: str | None = None, project_id: str | None = None, address: str | None = None, tags: List[str] | None = None, resource: CustomResource | None = None) IP

Reserve a new IP. Reserve a new IP from the specified source. Currently IPs can only be reserved from a Private Network. :param source: Source in which to reserve the IP. Not all sources are available for reservation. :param is_ipv6: Request an IPv6 instead of an IPv4. :param region: Region to target. If none is passed will use default region from the config. :param project_id: When creating an IP in a Private Network, the Project must match the Private Network’s Project. :param address: The requested address should not include the subnet mask (/suffix). Note that only the Private Network source allows you to pick a specific IP. If the requested IP is already reserved, then the call will fail. :param tags: Tags for the IP. :param resource: Custom resource to attach to the IP being reserved. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this for attaching IP addresses to standard Scaleway resources, as it will fail - instead, see the relevant product API for an equivalent method. :return: IP

Usage:

result = await api.book_ip(
    source=Source(),
    is_ipv6=False,
)
async detach_ip(*, ip_id: str, resource: CustomResource, region: str | None = None) IP

Detach IP from a custom resource. Detach a private IP from a custom resource. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this method for detaching IP addresses from standard Scaleway resources (e.g. Instances, Load Balancers) as it will fail - see the relevant product API for an equivalent method. :param ip_id: IP ID. :param resource: Custom resource currently attached to the IP. :param region: Region to target. If none is passed will use default region from the config. :return: IP

Usage:

result = await api.detach_ip(
    ip_id="example",
    resource=CustomResource(),
)
async get_ip(*, ip_id: str, region: str | None = None) IP

Get an IP. Retrieve details of an existing IP, specified by its IP ID. :param ip_id: IP ID. :param region: Region to target. If none is passed will use default region from the config. :return: IP

Usage:

result = await api.get_ip(
    ip_id="example",
)
async list_i_ps(*, region: str | None = None, order_by: ListIPsRequestOrderBy | None = None, page: int | None = None, page_size: int | None = None, project_id: str | None = None, zonal: str | None = None, private_network_id: str | None = None, subnet_id: str | None = None, vpc_id: str | None = None, attached: bool | None = None, resource_name: str | None = None, resource_id: str | None = None, resource_ids: List[str] | None = None, resource_type: ResourceType | None = None, resource_types: List[ResourceType] | None = None, mac_address: str | None = None, tags: List[str] | None = None, organization_id: str | None = None, is_ipv6: bool | None = None, ip_ids: List[str] | None = None, source_vpc_id: str | None = None) ListIPsResponse

List existing IPs. List existing IPs in the specified region using various filters. For example, you can filter for IPs within a specified Private Network, or for public IPs within a specified Project. By default, the IPs returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. :param region: Region to target. If none is passed will use default region from the config. :param order_by: Sort order of the returned IPs. :param page: Page number to return, from the paginated results. :param page_size: Maximum number of IPs to return per page. :param project_id: Project ID to filter for. Only IPs belonging to this Project will be returned. :param zonal: Zone to filter for. Only IPs that are zonal, and in this zone, will be returned. One-Of (‘source’): at most one of ‘zonal’, ‘private_network_id’, ‘subnet_id’, ‘source_vpc_id’ could be set. :param private_network_id: Only IPs that are private, and in this Private Network, will be returned. One-Of (‘source’): at most one of ‘zonal’, ‘private_network_id’, ‘subnet_id’, ‘source_vpc_id’ could be set. :param subnet_id: Only IPs inside this exact subnet will be returned. One-Of (‘source’): at most one of ‘zonal’, ‘private_network_id’, ‘subnet_id’, ‘source_vpc_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 ip_ids: IP IDs to filter for. Only IPs with these UUIDs will be returned. :param source_vpc_id: One-Of (‘source’): at most one of ‘zonal’, ‘private_network_id’, ‘subnet_id’, ‘source_vpc_id’ could be set. :return: ListIPsResponse

Usage:

result = await api.list_i_ps()
async list_i_ps_all(*, region: str | None = None, order_by: ListIPsRequestOrderBy | None = None, page: int | None = None, page_size: int | None = None, project_id: str | None = None, zonal: str | None = None, private_network_id: str | None = None, subnet_id: str | None = None, vpc_id: str | None = None, attached: bool | None = None, resource_name: str | None = None, resource_id: str | None = None, resource_ids: List[str] | None = None, resource_type: ResourceType | None = None, resource_types: List[ResourceType] | None = None, mac_address: str | None = None, tags: List[str] | None = None, organization_id: str | None = None, is_ipv6: bool | None = None, ip_ids: List[str] | None = None, source_vpc_id: str | None = None) List[IP]

List existing IPs. List existing IPs in the specified region using various filters. For example, you can filter for IPs within a specified Private Network, or for public IPs within a specified Project. By default, the IPs returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. :param region: Region to target. If none is passed will use default region from the config. :param order_by: Sort order of the returned IPs. :param page: Page number to return, from the paginated results. :param page_size: Maximum number of IPs to return per page. :param project_id: Project ID to filter for. Only IPs belonging to this Project will be returned. :param zonal: Zone to filter for. Only IPs that are zonal, and in this zone, will be returned. One-Of (‘source’): at most one of ‘zonal’, ‘private_network_id’, ‘subnet_id’, ‘source_vpc_id’ could be set. :param private_network_id: Only IPs that are private, and in this Private Network, will be returned. One-Of (‘source’): at most one of ‘zonal’, ‘private_network_id’, ‘subnet_id’, ‘source_vpc_id’ could be set. :param subnet_id: Only IPs inside this exact subnet will be returned. One-Of (‘source’): at most one of ‘zonal’, ‘private_network_id’, ‘subnet_id’, ‘source_vpc_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 ip_ids: IP IDs to filter for. Only IPs with these UUIDs will be returned. :param source_vpc_id: One-Of (‘source’): at most one of ‘zonal’, ‘private_network_id’, ‘subnet_id’, ‘source_vpc_id’ could be set. :return: List[IP]

Usage:

result = await api.list_i_ps_all()
async move_ip(*, ip_id: str, from_resource: CustomResource, region: str | None = None, to_resource: CustomResource | None = None) IP

Move IP to a custom resource. Move an existing reserved private IP from one custom resource (e.g. a virtual machine hosted on an Elastic Metal server) to another custom resource. This will detach it from the first resource, and attach it to the second. Do not use this method for moving IP addresses between standard Scaleway resources (e.g. Instances, Load Balancers) as it will fail - see the relevant product API for an equivalent method. :param ip_id: IP ID. :param from_resource: Custom resource currently attached to the IP. :param region: Region to target. If none is passed will use default region from the config. :param to_resource: Custom resource to be attached to the IP. :return: IP

Usage:

result = await api.move_ip(
    ip_id="example",
    from_resource=CustomResource(),
)
async release_ip(*, ip_id: str, region: str | None = None) None

Release an IP. Release an IP not currently attached to a resource, and returns it to the available IP pool. :param ip_id: IP ID. :param region: Region to target. If none is passed will use default region from the config.

Usage:

result = await api.release_ip(
    ip_id="example",
)
async release_ip_set(*, region: str | None = None, ip_ids: List[str] | None = None) None
Parameters:
  • region – Region to target. If none is passed will use default region from the config.

  • ip_ids

Usage:

result = await api.release_ip_set()
async update_ip(*, ip_id: str, region: str | None = None, tags: List[str] | None = None, reverses: List[Reverse] | None = None) IP

Update an IP. Update parameters including tags of the specified IP. :param ip_id: IP ID. :param region: Region to target. If none is passed will use default region from the config. :param tags: Tags for the IP. :param reverses: Array of reverse domain names associated with an IP in the subnet of the current IP. :return: IP

Usage:

result = await api.update_ip(
    ip_id="example",
)

scaleway_async.ipam.v1.marshalling module

scaleway_async.ipam.v1.marshalling.marshal_AttachIPRequest(request: AttachIPRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.ipam.v1.marshalling.marshal_BookIPRequest(request: BookIPRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.ipam.v1.marshalling.marshal_CustomResource(request: CustomResource, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.ipam.v1.marshalling.marshal_DetachIPRequest(request: DetachIPRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.ipam.v1.marshalling.marshal_MoveIPRequest(request: MoveIPRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.ipam.v1.marshalling.marshal_ReleaseIPSetRequest(request: ReleaseIPSetRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.ipam.v1.marshalling.marshal_Reverse(request: Reverse, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.ipam.v1.marshalling.marshal_Source(request: Source, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.ipam.v1.marshalling.marshal_UpdateIPRequest(request: UpdateIPRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway_async.ipam.v1.marshalling.unmarshal_IP(data: Any) IP
scaleway_async.ipam.v1.marshalling.unmarshal_ListIPsResponse(data: Any) ListIPsResponse
scaleway_async.ipam.v1.marshalling.unmarshal_Resource(data: Any) Resource
scaleway_async.ipam.v1.marshalling.unmarshal_Reverse(data: Any) Reverse
scaleway_async.ipam.v1.marshalling.unmarshal_Source(data: Any) Source

scaleway_async.ipam.v1.types module

class scaleway_async.ipam.v1.types.AttachIPRequest(ip_id: 'str', resource: 'CustomResource', region: 'Optional[ScwRegion]' = None)

Bases: object

ip_id: str

IP ID.

region: str | None = None

Region to target. If none is passed will use default region from the config.

resource: CustomResource

Custom resource to be attached to the IP.

class scaleway_async.ipam.v1.types.BookIPRequest(source: 'Source', is_ipv6: 'bool', region: 'Optional[ScwRegion]' = None, project_id: 'Optional[str]' = None, address: 'Optional[str]' = None, tags: 'Optional[List[str]]' = <factory>, resource: 'Optional[CustomResource]' = None)

Bases: object

address: str | None = None

The requested address should not include the subnet mask (/suffix). Note that only the Private Network source allows you to pick a specific IP. If the requested IP is already reserved, then the call will fail.

is_ipv6: bool

Request an IPv6 instead of an IPv4.

project_id: str | None = None

When creating an IP in a Private Network, the Project must match the Private Network’s Project.

region: str | None = None

Region to target. If none is passed will use default region from the config.

resource: CustomResource | None = None

Custom resource to attach to the IP being reserved. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this for attaching IP addresses to standard Scaleway resources, as it will fail - instead, see the relevant product API for an equivalent method.

source: Source

Source in which to reserve the IP. Not all sources are available for reservation.

tags: List[str] | None

Tags for the IP.

class scaleway_async.ipam.v1.types.CustomResource(mac_address: 'str', name: 'Optional[str]' = None)

Bases: object

mac_address: str

MAC address of the custom resource.

name: str | None = None

When the resource is in a Private Network, a DNS record is available to resolve the resource name.

class scaleway_async.ipam.v1.types.DetachIPRequest(ip_id: 'str', resource: 'CustomResource', region: 'Optional[ScwRegion]' = None)

Bases: object

ip_id: str

IP ID.

region: str | None = None

Region to target. If none is passed will use default region from the config.

resource: CustomResource

Custom resource currently attached to the IP.

class scaleway_async.ipam.v1.types.GetIPRequest(ip_id: 'str', region: 'Optional[ScwRegion]' = None)

Bases: object

ip_id: str

IP ID.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway_async.ipam.v1.types.IP(id: 'str', address: 'str', project_id: 'str', is_ipv6: 'bool', tags: 'List[str]', reverses: 'List[Reverse]', region: 'ScwRegion', created_at: 'Optional[datetime]' = None, updated_at: 'Optional[datetime]' = None, source: 'Optional[Source]' = None, resource: 'Optional[Resource]' = None, zone: 'Optional[ScwZone]' = None)

Bases: object

address: str

IPv4 or IPv6 address in CIDR notation.

created_at: datetime | None = None

Date the IP was reserved.

id: str

IP ID.

is_ipv6: bool

Defines whether the IP is an IPv6 (false = IPv4).

project_id: str

Scaleway Project the IP belongs to.

region: str

Region of the IP.

resource: Resource | None = None

Resource which the IP is attached to.

reverses: List[Reverse]

Array of reverses associated with the IP.

source: Source | None = None

Source pool where the IP was reserved in.

tags: List[str]

Tags for the IP.

updated_at: datetime | None = None

Date the IP was last modified.

zone: str | None = None

Zone of the IP, if zonal.

class scaleway_async.ipam.v1.types.ListIPsRequest(region: 'Optional[ScwRegion]' = None, order_by: 'Optional[ListIPsRequestOrderBy]' = <ListIPsRequestOrderBy.CREATED_AT_DESC: 'created_at_desc'>, page: 'Optional[int]' = 0, page_size: 'Optional[int]' = 0, project_id: 'Optional[str]' = None, vpc_id: 'Optional[str]' = None, attached: 'Optional[bool]' = False, resource_name: 'Optional[str]' = None, resource_id: 'Optional[str]' = None, resource_ids: 'Optional[List[str]]' = <factory>, resource_type: 'Optional[ResourceType]' = <ResourceType.UNKNOWN_TYPE: 'unknown_type'>, resource_types: 'Optional[List[ResourceType]]' = <factory>, mac_address: 'Optional[str]' = None, tags: 'Optional[List[str]]' = <factory>, organization_id: 'Optional[str]' = None, is_ipv6: 'Optional[bool]' = False, ip_ids: 'Optional[List[str]]' = <factory>, zonal: 'Optional[str]' = None, private_network_id: 'Optional[str]' = None, subnet_id: 'Optional[str]' = None, source_vpc_id: 'Optional[str]' = None)

Bases: object

attached: bool | None = False

Defines whether to filter only for IPs which are attached to a resource.

ip_ids: List[str] | None

IP IDs to filter for. Only IPs with these UUIDs will be returned.

is_ipv6: bool | None = False

Defines whether to filter only for IPv4s or IPv6s.

mac_address: str | None = None

MAC address to filter for. Only IPs attached to a resource with this MAC address will be returned.

order_by: ListIPsRequestOrderBy | None = 'created_at_desc'

Sort order of the returned IPs.

organization_id: str | None = None

Organization ID to filter for. Only IPs belonging to this Organization will be returned.

page: int | None = 0

Page number to return, from the paginated results.

page_size: int | None = 0

Maximum number of IPs to return per page.

private_network_id: str | None = None
project_id: str | None = None

Project ID to filter for. Only IPs belonging to this Project will be returned.

region: str | None = None

Region to target. If none is passed will use default region from the config.

resource_id: str | None = None

Resource ID to filter for. Only IPs attached to this resource will be returned.

resource_ids: List[str] | None

Resource IDs to filter for. Only IPs attached to at least one of these resources will be returned.

resource_name: str | None = None

Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned.

resource_type: ResourceType | None = 'unknown_type'

Resource type to filter for. Only IPs attached to this type of resource will be returned.

resource_types: List[ResourceType] | None

Resource types to filter for. Only IPs attached to these types of resources will be returned.

source_vpc_id: str | None = None
subnet_id: str | None = None
tags: List[str] | None

Tags to filter for, only IPs with one or more matching tags will be returned.

vpc_id: str | None = None

Only IPs owned by resources in this VPC will be returned.

zonal: str | None = None
class scaleway_async.ipam.v1.types.ListIPsRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

ATTACHED_AT_ASC = 'attached_at_asc'
ATTACHED_AT_DESC = 'attached_at_desc'
CREATED_AT_ASC = 'created_at_asc'
CREATED_AT_DESC = 'created_at_desc'
IP_ADDRESS_ASC = 'ip_address_asc'
IP_ADDRESS_DESC = 'ip_address_desc'
MAC_ADDRESS_ASC = 'mac_address_asc'
MAC_ADDRESS_DESC = 'mac_address_desc'
UPDATED_AT_ASC = 'updated_at_asc'
UPDATED_AT_DESC = 'updated_at_desc'
class scaleway_async.ipam.v1.types.ListIPsResponse(total_count: 'int', ips: 'List[IP]')

Bases: object

ips: List[IP]
total_count: int
class scaleway_async.ipam.v1.types.MoveIPRequest(ip_id: 'str', from_resource: 'CustomResource', region: 'Optional[ScwRegion]' = None, to_resource: 'Optional[CustomResource]' = None)

Bases: object

from_resource: CustomResource

Custom resource currently attached to the IP.

ip_id: str

IP ID.

region: str | None = None

Region to target. If none is passed will use default region from the config.

to_resource: CustomResource | None = None

Custom resource to be attached to the IP.

class scaleway_async.ipam.v1.types.ReleaseIPRequest(ip_id: 'str', region: 'Optional[ScwRegion]' = None)

Bases: object

ip_id: str

IP ID.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway_async.ipam.v1.types.ReleaseIPSetRequest(region: 'Optional[ScwRegion]' = None, ip_ids: 'Optional[List[str]]' = <factory>)

Bases: object

ip_ids: List[str] | None
region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway_async.ipam.v1.types.Resource(type_: 'ResourceType', id: 'str', mac_address: 'Optional[str]' = None, name: 'Optional[str]' = None)

Bases: object

id: str

ID of the resource the IP is attached to.

mac_address: str | None = None

MAC of the resource the IP is attached to.

name: str | None = None

When the IP is in a Private Network, then a DNS record is available to resolve the resource name to this IP.

type_: ResourceType

Type of resource the IP is attached to.

class scaleway_async.ipam.v1.types.ResourceType(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

APPLE_SILICON_PRIVATE_NIC = 'apple_silicon_private_nic'
APPLE_SILICON_SERVER = 'apple_silicon_server'
BAREMETAL_PRIVATE_NIC = 'baremetal_private_nic'
BAREMETAL_SERVER = 'baremetal_server'
BGP_ENDPOINT = 'bgp_endpoint'
CUSTOM = 'custom'
DDL_DATALAB = 'ddl_datalab'
FIP_IP = 'fip_ip'
INSTANCE_IP = 'instance_ip'
INSTANCE_PRIVATE_NIC = 'instance_private_nic'
INSTANCE_SERVER = 'instance_server'
K8S_CLUSTER = 'k8s_cluster'
K8S_NODE = 'k8s_node'
KAFKA_CLUSTER = 'kafka_cluster'
LB_SERVER = 'lb_server'
LLM_DEPLOYMENT = 'llm_deployment'
MGDB_INSTANCE = 'mgdb_instance'
RDB_INSTANCE = 'rdb_instance'
REDIS_CLUSTER = 'redis_cluster'
SCBL_SEDB_CLUSTER = 'scbl_sedb_cluster'
SERVERLESS_CONTAINER = 'serverless_container'
SERVERLESS_FUNCTION = 'serverless_function'
UNKNOWN_TYPE = 'unknown_type'
VPC_GATEWAY = 'vpc_gateway'
VPC_GATEWAY_NETWORK = 'vpc_gateway_network'
VPN_GATEWAY = 'vpn_gateway'
class scaleway_async.ipam.v1.types.Reverse(hostname: 'str', address: 'Optional[str]' = None)

Bases: object

address: str | None = None

IP corresponding to the hostname.

hostname: str

Reverse domain name.

class scaleway_async.ipam.v1.types.Source(zonal: 'Optional[str]' = None, private_network_id: 'Optional[str]' = None, subnet_id: 'Optional[str]' = None, vpc_id: 'Optional[str]' = None)

Bases: object

private_network_id: str | None = None
subnet_id: str | None = None
vpc_id: str | None = None
zonal: str | None = None
class scaleway_async.ipam.v1.types.UpdateIPRequest(ip_id: 'str', region: 'Optional[ScwRegion]' = None, tags: 'Optional[List[str]]' = <factory>, reverses: 'Optional[List[Reverse]]' = <factory>)

Bases: object

ip_id: str

IP ID.

region: str | None = None

Region to target. If none is passed will use default region from the config.

reverses: List[Reverse] | None

Array of reverse domain names associated with an IP in the subnet of the current IP.

tags: List[str] | None

Tags for the IP.

Module contents

class scaleway_async.ipam.v1.AttachIPRequest(ip_id: 'str', resource: 'CustomResource', region: 'Optional[ScwRegion]' = None)

Bases: object

ip_id: str

IP ID.

region: str | None = None

Region to target. If none is passed will use default region from the config.

resource: CustomResource

Custom resource to be attached to the IP.

class scaleway_async.ipam.v1.BookIPRequest(source: 'Source', is_ipv6: 'bool', region: 'Optional[ScwRegion]' = None, project_id: 'Optional[str]' = None, address: 'Optional[str]' = None, tags: 'Optional[List[str]]' = <factory>, resource: 'Optional[CustomResource]' = None)

Bases: object

address: str | None = None

The requested address should not include the subnet mask (/suffix). Note that only the Private Network source allows you to pick a specific IP. If the requested IP is already reserved, then the call will fail.

is_ipv6: bool

Request an IPv6 instead of an IPv4.

project_id: str | None = None

When creating an IP in a Private Network, the Project must match the Private Network’s Project.

region: str | None = None

Region to target. If none is passed will use default region from the config.

resource: CustomResource | None = None

Custom resource to attach to the IP being reserved. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this for attaching IP addresses to standard Scaleway resources, as it will fail - instead, see the relevant product API for an equivalent method.

source: Source

Source in which to reserve the IP. Not all sources are available for reservation.

tags: List[str] | None

Tags for the IP.

class scaleway_async.ipam.v1.CustomResource(mac_address: 'str', name: 'Optional[str]' = None)

Bases: object

mac_address: str

MAC address of the custom resource.

name: str | None = None

When the resource is in a Private Network, a DNS record is available to resolve the resource name.

class scaleway_async.ipam.v1.DetachIPRequest(ip_id: 'str', resource: 'CustomResource', region: 'Optional[ScwRegion]' = None)

Bases: object

ip_id: str

IP ID.

region: str | None = None

Region to target. If none is passed will use default region from the config.

resource: CustomResource

Custom resource currently attached to the IP.

class scaleway_async.ipam.v1.GetIPRequest(ip_id: 'str', region: 'Optional[ScwRegion]' = None)

Bases: object

ip_id: str

IP ID.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway_async.ipam.v1.IP(id: 'str', address: 'str', project_id: 'str', is_ipv6: 'bool', tags: 'List[str]', reverses: 'List[Reverse]', region: 'ScwRegion', created_at: 'Optional[datetime]' = None, updated_at: 'Optional[datetime]' = None, source: 'Optional[Source]' = None, resource: 'Optional[Resource]' = None, zone: 'Optional[ScwZone]' = None)

Bases: object

address: str

IPv4 or IPv6 address in CIDR notation.

created_at: datetime | None = None

Date the IP was reserved.

id: str

IP ID.

is_ipv6: bool

Defines whether the IP is an IPv6 (false = IPv4).

project_id: str

Scaleway Project the IP belongs to.

region: str

Region of the IP.

resource: Resource | None = None

Resource which the IP is attached to.

reverses: List[Reverse]

Array of reverses associated with the IP.

source: Source | None = None

Source pool where the IP was reserved in.

tags: List[str]

Tags for the IP.

updated_at: datetime | None = None

Date the IP was last modified.

zone: str | None = None

Zone of the IP, if zonal.

class scaleway_async.ipam.v1.IpamV1API(client: Client, *, bypass_validation: bool = False)

Bases: API

This API allows you to manage your Scaleway IP addresses with our IP Address Management tool.

async attach_ip(*, ip_id: str, resource: CustomResource, region: str | None = None) IP

Attach IP to custom resource. Attach an existing reserved IP from a Private Network subnet to a custom, named resource via its MAC address. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this method for attaching IP addresses to standard Scaleway resources as it will fail - see the relevant product API for an equivalent method. :param ip_id: IP ID. :param resource: Custom resource to be attached to the IP. :param region: Region to target. If none is passed will use default region from the config. :return: IP

Usage:

result = await api.attach_ip(
    ip_id="example",
    resource=CustomResource(),
)
async book_ip(*, source: Source, is_ipv6: bool, region: str | None = None, project_id: str | None = None, address: str | None = None, tags: List[str] | None = None, resource: CustomResource | None = None) IP

Reserve a new IP. Reserve a new IP from the specified source. Currently IPs can only be reserved from a Private Network. :param source: Source in which to reserve the IP. Not all sources are available for reservation. :param is_ipv6: Request an IPv6 instead of an IPv4. :param region: Region to target. If none is passed will use default region from the config. :param project_id: When creating an IP in a Private Network, the Project must match the Private Network’s Project. :param address: The requested address should not include the subnet mask (/suffix). Note that only the Private Network source allows you to pick a specific IP. If the requested IP is already reserved, then the call will fail. :param tags: Tags for the IP. :param resource: Custom resource to attach to the IP being reserved. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this for attaching IP addresses to standard Scaleway resources, as it will fail - instead, see the relevant product API for an equivalent method. :return: IP

Usage:

result = await api.book_ip(
    source=Source(),
    is_ipv6=False,
)
async detach_ip(*, ip_id: str, resource: CustomResource, region: str | None = None) IP

Detach IP from a custom resource. Detach a private IP from a custom resource. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this method for detaching IP addresses from standard Scaleway resources (e.g. Instances, Load Balancers) as it will fail - see the relevant product API for an equivalent method. :param ip_id: IP ID. :param resource: Custom resource currently attached to the IP. :param region: Region to target. If none is passed will use default region from the config. :return: IP

Usage:

result = await api.detach_ip(
    ip_id="example",
    resource=CustomResource(),
)
async get_ip(*, ip_id: str, region: str | None = None) IP

Get an IP. Retrieve details of an existing IP, specified by its IP ID. :param ip_id: IP ID. :param region: Region to target. If none is passed will use default region from the config. :return: IP

Usage:

result = await api.get_ip(
    ip_id="example",
)
async list_i_ps(*, region: str | None = None, order_by: ListIPsRequestOrderBy | None = None, page: int | None = None, page_size: int | None = None, project_id: str | None = None, zonal: str | None = None, private_network_id: str | None = None, subnet_id: str | None = None, vpc_id: str | None = None, attached: bool | None = None, resource_name: str | None = None, resource_id: str | None = None, resource_ids: List[str] | None = None, resource_type: ResourceType | None = None, resource_types: List[ResourceType] | None = None, mac_address: str | None = None, tags: List[str] | None = None, organization_id: str | None = None, is_ipv6: bool | None = None, ip_ids: List[str] | None = None, source_vpc_id: str | None = None) ListIPsResponse

List existing IPs. List existing IPs in the specified region using various filters. For example, you can filter for IPs within a specified Private Network, or for public IPs within a specified Project. By default, the IPs returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. :param region: Region to target. If none is passed will use default region from the config. :param order_by: Sort order of the returned IPs. :param page: Page number to return, from the paginated results. :param page_size: Maximum number of IPs to return per page. :param project_id: Project ID to filter for. Only IPs belonging to this Project will be returned. :param zonal: Zone to filter for. Only IPs that are zonal, and in this zone, will be returned. One-Of (‘source’): at most one of ‘zonal’, ‘private_network_id’, ‘subnet_id’, ‘source_vpc_id’ could be set. :param private_network_id: Only IPs that are private, and in this Private Network, will be returned. One-Of (‘source’): at most one of ‘zonal’, ‘private_network_id’, ‘subnet_id’, ‘source_vpc_id’ could be set. :param subnet_id: Only IPs inside this exact subnet will be returned. One-Of (‘source’): at most one of ‘zonal’, ‘private_network_id’, ‘subnet_id’, ‘source_vpc_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 ip_ids: IP IDs to filter for. Only IPs with these UUIDs will be returned. :param source_vpc_id: One-Of (‘source’): at most one of ‘zonal’, ‘private_network_id’, ‘subnet_id’, ‘source_vpc_id’ could be set. :return: ListIPsResponse

Usage:

result = await api.list_i_ps()
async list_i_ps_all(*, region: str | None = None, order_by: ListIPsRequestOrderBy | None = None, page: int | None = None, page_size: int | None = None, project_id: str | None = None, zonal: str | None = None, private_network_id: str | None = None, subnet_id: str | None = None, vpc_id: str | None = None, attached: bool | None = None, resource_name: str | None = None, resource_id: str | None = None, resource_ids: List[str] | None = None, resource_type: ResourceType | None = None, resource_types: List[ResourceType] | None = None, mac_address: str | None = None, tags: List[str] | None = None, organization_id: str | None = None, is_ipv6: bool | None = None, ip_ids: List[str] | None = None, source_vpc_id: str | None = None) List[IP]

List existing IPs. List existing IPs in the specified region using various filters. For example, you can filter for IPs within a specified Private Network, or for public IPs within a specified Project. By default, the IPs returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. :param region: Region to target. If none is passed will use default region from the config. :param order_by: Sort order of the returned IPs. :param page: Page number to return, from the paginated results. :param page_size: Maximum number of IPs to return per page. :param project_id: Project ID to filter for. Only IPs belonging to this Project will be returned. :param zonal: Zone to filter for. Only IPs that are zonal, and in this zone, will be returned. One-Of (‘source’): at most one of ‘zonal’, ‘private_network_id’, ‘subnet_id’, ‘source_vpc_id’ could be set. :param private_network_id: Only IPs that are private, and in this Private Network, will be returned. One-Of (‘source’): at most one of ‘zonal’, ‘private_network_id’, ‘subnet_id’, ‘source_vpc_id’ could be set. :param subnet_id: Only IPs inside this exact subnet will be returned. One-Of (‘source’): at most one of ‘zonal’, ‘private_network_id’, ‘subnet_id’, ‘source_vpc_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 ip_ids: IP IDs to filter for. Only IPs with these UUIDs will be returned. :param source_vpc_id: One-Of (‘source’): at most one of ‘zonal’, ‘private_network_id’, ‘subnet_id’, ‘source_vpc_id’ could be set. :return: List[IP]

Usage:

result = await api.list_i_ps_all()
async move_ip(*, ip_id: str, from_resource: CustomResource, region: str | None = None, to_resource: CustomResource | None = None) IP

Move IP to a custom resource. Move an existing reserved private IP from one custom resource (e.g. a virtual machine hosted on an Elastic Metal server) to another custom resource. This will detach it from the first resource, and attach it to the second. Do not use this method for moving IP addresses between standard Scaleway resources (e.g. Instances, Load Balancers) as it will fail - see the relevant product API for an equivalent method. :param ip_id: IP ID. :param from_resource: Custom resource currently attached to the IP. :param region: Region to target. If none is passed will use default region from the config. :param to_resource: Custom resource to be attached to the IP. :return: IP

Usage:

result = await api.move_ip(
    ip_id="example",
    from_resource=CustomResource(),
)
async release_ip(*, ip_id: str, region: str | None = None) None

Release an IP. Release an IP not currently attached to a resource, and returns it to the available IP pool. :param ip_id: IP ID. :param region: Region to target. If none is passed will use default region from the config.

Usage:

result = await api.release_ip(
    ip_id="example",
)
async release_ip_set(*, region: str | None = None, ip_ids: List[str] | None = None) None
Parameters:
  • region – Region to target. If none is passed will use default region from the config.

  • ip_ids

Usage:

result = await api.release_ip_set()
async update_ip(*, ip_id: str, region: str | None = None, tags: List[str] | None = None, reverses: List[Reverse] | None = None) IP

Update an IP. Update parameters including tags of the specified IP. :param ip_id: IP ID. :param region: Region to target. If none is passed will use default region from the config. :param tags: Tags for the IP. :param reverses: Array of reverse domain names associated with an IP in the subnet of the current IP. :return: IP

Usage:

result = await api.update_ip(
    ip_id="example",
)
class scaleway_async.ipam.v1.ListIPsRequest(region: 'Optional[ScwRegion]' = None, order_by: 'Optional[ListIPsRequestOrderBy]' = <ListIPsRequestOrderBy.CREATED_AT_DESC: 'created_at_desc'>, page: 'Optional[int]' = 0, page_size: 'Optional[int]' = 0, project_id: 'Optional[str]' = None, vpc_id: 'Optional[str]' = None, attached: 'Optional[bool]' = False, resource_name: 'Optional[str]' = None, resource_id: 'Optional[str]' = None, resource_ids: 'Optional[List[str]]' = <factory>, resource_type: 'Optional[ResourceType]' = <ResourceType.UNKNOWN_TYPE: 'unknown_type'>, resource_types: 'Optional[List[ResourceType]]' = <factory>, mac_address: 'Optional[str]' = None, tags: 'Optional[List[str]]' = <factory>, organization_id: 'Optional[str]' = None, is_ipv6: 'Optional[bool]' = False, ip_ids: 'Optional[List[str]]' = <factory>, zonal: 'Optional[str]' = None, private_network_id: 'Optional[str]' = None, subnet_id: 'Optional[str]' = None, source_vpc_id: 'Optional[str]' = None)

Bases: object

attached: bool | None = False

Defines whether to filter only for IPs which are attached to a resource.

ip_ids: List[str] | None

IP IDs to filter for. Only IPs with these UUIDs will be returned.

is_ipv6: bool | None = False

Defines whether to filter only for IPv4s or IPv6s.

mac_address: str | None = None

MAC address to filter for. Only IPs attached to a resource with this MAC address will be returned.

order_by: ListIPsRequestOrderBy | None = 'created_at_desc'

Sort order of the returned IPs.

organization_id: str | None = None

Organization ID to filter for. Only IPs belonging to this Organization will be returned.

page: int | None = 0

Page number to return, from the paginated results.

page_size: int | None = 0

Maximum number of IPs to return per page.

private_network_id: str | None = None
project_id: str | None = None

Project ID to filter for. Only IPs belonging to this Project will be returned.

region: str | None = None

Region to target. If none is passed will use default region from the config.

resource_id: str | None = None

Resource ID to filter for. Only IPs attached to this resource will be returned.

resource_ids: List[str] | None

Resource IDs to filter for. Only IPs attached to at least one of these resources will be returned.

resource_name: str | None = None

Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned.

resource_type: ResourceType | None = 'unknown_type'

Resource type to filter for. Only IPs attached to this type of resource will be returned.

resource_types: List[ResourceType] | None

Resource types to filter for. Only IPs attached to these types of resources will be returned.

source_vpc_id: str | None = None
subnet_id: str | None = None
tags: List[str] | None

Tags to filter for, only IPs with one or more matching tags will be returned.

vpc_id: str | None = None

Only IPs owned by resources in this VPC will be returned.

zonal: str | None = None
class scaleway_async.ipam.v1.ListIPsRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

ATTACHED_AT_ASC = 'attached_at_asc'
ATTACHED_AT_DESC = 'attached_at_desc'
CREATED_AT_ASC = 'created_at_asc'
CREATED_AT_DESC = 'created_at_desc'
IP_ADDRESS_ASC = 'ip_address_asc'
IP_ADDRESS_DESC = 'ip_address_desc'
MAC_ADDRESS_ASC = 'mac_address_asc'
MAC_ADDRESS_DESC = 'mac_address_desc'
UPDATED_AT_ASC = 'updated_at_asc'
UPDATED_AT_DESC = 'updated_at_desc'
class scaleway_async.ipam.v1.ListIPsResponse(total_count: 'int', ips: 'List[IP]')

Bases: object

ips: List[IP]
total_count: int
class scaleway_async.ipam.v1.MoveIPRequest(ip_id: 'str', from_resource: 'CustomResource', region: 'Optional[ScwRegion]' = None, to_resource: 'Optional[CustomResource]' = None)

Bases: object

from_resource: CustomResource

Custom resource currently attached to the IP.

ip_id: str

IP ID.

region: str | None = None

Region to target. If none is passed will use default region from the config.

to_resource: CustomResource | None = None

Custom resource to be attached to the IP.

class scaleway_async.ipam.v1.ReleaseIPRequest(ip_id: 'str', region: 'Optional[ScwRegion]' = None)

Bases: object

ip_id: str

IP ID.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway_async.ipam.v1.ReleaseIPSetRequest(region: 'Optional[ScwRegion]' = None, ip_ids: 'Optional[List[str]]' = <factory>)

Bases: object

ip_ids: List[str] | None
region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway_async.ipam.v1.Resource(type_: 'ResourceType', id: 'str', mac_address: 'Optional[str]' = None, name: 'Optional[str]' = None)

Bases: object

id: str

ID of the resource the IP is attached to.

mac_address: str | None = None

MAC of the resource the IP is attached to.

name: str | None = None

When the IP is in a Private Network, then a DNS record is available to resolve the resource name to this IP.

type_: ResourceType

Type of resource the IP is attached to.

class scaleway_async.ipam.v1.ResourceType(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

APPLE_SILICON_PRIVATE_NIC = 'apple_silicon_private_nic'
APPLE_SILICON_SERVER = 'apple_silicon_server'
BAREMETAL_PRIVATE_NIC = 'baremetal_private_nic'
BAREMETAL_SERVER = 'baremetal_server'
BGP_ENDPOINT = 'bgp_endpoint'
CUSTOM = 'custom'
DDL_DATALAB = 'ddl_datalab'
FIP_IP = 'fip_ip'
INSTANCE_IP = 'instance_ip'
INSTANCE_PRIVATE_NIC = 'instance_private_nic'
INSTANCE_SERVER = 'instance_server'
K8S_CLUSTER = 'k8s_cluster'
K8S_NODE = 'k8s_node'
KAFKA_CLUSTER = 'kafka_cluster'
LB_SERVER = 'lb_server'
LLM_DEPLOYMENT = 'llm_deployment'
MGDB_INSTANCE = 'mgdb_instance'
RDB_INSTANCE = 'rdb_instance'
REDIS_CLUSTER = 'redis_cluster'
SCBL_SEDB_CLUSTER = 'scbl_sedb_cluster'
SERVERLESS_CONTAINER = 'serverless_container'
SERVERLESS_FUNCTION = 'serverless_function'
UNKNOWN_TYPE = 'unknown_type'
VPC_GATEWAY = 'vpc_gateway'
VPC_GATEWAY_NETWORK = 'vpc_gateway_network'
VPN_GATEWAY = 'vpn_gateway'
class scaleway_async.ipam.v1.Reverse(hostname: 'str', address: 'Optional[str]' = None)

Bases: object

address: str | None = None

IP corresponding to the hostname.

hostname: str

Reverse domain name.

class scaleway_async.ipam.v1.Source(zonal: 'Optional[str]' = None, private_network_id: 'Optional[str]' = None, subnet_id: 'Optional[str]' = None, vpc_id: 'Optional[str]' = None)

Bases: object

private_network_id: str | None = None
subnet_id: str | None = None
vpc_id: str | None = None
zonal: str | None = None
class scaleway_async.ipam.v1.UpdateIPRequest(ip_id: 'str', region: 'Optional[ScwRegion]' = None, tags: 'Optional[List[str]]' = <factory>, reverses: 'Optional[List[Reverse]]' = <factory>)

Bases: object

ip_id: str

IP ID.

region: str | None = None

Region to target. If none is passed will use default region from the config.

reverses: List[Reverse] | None

Array of reverse domain names associated with an IP in the subnet of the current IP.

tags: List[str] | None

Tags for the IP.