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: Optional[str] = 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: Optional[str] = None, project_id: Optional[str] = None, address: Optional[str] = None, tags: Optional[List[str]] = None, resource: Optional[CustomResource] = 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: Optional[str] = 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: Optional[str] = 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: Optional[str] = None, order_by: Optional[ListIPsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, project_id: Optional[str] = None, zonal: Optional[str] = None, private_network_id: Optional[str] = None, 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, ip_ids: Optional[List[str]] = 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’ 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’ 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’ 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. :return:
ListIPsResponse
Usage:
result = await api.list_i_ps()
- async list_i_ps_all(*, region: Optional[str] = None, order_by: Optional[ListIPsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, project_id: Optional[str] = None, zonal: Optional[str] = None, private_network_id: Optional[str] = None, 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, ip_ids: Optional[List[str]] = 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’ 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’ 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’ 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. :return:
List[IP]
Usage:
result = await api.list_i_ps_all()
- async move_ip(*, ip_id: str, from_resource: CustomResource, region: Optional[str] = None, to_resource: Optional[CustomResource] = 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: Optional[str] = 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: Optional[str] = None, ip_ids: Optional[List[str]] = 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: Optional[str] = None, tags: Optional[List[str]] = None, reverses: Optional[List[Reverse]] = 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_ListIPsResponse(data: Any) ListIPsResponse
scaleway_async.ipam.v1.types module
- class scaleway_async.ipam.v1.types.AttachIPRequest(ip_id: 'str', resource: 'CustomResource', region: 'Optional[ScwRegion]')
Bases:
object
- ip_id: str
IP ID.
- region: Optional[str]
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]', project_id: 'Optional[str]', address: 'Optional[str]', tags: 'Optional[List[str]]', resource: 'Optional[CustomResource]')
Bases:
object
- address: Optional[str]
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: Optional[str]
When creating an IP in a Private Network, the Project must match the Private Network’s Project.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- resource: Optional[CustomResource]
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.
- tags: Optional[List[str]]
Tags for the IP.
- class scaleway_async.ipam.v1.types.CustomResource(mac_address: 'str', name: 'Optional[str]')
Bases:
object
- mac_address: str
MAC address of the custom resource.
- name: Optional[str]
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]')
Bases:
object
- ip_id: str
IP ID.
- region: Optional[str]
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]')
Bases:
object
- ip_id: str
IP ID.
- region: Optional[str]
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]', updated_at: 'Optional[datetime]', source: 'Optional[Source]', resource: 'Optional[Resource]', zone: 'Optional[ScwZone]')
Bases:
object
- address: str
IPv4 or IPv6 address in CIDR notation.
- created_at: Optional[datetime]
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.
- tags: List[str]
Tags for the IP.
- updated_at: Optional[datetime]
Date the IP was last modified.
- zone: Optional[str]
Zone of the IP, if zonal.
- class scaleway_async.ipam.v1.types.ListIPsRequest(region: 'Optional[ScwRegion]', order_by: 'Optional[ListIPsRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]', project_id: 'Optional[str]', vpc_id: 'Optional[str]', attached: 'Optional[bool]', resource_name: 'Optional[str]', resource_id: 'Optional[str]', resource_ids: 'Optional[List[str]]', resource_type: 'Optional[ResourceType]', resource_types: 'Optional[List[ResourceType]]', mac_address: 'Optional[str]', tags: 'Optional[List[str]]', organization_id: 'Optional[str]', is_ipv6: 'Optional[bool]', ip_ids: 'Optional[List[str]]', zonal: 'Optional[str]', private_network_id: 'Optional[str]', subnet_id: 'Optional[str]')
Bases:
object
- attached: Optional[bool]
Defines whether to filter only for IPs which are attached to a resource.
- ip_ids: Optional[List[str]]
IP IDs to filter for. Only IPs with these UUIDs will be returned.
- is_ipv6: Optional[bool]
Defines whether to filter only for IPv4s or IPv6s.
- mac_address: Optional[str]
MAC address to filter for. Only IPs attached to a resource with this MAC address will be returned.
- order_by: Optional[ListIPsRequestOrderBy]
Sort order of the returned IPs.
- organization_id: Optional[str]
Organization ID to filter for. Only IPs belonging to this Organization will be returned.
- page: Optional[int]
Page number to return, from the paginated results.
- page_size: Optional[int]
Maximum number of IPs to return per page.
- private_network_id: Optional[str]
- project_id: Optional[str]
Project ID to filter for. Only IPs belonging to this Project will be returned.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- resource_id: Optional[str]
Resource ID to filter for. Only IPs attached to this resource will be returned.
- resource_ids: Optional[List[str]]
Resource IDs to filter for. Only IPs attached to at least one of these resources will be returned.
- 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_type: Optional[ResourceType]
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.
- subnet_id: Optional[str]
- tags: Optional[List[str]]
Tags to filter for, only IPs with one or more matching tags will be returned.
- vpc_id: Optional[str]
Only IPs owned by resources in this VPC will be returned.
- zonal: Optional[str]
- class scaleway_async.ipam.v1.types.ListIPsRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- ATTACHED_AT_ASC = 'attached_at_asc'
- ATTACHED_AT_DESC = 'attached_at_desc'
- CREATED_AT_ASC = 'created_at_asc'
- CREATED_AT_DESC = 'created_at_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
- total_count: int
- class scaleway_async.ipam.v1.types.MoveIPRequest(ip_id: 'str', from_resource: 'CustomResource', region: 'Optional[ScwRegion]', to_resource: 'Optional[CustomResource]')
Bases:
object
- from_resource: CustomResource
Custom resource currently attached to the IP.
- ip_id: str
IP ID.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- to_resource: Optional[CustomResource]
Custom resource to be attached to the IP.
- class scaleway_async.ipam.v1.types.ReleaseIPRequest(ip_id: 'str', region: 'Optional[ScwRegion]')
Bases:
object
- ip_id: str
IP ID.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.ipam.v1.types.ReleaseIPSetRequest(region: 'Optional[ScwRegion]', ip_ids: 'Optional[List[str]]')
Bases:
object
- ip_ids: Optional[List[str]]
- region: Optional[str]
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]', name: 'Optional[str]')
Bases:
object
- id: str
ID of the resource the IP is attached to.
- mac_address: Optional[str]
MAC of the resource the IP is attached to.
- name: Optional[str]
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: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- APPLE_SILICON_PRIVATE_NIC = 'apple_silicon_private_nic'
- APPLE_SILICON_SERVER = 'apple_silicon_server'
- BAREMETAL_PRIVATE_NIC = 'baremetal_private_nic'
- BAREMETAL_SERVER = 'baremetal_server'
- CUSTOM = 'custom'
- 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'
- LB_SERVER = 'lb_server'
- LLM_DEPLOYMENT = 'llm_deployment'
- MGDB_INSTANCE = 'mgdb_instance'
- RDB_INSTANCE = 'rdb_instance'
- REDIS_CLUSTER = 'redis_cluster'
- SERVERLESS_CONTAINER = 'serverless_container'
- SERVERLESS_FUNCTION = 'serverless_function'
- UNKNOWN_TYPE = 'unknown_type'
- VPC_GATEWAY = 'vpc_gateway'
- VPC_GATEWAY_NETWORK = 'vpc_gateway_network'
- class scaleway_async.ipam.v1.types.Reverse(hostname: 'str', address: 'Optional[str]')
Bases:
object
- address: Optional[str]
IP corresponding to the hostname.
- hostname: str
Reverse domain name.
- class scaleway_async.ipam.v1.types.Source(zonal: 'Optional[str]', private_network_id: 'Optional[str]', subnet_id: 'Optional[str]')
Bases:
object
- private_network_id: Optional[str]
- subnet_id: Optional[str]
- zonal: Optional[str]
- class scaleway_async.ipam.v1.types.UpdateIPRequest(ip_id: 'str', region: 'Optional[ScwRegion]', tags: 'Optional[List[str]]', reverses: 'Optional[List[Reverse]]')
Bases:
object
- ip_id: str
IP ID.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- reverses: Optional[List[Reverse]]
Array of reverse domain names associated with an IP in the subnet of the current IP.
- tags: Optional[List[str]]
Tags for the IP.
Module contents
- class scaleway_async.ipam.v1.AttachIPRequest(ip_id: 'str', resource: 'CustomResource', region: 'Optional[ScwRegion]')
Bases:
object
- ip_id: str
IP ID.
- region: Optional[str]
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]', project_id: 'Optional[str]', address: 'Optional[str]', tags: 'Optional[List[str]]', resource: 'Optional[CustomResource]')
Bases:
object
- address: Optional[str]
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: Optional[str]
When creating an IP in a Private Network, the Project must match the Private Network’s Project.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- resource: Optional[CustomResource]
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.
- tags: Optional[List[str]]
Tags for the IP.
- class scaleway_async.ipam.v1.CustomResource(mac_address: 'str', name: 'Optional[str]')
Bases:
object
- mac_address: str
MAC address of the custom resource.
- name: Optional[str]
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]')
Bases:
object
- ip_id: str
IP ID.
- region: Optional[str]
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]')
Bases:
object
- ip_id: str
IP ID.
- region: Optional[str]
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]', updated_at: 'Optional[datetime]', source: 'Optional[Source]', resource: 'Optional[Resource]', zone: 'Optional[ScwZone]')
Bases:
object
- address: str
IPv4 or IPv6 address in CIDR notation.
- created_at: Optional[datetime]
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.
- tags: List[str]
Tags for the IP.
- updated_at: Optional[datetime]
Date the IP was last modified.
- zone: Optional[str]
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: Optional[str] = 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: Optional[str] = None, project_id: Optional[str] = None, address: Optional[str] = None, tags: Optional[List[str]] = None, resource: Optional[CustomResource] = 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: Optional[str] = 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: Optional[str] = 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: Optional[str] = None, order_by: Optional[ListIPsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, project_id: Optional[str] = None, zonal: Optional[str] = None, private_network_id: Optional[str] = None, 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, ip_ids: Optional[List[str]] = 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’ 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’ 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’ 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. :return:
ListIPsResponse
Usage:
result = await api.list_i_ps()
- async list_i_ps_all(*, region: Optional[str] = None, order_by: Optional[ListIPsRequestOrderBy] = None, page: Optional[int] = None, page_size: Optional[int] = None, project_id: Optional[str] = None, zonal: Optional[str] = None, private_network_id: Optional[str] = None, 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, ip_ids: Optional[List[str]] = 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’ 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’ 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’ 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. :return:
List[IP]
Usage:
result = await api.list_i_ps_all()
- async move_ip(*, ip_id: str, from_resource: CustomResource, region: Optional[str] = None, to_resource: Optional[CustomResource] = 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: Optional[str] = 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: Optional[str] = None, ip_ids: Optional[List[str]] = 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: Optional[str] = None, tags: Optional[List[str]] = None, reverses: Optional[List[Reverse]] = 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]', order_by: 'Optional[ListIPsRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]', project_id: 'Optional[str]', vpc_id: 'Optional[str]', attached: 'Optional[bool]', resource_name: 'Optional[str]', resource_id: 'Optional[str]', resource_ids: 'Optional[List[str]]', resource_type: 'Optional[ResourceType]', resource_types: 'Optional[List[ResourceType]]', mac_address: 'Optional[str]', tags: 'Optional[List[str]]', organization_id: 'Optional[str]', is_ipv6: 'Optional[bool]', ip_ids: 'Optional[List[str]]', zonal: 'Optional[str]', private_network_id: 'Optional[str]', subnet_id: 'Optional[str]')
Bases:
object
- attached: Optional[bool]
Defines whether to filter only for IPs which are attached to a resource.
- ip_ids: Optional[List[str]]
IP IDs to filter for. Only IPs with these UUIDs will be returned.
- is_ipv6: Optional[bool]
Defines whether to filter only for IPv4s or IPv6s.
- mac_address: Optional[str]
MAC address to filter for. Only IPs attached to a resource with this MAC address will be returned.
- order_by: Optional[ListIPsRequestOrderBy]
Sort order of the returned IPs.
- organization_id: Optional[str]
Organization ID to filter for. Only IPs belonging to this Organization will be returned.
- page: Optional[int]
Page number to return, from the paginated results.
- page_size: Optional[int]
Maximum number of IPs to return per page.
- private_network_id: Optional[str]
- project_id: Optional[str]
Project ID to filter for. Only IPs belonging to this Project will be returned.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- resource_id: Optional[str]
Resource ID to filter for. Only IPs attached to this resource will be returned.
- resource_ids: Optional[List[str]]
Resource IDs to filter for. Only IPs attached to at least one of these resources will be returned.
- 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_type: Optional[ResourceType]
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.
- subnet_id: Optional[str]
- tags: Optional[List[str]]
Tags to filter for, only IPs with one or more matching tags will be returned.
- vpc_id: Optional[str]
Only IPs owned by resources in this VPC will be returned.
- zonal: Optional[str]
- class scaleway_async.ipam.v1.ListIPsRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- ATTACHED_AT_ASC = 'attached_at_asc'
- ATTACHED_AT_DESC = 'attached_at_desc'
- CREATED_AT_ASC = 'created_at_asc'
- CREATED_AT_DESC = 'created_at_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
- total_count: int
- class scaleway_async.ipam.v1.MoveIPRequest(ip_id: 'str', from_resource: 'CustomResource', region: 'Optional[ScwRegion]', to_resource: 'Optional[CustomResource]')
Bases:
object
- from_resource: CustomResource
Custom resource currently attached to the IP.
- ip_id: str
IP ID.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- to_resource: Optional[CustomResource]
Custom resource to be attached to the IP.
- class scaleway_async.ipam.v1.ReleaseIPRequest(ip_id: 'str', region: 'Optional[ScwRegion]')
Bases:
object
- ip_id: str
IP ID.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- class scaleway_async.ipam.v1.ReleaseIPSetRequest(region: 'Optional[ScwRegion]', ip_ids: 'Optional[List[str]]')
Bases:
object
- ip_ids: Optional[List[str]]
- region: Optional[str]
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]', name: 'Optional[str]')
Bases:
object
- id: str
ID of the resource the IP is attached to.
- mac_address: Optional[str]
MAC of the resource the IP is attached to.
- name: Optional[str]
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: Optional[Any] = None, *args: Any, **kwargs: Any)
Bases:
str
,Enum
An enumeration.
- APPLE_SILICON_PRIVATE_NIC = 'apple_silicon_private_nic'
- APPLE_SILICON_SERVER = 'apple_silicon_server'
- BAREMETAL_PRIVATE_NIC = 'baremetal_private_nic'
- BAREMETAL_SERVER = 'baremetal_server'
- CUSTOM = 'custom'
- 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'
- LB_SERVER = 'lb_server'
- LLM_DEPLOYMENT = 'llm_deployment'
- MGDB_INSTANCE = 'mgdb_instance'
- RDB_INSTANCE = 'rdb_instance'
- REDIS_CLUSTER = 'redis_cluster'
- SERVERLESS_CONTAINER = 'serverless_container'
- SERVERLESS_FUNCTION = 'serverless_function'
- UNKNOWN_TYPE = 'unknown_type'
- VPC_GATEWAY = 'vpc_gateway'
- VPC_GATEWAY_NETWORK = 'vpc_gateway_network'
- class scaleway_async.ipam.v1.Reverse(hostname: 'str', address: 'Optional[str]')
Bases:
object
- address: Optional[str]
IP corresponding to the hostname.
- hostname: str
Reverse domain name.
- class scaleway_async.ipam.v1.Source(zonal: 'Optional[str]', private_network_id: 'Optional[str]', subnet_id: 'Optional[str]')
Bases:
object
- private_network_id: Optional[str]
- subnet_id: Optional[str]
- zonal: Optional[str]
- class scaleway_async.ipam.v1.UpdateIPRequest(ip_id: 'str', region: 'Optional[ScwRegion]', tags: 'Optional[List[str]]', reverses: 'Optional[List[Reverse]]')
Bases:
object
- ip_id: str
IP ID.
- region: Optional[str]
Region to target. If none is passed will use default region from the config.
- reverses: Optional[List[Reverse]]
Array of reverse domain names associated with an IP in the subnet of the current IP.
- tags: Optional[List[str]]
Tags for the IP.