Exoscale elastic-ip API

Elastic IPs are additional public IPv4/6 addresses that can be attached to Compute instances, with optional healthcheck support.

OpenAPI Specification

exoscale-elastic-ip-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: 2.0.0
  termsOfService: https://exoscale.com/terms
  contact:
    email: support@exoscale.com
    name: Exoscale Support
    url: https://portal.exoscale.com/tickets
  title: Exoscale ai-api-key elastic-ip API
  description: Infrastructure automation API, allowing programmatic access to all Exoscale products and services.
servers:
- url: https://api-{zone}.exoscale.com/v2
  variables:
    zone:
      default: ch-gva-2
      enum:
      - ch-gva-2
      - ch-dk-2
      - de-fra-1
      - de-muc-1
      - at-vie-1
      - at-vie-2
      - bg-sof-1
      - hr-zag-1
tags:
- description: Elastic IPs are additional public IPv4/6 addresses that can be attached to Compute instances, with optional healthcheck support.
  parent: compute
  externalDocs:
    description: Read more
    url: https://community.exoscale.com/product/networking/eip/
  name: elastic-ip
  x-display-name: Elastic IP
  x-weight: 170
  x-icon: exo-eip
paths:
  /elastic-ip:
    post:
      tags:
      - elastic-ip
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/operation'
      description: ''
      parameters: []
      summary: Create an Elastic IP
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                addressfamily:
                  type: string
                  enum:
                  - inet4
                  - inet6
                  description: 'Elastic IP address family (default: :inet4)'
                description:
                  type: string
                  maxLength: 255
                  description: Elastic IP description
                healthcheck:
                  $ref: '#/components/schemas/elastic-ip-healthcheck'
                  description: Elastic IP healthcheck
                labels:
                  $ref: '#/components/schemas/labels'
                  description: Resource labels
      operationId: create-elastic-ip
    get:
      tags:
      - elastic-ip
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  elastic-ips:
                    type: array
                    items:
                      $ref: '#/components/schemas/elastic-ip'
      description: ''
      parameters: []
      summary: List Elastic IPs
      operationId: list-elastic-ips
  /elastic-ip/{id}/{field}:
    delete:
      tags:
      - elastic-ip
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/operation'
      description: ''
      parameters:
      - in: path
        required: true
        name: id
        schema:
          type: string
          format: uuid
      - in: path
        required: true
        name: field
        schema:
          type: string
          enum:
          - description
      summary: Reset an Elastic IP field to its default value
      operationId: reset-elastic-ip-field
  /elastic-ip/{id}:detach:
    put:
      tags:
      - elastic-ip
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/operation'
      description: ''
      parameters:
      - in: path
        required: true
        name: id
        schema:
          type: string
          format: uuid
      summary: Detach a Compute instance from an Elastic IP
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                instance:
                  $ref: '#/components/schemas/instance-ref'
                  description: Compute instance
              required:
              - instance
      operationId: detach-instance-from-elastic-ip
  /elastic-ip/{id}:attach:
    put:
      tags:
      - elastic-ip
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/operation'
      description: ''
      parameters:
      - in: path
        required: true
        name: id
        schema:
          type: string
          format: uuid
      summary: Attach a Compute instance to an Elastic IP
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                instance:
                  $ref: '#/components/schemas/instance-ref'
                  description: Compute instance
              required:
              - instance
      operationId: attach-instance-to-elastic-ip
  /elastic-ip/{id}:
    put:
      tags:
      - elastic-ip
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/operation'
      description: ''
      parameters:
      - in: path
        required: true
        name: id
        schema:
          type: string
          format: uuid
      summary: Update an Elastic IP
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                description:
                  type: string
                  maxLength: 255
                  description: Elastic IP description
                healthcheck:
                  $ref: '#/components/schemas/elastic-ip-healthcheck'
                  description: Elastic IP healthcheck
                labels:
                  $ref: '#/components/schemas/labels'
                  description: Resource labels
      operationId: update-elastic-ip
    get:
      tags:
      - elastic-ip
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/elastic-ip'
      description: ''
      parameters:
      - in: path
        required: true
        name: id
        schema:
          type: string
          format: uuid
      summary: Retrieve Elastic IP details
      operationId: get-elastic-ip
    delete:
      tags:
      - elastic-ip
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/operation'
      description: ''
      parameters:
      - in: path
        required: true
        name: id
        schema:
          type: string
          format: uuid
      summary: Delete an Elastic IP
      operationId: delete-elastic-ip
