openapi: 3.0.0
info:
  title: IPAM API
  description: |-
    IPAM is an **IP** **A**ddress **M**anagement tool for Scaleway's ecosystem.

    It acts as a single source of truth for the IP addresses of Scaleway resources. You can use the IPAM API to list public IP addresses for products such as Instances, Databases and Load Balancer which are already using [IP mobility](https://www.scaleway.com/en/blog/ip-mobility-removing-nat/). More products will be integrated in the future.

    Scaleway's IPAM also powers the addressing of resources of all resources in a VPC, simplifying management of IP allocations, conflicts and lifecycle. Private Networks' DHCP server hands out the static private IP addresses assigned by IPAM to resources attached to Private Networks.

    IPAM allows you to reserve IPs, to ensure they won't be allocated to some other resource. You can use these reserved IPs directly on custom environments (e.g. VMs on an Elastic Metal server). In the future, you will be also be able to specify a reserved IP to use when attaching a resource to a Private Network. In the meantime, when you attach a resource to a Private Network, its IP address is assigned by IPAM and then automatically attached by the product/resource.

    IPAM gives you a number of guarantees about IPs:

    - once reserved, the IP will never change
    - once attached to a resource, no other resource will be able to use the IP, ensuring unicity
    - once attached to a resource, the IP cannot be released unless detached from the resource

    (switchcolumn)
    (switchcolumn)

    ## Concepts

    ### Resource

    An IPAM IP can be attached to a resource, which is identified by its type (e.g. an Instance Private NIC) and its UUID. Once attached, most operations on the IP are not available anymore: it must first be detached.

    Once an IP is attached to a resource, it is not possible anymore to:
    - release the IP
    - detach the IP (without detaching the resource from the Private Network first)

    When an IP is attached to a resource, only the product managing the resource can detach the IP, by detaching the resource from the Private Network. This ensures that IPs cannot be reused and avoid mistakes.

    ### Source

    An IP can be reserved in several different sources, which can be understood as distinct pools of available IP.

    Sources can be either **global** like the `zonal` source which is shared across all users, or **specific**, like the `private_network` source, that is identified by the Private Network ID, and will hand out IPs from a specific Private Network.

    ## Quickstart

    **Requirements**:
    - You have a [Scaleway account](https://console.scaleway.com/)
    - You have created an [API key](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/) and that the API key has sufficient [IAM permissions](https://www.scaleway.com/en/docs/identity-and-access-management/iam/reference-content/permission-sets/) to perform the actions described on this page
    - You have [installed `curl`](https://curl.se/download.html)

    1. Configure your environment variables.

        <Message type="note">
        This is an optional step that seeks to simplify your usage of the IPAM API.
        </Message>

        ```bash
        export SCW_SECRET_KEY="<API secret key>"
        export SCW_DEFAULT_REGION="<Scaleway default Region>"
        export SCW_PROJECT_ID="<Scaleway Project ID>"
        export SCW_PRIVATE_NETWORK_ID="<Scaleway Private Network ID>"
        ```

    2. Create an IP: run the following command to create an IP in a specified Private Network. You can customize the tags as you wish. The IP will not be attached to any resource.

        ```bash
        curl -X POST \
          -H "X-Auth-Token: $SCW_SECRET_KEY" \
          "https://api.scaleway.com/ipam/v1/regions/$SCW_DEFAULT_REGION/ips" \
          --json '{
            "project_id": "'"$SCW_PROJECT_ID"'",
            "source": {"private_network_id": "'"$SCW_PRIVATE_NETWORK_ID"'"},
            "tags": ["test", "another tag"]
          }'
        ```

    3. **Get a list of your IPs**: run the following command to get a list of all the IPs in your account, with their details:

        ```bash
        curl -X GET \
          -H "X-Auth-Token: $SCW_SECRET_KEY" \
          "https://api.scaleway.com/ipam/v1/regions/$SCW_DEFAULT_REGION/ips"
        ```

    4. **Get a list of your IPs in a Private Network**: run the following command to get a list of all the IPs in a Private Network, with their details:

        ```bash
        curl -X GET \
          -H "X-Auth-Token: $SCW_SECRET_KEY" \
          "https://api.scaleway.com/ipam/v1/regions/$SCW_DEFAULT_REGION/ips?private_network_id=$SCW_PRIVATE_NETWORK_ID"
        ```

    5. **Release an IP**: run the following command to delete an IP, if it is not attached to a resource. Ensure that you replace `<IP-ID>` in the URL with the ID of the IP you want to release.

        ```bash
        curl -X DELETE \
          -H "X-Auth-Token: $SCW_SECRET_KEY" \
          "https://api.scaleway.com/ipam/v1/regions/$SCW_DEFAULT_REGION/ips/<IP-ID>"
        ```

    (switchcolumn)
    <Message type="requirement">
    - You have a [Scaleway account](https://console.scaleway.com/)
    - You have created an [API key](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/) and that the API key has sufficient [IAM permissions](https://www.scaleway.com/en/docs/identity-and-access-management/iam/reference-content/permission-sets/) to perform the actions described on this page
    - You have [installed `curl`](https://curl.se/download.html)
    </Message>
    (switchcolumn)

    ## Technical limitations

    Scaleway's IPAM is a new tool. Not all Scaleway products are currently integrated in terms of public IP addressing, and not all functionalities are currently publicly available for the management of private IPs in a VPC (for example, not all products support specifying a reserved IP when attaching a resource to a Private Network). More features and functionalities will be added in due course. In the meantime, [read our blog post](https://www.scaleway.com/en/blog/ip-mobility-removing-nat/) to find out more about how we are tackling technical debt with IP mobility.

    ## Going further

    For more help using Scaleway IPAM and network products, check out the following resources:

    - Our [VPC documentation](https://www.scaleway.com/en/docs/network/vpc)
    - The #virtual-private-cloud channel on our [Slack Community](https://www.scaleway.com/en/docs/tutorials/scaleway-slack-community/)
    - Our [support ticketing system](https://www.scaleway.com/en/docs/console/my-account/how-to/open-a-support-ticket/).
  version: v1
servers:
- url: https://api.scaleway.com
tags:
- name: IPs
  description: |
    An IP address is the building block for network communications in a
    VPC or on the public Internet.
components:
  schemas:
    scaleway.ipam.v1.IP:
      type: object
      properties:
        id:
          type: string
          description: IP ID. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        address:
          type: string
          description: IPv4 or IPv6 address in CIDR notation. (IP network)
          example: 1.2.3.4/32
        project_id:
          type: string
          description: Scaleway Project the IP belongs to. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
        is_ipv6:
          type: boolean
          description: Defines whether the IP is an IPv6 (false = IPv4).
        created_at:
          type: string
          description: Date the IP was reserved. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        updated_at:
          type: string
          description: Date the IP was last modified. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        source:
          type: object
          description: Source pool where the IP was reserved in.
          properties:
            zonal:
              type: string
              description: |-
                Zone the IP lives in if the IP is a public zoned IP.
                This source is global.
              nullable: true
              x-one-of: source
            private_network_id:
              type: string
              description: |-
                Private Network the IP lives in if the IP is a private IP.
                This source is specific.
              nullable: true
              x-one-of: source
            subnet_id:
              type: string
              description: |-
                Private Network subnet the IP lives in if the IP is a private IP in a Private Network.
                This source is specific.
              nullable: true
              x-one-of: source
          x-properties-order:
          - zonal
          - private_network_id
          - subnet_id
        resource:
          type: object
          description: Resource which the IP is attached to.
          properties:
            type:
              type: string
              description: Type of resource the IP is attached to.
              enum:
              - unknown_type
              - custom
              - instance_server
              - instance_ip
              - instance_private_nic
              - lb_server
              - fip_ip
              - vpc_gateway
              - vpc_gateway_network
              - k8s_node
              - k8s_cluster
              - rdb_instance
              - redis_cluster
              - baremetal_server
              - baremetal_private_nic
              - llm_deployment
              default: unknown_type
            id:
              type: string
              description: ID of the resource the IP is attached to. (UUID format)
              example: 6170692e-7363-616c-6577-61792e636f6d
            mac_address:
              type: string
              description: MAC of the resource the IP is attached to.
              nullable: true
            name:
              type: string
              description: |-
                Name of the resource the IP is attached to.
                When the IP is in a Private Network, then a DNS record is available to resolve the resource name to this IP.
              nullable: true
          x-properties-order:
          - type
          - id
          - mac_address
          - name
        tags:
          type: array
          description: Tags for the IP.
          items:
            type: string
        reverses:
          type: array
          description: Array of reverses associated with the IP.
          items:
            $ref: '#/components/schemas/scaleway.ipam.v1.Reverse'
        region:
          type: string
          description: Region of the IP.
        zone:
          type: string
          description: Zone of the IP, if zonal.
      x-properties-order:
      - id
      - address
      - project_id
      - is_ipv6
      - created_at
      - updated_at
      - source
      - resource
      - tags
      - reverses
      - region
      - zone
    scaleway.ipam.v1.ListIPsResponse:
      type: object
      properties:
        total_count:
          type: integer
          format: uint64
        ips:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.ipam.v1.IP'
      x-properties-order:
      - total_count
      - ips
    scaleway.ipam.v1.Resource.Type:
      type: string
      enum:
      - unknown_type
      - custom
      - instance_server
      - instance_ip
      - instance_private_nic
      - lb_server
      - fip_ip
      - vpc_gateway
      - vpc_gateway_network
      - k8s_node
      - k8s_cluster
      - rdb_instance
      - redis_cluster
      - baremetal_server
      - baremetal_private_nic
      - llm_deployment
      default: unknown_type
    scaleway.ipam.v1.Reverse:
      type: object
      properties:
        hostname:
          type: string
          description: Reverse domain name.
        address:
          type: string
          description: IP corresponding to the hostname. (IP address)
          example: 1.2.3.4
          nullable: true
      x-properties-order:
      - hostname
      - address
  securitySchemes:
    scaleway:
      in: header
      name: X-Auth-Token
      type: apiKey
paths:
  /ipam/v1/regions/{region}/ip-sets/release:
    post:
      operationId: ReleaseIPSet
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "204":
          description: ""
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ip_ids:
                  type: array
                  description: (UUID format)
                  example:
                  - 6170692e-7363-616c-6577-61792e636f6d
                  items:
                    type: string
              x-properties-order:
              - ip_ids
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{}' \
            "https://api.scaleway.com/ipam/v1/regions/fr-par/ip-sets/release"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/ipam/v1/regions/fr-par/ip-sets/release" \
            X-Auth-Token:$SCW_SECRET_KEY
  /ipam/v1/regions/{region}/ips:
    get:
      tags:
      - IPs
      operationId: ListIPs
      summary: List existing IPs
      description: 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.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: query
        name: order_by
        description: Sort order of the returned IPs.
        schema:
          type: string
          description: Sort order of the returned IPs.
          enum:
          - created_at_desc
          - created_at_asc
          - updated_at_desc
          - updated_at_asc
          - attached_at_desc
          - attached_at_asc
          default: created_at_desc
      - in: query
        name: page
        description: Page number to return, from the paginated results.
        schema:
          type: integer
          description: Page number to return, from the paginated results.
          format: int32
      - in: query
        name: page_size
        description: Maximum number of IPs to return per page.
        schema:
          type: integer
          description: Maximum number of IPs to return per page.
          format: uint32
      - in: query
        name: project_id
        description: Project ID to filter for. Only IPs belonging to this Project
          will be returned. (UUID format)
        schema:
          type: string
          description: Project ID to filter for. Only IPs belonging to this Project
            will be returned. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: vpc_id
        description: |-
          VPC ID to filter for.
          Only IPs owned by resources in this VPC will be returned.
        schema:
          type: string
          description: |-
            VPC ID to filter for.
            Only IPs owned by resources in this VPC will be returned.
      - in: query
        name: attached
        description: Defines whether to filter only for IPs which are attached to
          a resource.
        schema:
          type: boolean
          description: Defines whether to filter only for IPs which are attached to
            a resource.
      - in: query
        name: resource_id
        description: Resource ID to filter for. Only IPs attached to this resource
          will be returned. (UUID format)
        schema:
          type: string
          description: Resource ID to filter for. Only IPs attached to this resource
            will be returned. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: resource_type
        description: Resource type to filter for. Only IPs attached to this type of
          resource will be returned.
        schema:
          type: string
          description: Resource type to filter for. Only IPs attached to this type
            of resource will be returned.
          enum:
          - unknown_type
          - custom
          - instance_server
          - instance_ip
          - instance_private_nic
          - lb_server
          - fip_ip
          - vpc_gateway
          - vpc_gateway_network
          - k8s_node
          - k8s_cluster
          - rdb_instance
          - redis_cluster
          - baremetal_server
          - baremetal_private_nic
          - llm_deployment
          default: unknown_type
      - in: query
        name: mac_address
        description: MAC address to filter for. Only IPs attached to a resource with
          this MAC address will be returned.
        schema:
          type: string
          description: MAC address to filter for. Only IPs attached to a resource
            with this MAC address will be returned.
      - in: query
        name: tags
        description: Tags to filter for, only IPs with one or more matching tags will
          be returned.
        schema:
          type: array
          description: Tags to filter for, only IPs with one or more matching tags
            will be returned.
          items:
            type: string
      - in: query
        name: organization_id
        description: Organization ID to filter for. Only IPs belonging to this Organization
          will be returned. (UUID format)
        schema:
          type: string
          description: Organization ID to filter for. Only IPs belonging to this Organization
            will be returned. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: is_ipv6
        description: Defines whether to filter only for IPv4s or IPv6s.
        schema:
          type: boolean
          description: Defines whether to filter only for IPv4s or IPv6s.
      - in: query
        name: resource_name
        description: Attached resource name to filter for, only IPs attached to a
          resource with this string within their name will be returned.
        schema:
          type: string
          description: Attached resource name to filter for, only IPs attached to
            a resource with this string within their name will be returned.
      - in: query
        name: resource_types
        description: Resource types to filter for. Only IPs attached to these types
          of resources will be returned.
        schema:
          type: array
          description: Resource types to filter for. Only IPs attached to these types
            of resources will be returned.
          items:
            $ref: '#/components/schemas/scaleway.ipam.v1.Resource.Type'
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.ipam.v1.ListIPsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/ipam/v1/regions/fr-par/ips"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/ipam/v1/regions/fr-par/ips" \
            X-Auth-Token:$SCW_SECRET_KEY
    post:
      tags:
      - IPs
      operationId: BookIP
      summary: Reserve a new IP
      description: Reserve a new IP from the specified source. Currently IPs can only
        be reserved from a Private Network.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.ipam.v1.IP'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: |-
                    Scaleway Project in which to create the IP.
                    When creating an IP in a Private Network, the Project must match the Private Network's Project. (UUID format)
                  example: 6170692e-7363-616c-6577-61792e636f6d
                source:
                  type: object
                  description: Source in which to reserve the IP. Not all sources
                    are available for reservation.
                  properties:
                    zonal:
                      type: string
                      description: |-
                        Zone the IP lives in if the IP is a public zoned IP.
                        This source is global.
                      nullable: true
                      x-one-of: source
                    private_network_id:
                      type: string
                      description: |-
                        Private Network the IP lives in if the IP is a private IP.
                        This source is specific.
                      nullable: true
                      x-one-of: source
                    subnet_id:
                      type: string
                      description: |-
                        Private Network subnet the IP lives in if the IP is a private IP in a Private Network.
                        This source is specific.
                      nullable: true
                      x-one-of: source
                  x-properties-order:
                  - zonal
                  - private_network_id
                  - subnet_id
                is_ipv6:
                  type: boolean
                  description: Request an IPv6 instead of an IPv4.
                address:
                  type: string
                  description: |-
                    Request this specific IP address in the specified source pool.
                    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. (IP address)
                  example: 1.2.3.4
                  nullable: true
                tags:
                  type: array
                  description: Tags for the IP.
                  items:
                    type: string
                resource:
                  type: object
                  description: 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.
                  properties:
                    mac_address:
                      type: string
                      description: MAC address of the custom resource.
                    name:
                      type: string
                      description: |-
                        Name of the custom resource.
                        When the resource is in a Private Network, a DNS record is available to resolve the resource name.
                      nullable: true
                  x-properties-order:
                  - mac_address
                  - name
              required:
              - project_id
              - source
              x-properties-order:
              - project_id
              - source
              - is_ipv6
              - address
              - tags
              - resource
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{
              "is_ipv6": false,
              "project_id": "6170692e-7363-616c-6577-61792e636f6d",
              "source": {
                  "private_network_id": "string",
                  "subnet_id": "string",
                  "zonal": "string"
              }
            }' \
            "https://api.scaleway.com/ipam/v1/regions/fr-par/ips"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/ipam/v1/regions/fr-par/ips" \
            X-Auth-Token:$SCW_SECRET_KEY \
            is_ipv6:=false \
            project_id="6170692e-7363-616c-6577-61792e636f6d" \
            source:='{
              "private_network_id": "string",
              "subnet_id": "string",
              "zonal": "string"
            }'
  /ipam/v1/regions/{region}/ips/{ip_id}:
    get:
      tags:
      - IPs
      operationId: GetIP
      summary: Get an IP
      description: Retrieve details of an existing IP, specified by its IP ID.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: ip_id
        description: IP ID. (UUID format)
        required: true
        schema:
          type: string
          description: IP ID. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.ipam.v1.IP'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/ipam/v1/regions/fr-par/ips/{ip_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/ipam/v1/regions/fr-par/ips/{ip_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    patch:
      tags:
      - IPs
      operationId: UpdateIP
      summary: Update an IP
      description: Update parameters including tags of the specified IP.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: ip_id
        description: IP ID. (UUID format)
        required: true
        schema:
          type: string
          description: IP ID. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.ipam.v1.IP'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                tags:
                  type: array
                  description: Tags for the IP.
                  nullable: true
                  items:
                    type: string
                reverses:
                  type: array
                  description: Array of reverse domain names associated with an IP
                    in the subnet of the current IP.
                  items:
                    $ref: '#/components/schemas/scaleway.ipam.v1.Reverse'
              x-properties-order:
              - tags
              - reverses
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X PATCH \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{}' \
            "https://api.scaleway.com/ipam/v1/regions/fr-par/ips/{ip_id}"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/ipam/v1/regions/fr-par/ips/{ip_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    delete:
      tags:
      - IPs
      operationId: ReleaseIP
      summary: Release an IP
      description: Release an IP not currently attached to a resource, and returns
        it to the available IP pool.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: ip_id
        description: IP ID. (UUID format)
        required: true
        schema:
          type: string
          description: IP ID. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "204":
          description: ""
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X DELETE \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{}' \
            "https://api.scaleway.com/ipam/v1/regions/fr-par/ips/{ip_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/ipam/v1/regions/fr-par/ips/{ip_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /ipam/v1/regions/{region}/ips/{ip_id}/attach:
    post:
      tags:
      - IPs
      operationId: AttachIP
      summary: Attach IP to custom resource
      description: 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.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: ip_id
        description: IP ID. (UUID format)
        required: true
        schema:
          type: string
          description: IP ID. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.ipam.v1.IP'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                resource:
                  type: object
                  description: Custom resource to be attached to the IP.
                  properties:
                    mac_address:
                      type: string
                      description: MAC address of the custom resource.
                    name:
                      type: string
                      description: |-
                        Name of the custom resource.
                        When the resource is in a Private Network, a DNS record is available to resolve the resource name.
                      nullable: true
                  x-properties-order:
                  - mac_address
                  - name
              required:
              - resource
              x-properties-order:
              - resource
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"resource":{"mac_address":"string","name":"string"}}' \
            "https://api.scaleway.com/ipam/v1/regions/fr-par/ips/{ip_id}/attach"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/ipam/v1/regions/fr-par/ips/{ip_id}/attach" \
            X-Auth-Token:$SCW_SECRET_KEY \
            resource:='{"mac_address":"string","name":"string"}'
  /ipam/v1/regions/{region}/ips/{ip_id}/detach:
    post:
      tags:
      - IPs
      operationId: DetachIP
      summary: Detach IP from a custom resource
      description: 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.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: ip_id
        description: IP ID. (UUID format)
        required: true
        schema:
          type: string
          description: IP ID. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.ipam.v1.IP'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                resource:
                  type: object
                  description: Custom resource currently attached to the IP.
                  properties:
                    mac_address:
                      type: string
                      description: MAC address of the custom resource.
                    name:
                      type: string
                      description: |-
                        Name of the custom resource.
                        When the resource is in a Private Network, a DNS record is available to resolve the resource name.
                      nullable: true
                  x-properties-order:
                  - mac_address
                  - name
              required:
              - resource
              x-properties-order:
              - resource
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"resource":{"mac_address":"string","name":"string"}}' \
            "https://api.scaleway.com/ipam/v1/regions/fr-par/ips/{ip_id}/detach"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/ipam/v1/regions/fr-par/ips/{ip_id}/detach" \
            X-Auth-Token:$SCW_SECRET_KEY \
            resource:='{"mac_address":"string","name":"string"}'
  /ipam/v1/regions/{region}/ips/{ip_id}/move:
    post:
      tags:
      - IPs
      operationId: MoveIP
      summary: Move IP to a custom resource
      description: 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.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          description: The region you want to target
          enum:
          - fr-par
          - nl-ams
          - pl-waw
      - in: path
        name: ip_id
        description: IP ID. (UUID format)
        required: true
        schema:
          type: string
          description: IP ID. (UUID format)
          example: 6170692e-7363-616c-6577-61792e636f6d
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.ipam.v1.IP'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                from_resource:
                  type: object
                  description: Custom resource currently attached to the IP.
                  properties:
                    mac_address:
                      type: string
                      description: MAC address of the custom resource.
                    name:
                      type: string
                      description: |-
                        Name of the custom resource.
                        When the resource is in a Private Network, a DNS record is available to resolve the resource name.
                      nullable: true
                  x-properties-order:
                  - mac_address
                  - name
                to_resource:
                  type: object
                  description: Custom resource to be attached to the IP.
                  properties:
                    mac_address:
                      type: string
                      description: MAC address of the custom resource.
                    name:
                      type: string
                      description: |-
                        Name of the custom resource.
                        When the resource is in a Private Network, a DNS record is available to resolve the resource name.
                      nullable: true
                  x-properties-order:
                  - mac_address
                  - name
              required:
              - from_resource
              x-properties-order:
              - from_resource
              - to_resource
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"from_resource":{"mac_address":"string","name":"string"}}' \
            "https://api.scaleway.com/ipam/v1/regions/fr-par/ips/{ip_id}/move"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/ipam/v1/regions/fr-par/ips/{ip_id}/move" \
            X-Auth-Token:$SCW_SECRET_KEY \
            from_resource:='{"mac_address":"string","name":"string"}'