components:
  schemas:
    labels:
      type: object
      additionalProperties:
        type: string
    operation:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: Operation ID
        reason:
          type: string
          enum:
          - incorrect
          - unknown
          - unavailable
          - forbidden
          - busy
          - fault
          - partial
          - not-found
          - interrupted
          - unsupported
          - conflict
          readOnly: true
          description: Operation failure reason
        reference:
          type: object
          properties:
            id:
              type: string
              format: uuid
              description: Reference ID
            link:
              type: string
              readOnly: true
              description: Link to the referenced resource
            command:
              type: string
              description: Command name
          description: Related resource reference
          readOnly: true
        message:
          type: string
          readOnly: true
          description: Operation message
        state:
          type: string
          enum:
          - failure
          - pending
          - success
          - timeout
          readOnly: true
          description: Operation status
      description: Operation
    elastic-ip-healthcheck:
      type: object
      properties:
        strikes-ok:
          type: integer
          format: int64
          minimum: 1
          maximum: 20
          exclusiveMinimum: false
          exclusiveMaximum: false
          description: 'Number of attempts before considering the target healthy (default: 2)'
        tls-skip-verify:
          type: boolean
          description: Skip TLS verification
        tls-sni:
          type: string
          maxLength: 255
          minLength: 1
          description: An optional domain or subdomain to check TLS against
        strikes-fail:
          type: integer
          format: int64
          minimum: 1
          maximum: 20
          exclusiveMinimum: false
          exclusiveMaximum: false
          description: 'Number of attempts before considering the target unhealthy (default: 3)'
        mode:
          type: string
          enum:
          - tcp
          - http
          - https
          description: Health check mode
        port:
          type: integer
          format: int64
          minimum: 1
          maximum: 65535
          exclusiveMinimum: false
          exclusiveMaximum: false
          description: Health check port
        uri:
          type: string
          maxLength: 255
          minLength: 1
          description: An endpoint to use for the health check, for example '/status'
        interval:
          type: integer
          format: int64
          minimum: 5
          maximum: 300
          exclusiveMinimum: false
          exclusiveMaximum: false
          description: 'Interval between the checks in seconds (default: 10)'
        timeout:
          type: integer
          format: int64
          minimum: 2
          maximum: 60
          exclusiveMinimum: false
          exclusiveMaximum: false
          description: 'Health check timeout value in seconds (default: 2)'
      required:
      - mode
      - port
      description: Elastic IP address healthcheck
    elastic-ip:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          x-go-findable: '1'
          description: Elastic IP ID
        ip:
          type: string
          readOnly: true
          x-go-findable: '2'
          description: Elastic IP address
        addressfamily:
          type: string
          enum:
          - inet4
          - inet6
          readOnly: true
          description: Elastic IP address family
        cidr:
          type: string
          readOnly: true
          description: Elastic IP cidr
        description:
          type: string
          maxLength: 255
          description: Elastic IP description
        healthcheck:
          $ref: '#/components/schemas/elastic-ip-healthcheck'
          description: Elastic IP healthcheck
        labels:
          $ref: '#/components/schemas/labels'
          description: Resource labels
      description: Elastic IP
    instance-ref:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Instance ID
      description: Target Instance
x-topics:
- title: API Request Signature
  content: '

    In order to authenticate legitimate users, the Exoscale API requires incoming requests to be signed using valid Exoscale API account credentials with the following mechanism.


    ## Signature Mechanism


    The *message* (i.e. content) to sign contains several segments concatenated using a line return character (`\n`).


    All segments must be included and in the described order. For cases where a segment doesn''t fit the context of the request (e.g. no request body) **an empty line must be used instead**.


    * Request method and request URL (path only), separated by a space character

    * Request body

    * Request URL parameters (Query String) values, concatenated without separator. The matching parameter names have to be specified in the resulting signature header `signed-query-args=` pragma, separated by semicolons (e.g. `p1;p2;pN`).

    * Request header values, concatenated without separator (none at the moment, leave empty)

    * Request expiration date in UNIX timestamp format


    Example *message* to sign for `GET /v2/resource/a02baf5a-a3e4-49a0-857b-8a08d276c1c0?p1=v1&p2=v2`:


    ```

    GET /v2/resource/a02baf5a-a3e4-49a0-857b-8a08d276c1c0


    v1v2


    1599140767

    ```


    The two blank lines above are due to the absence of a request body and signed headers.


    Example *message* to [create a security group](https://community.exoscale.com/reference/api/compute/security-group/#create-security-group)


    ```

    POST /v2/security-group

    {"name": "my-security-group"}



    1599140767

    ```


    The two blank lines above are due to the absence of query parameters and signed headers.


    The request signature consists of the base64-encoded [HMAC](https://en.wikipedia.org/wiki/HMAC) hash of the UTF-8 encoded *message* and the Exoscale API secret using the SHA265 function:


    ```

    signature = BASE64_ENCODE(HMAC_SHA256(Exoscale API secret, message))

    ```


    Finally, the computed signature must be added to the API request in a `Authorization` header such as:


    ```

    Authorization: EXO2-HMAC-SHA256 credential=<Exoscale API key>,expires=<expiration date UNIX timestamp>,signature=<signature>

    ```


    Example API query:


    ```

    GET /v2/resource/a02baf5a-a3e4-49a0-857b-8a08d276c1c0?p1=v1&p2=v2 HTTP/1.1

    Host: api-ch-gva-2.exoscale.com

    Authorization: EXO2-HMAC-SHA256 credential=EXO29147e9f89102b7ac1e88514,signed-query-args=p1;p2,expires=1599140767,signature=2AOBQsbElQb4FpKT/FM/9T4NobjlmZkSGvvdUth/xlY=

    ```


    ## Reference Implementations


    You can look up the following existing reference implementations:


    * Go: [github.com/exoscale/egoscale/api/v2 > `SecurityProviderExoscale.signRequest`](https://github.com/exoscale/egoscale/blob/master/v2/api/security.go)

    * Python: [requests-exoscale-auth > `ExoscaleV2Auth`](https://github.com/exoscale/requests-exoscale-auth/blob/master/exoscale_auth.py)


    '
- title: Zone local resources
  content: '

    The API is deployed across all Exoscale zones. When performing a compute call, you should use the relevant zone for your resource.

    For example: https://api-de-fra-1.exoscale.com/v2/instance would return only the instances from `de-fra-1`, https://api-ch-gva-2.exoscale.com/v2/instance from `ch-gva-2`.

    To obtain a list of all instances across all zones, you would need to do the corresponding request for each zone.

    '