# Elastic IP


<style>
  span[class^="pill-"] {
    color: white;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.6em;
    vertical-align: middle;
    margin-right: 12px;
    font-family: sans-serif;
    font-weight: bold;
    display: inline-block;
    line-height: 1;
  }
  span.pill-GET { background-color: #61affe; }
  span.pill-POST { background-color: #49cc90; }
  span.pill-PUT { background-color: #fca130; }
  span.pill-DELETE { background-color: #f93e3e; }
  span.pill-PATCH { background-color: #50e3c2; }
  span[class^="pill-"]:after {
    content: attr(data-label);
    font-size: 0.9rem;
  }
</style>

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

[Read more](https://community.exoscale.com/product/networking/eip/)

## <span data-label="POST" class="pill-POST"></span>create-elastic-ip

Create an Elastic IP

```
POST /elastic-ip
```

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `addressfamily` | string | no | Elastic IP address family (default: :inet4)<br/><br/>Allowed values: `inet4`, `inet6`. |
| `description` | string | no | Elastic IP description<br/><br/>Max length: `255`. |
| `healthcheck` | [Elastic IP address healthcheck](/reference/api/_schemas/elastic-ip-healthcheck/) | no | Elastic IP healthcheck |
| `labels` | object | no | Resource labels |

<details>
<summary>Example</summary>

```json
{
  "addressfamily": "inet4",
  "description": "string",
  "healthcheck": {
    "interval": 0,
    "mode": "tcp",
    "port": 0,
    "strikes-fail": 0,
    "strikes-ok": 0,
    "timeout": 0,
    "tls-skip-verify": true,
    "tls-sni": "string",
    "uri": "string"
  },
  "labels": {}
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `create-elastic-ip`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.CreateElasticIP) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.create_elastic_ip) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#createElasticIp(com.exoscale.sdk.model.CreateElasticIpRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api create-elastic-ip`

## <span data-label="GET" class="pill-GET"></span>get-elastic-ip

Retrieve Elastic IP details

```
GET /elastic-ip/{id}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `addressfamily` | string | Elastic IP address family<br/><br/>Allowed values: `inet4`, `inet6`. |
| `cidr` | string | Elastic IP cidr |
| `description` | string | Elastic IP description<br/><br/>Max length: `255`. |
| `healthcheck` | [Elastic IP address healthcheck](/reference/api/_schemas/elastic-ip-healthcheck/) | Elastic IP healthcheck |
| `id` | string | Elastic IP ID<br/><br/>Must be a valid UUID. |
| `ip` | string | Elastic IP address |
| `labels` | object | Resource labels |

<details>
<summary>Example output</summary>

```json
{
  "addressfamily": "inet4",
  "cidr": "string",
  "description": "string",
  "healthcheck": {
    "interval": 0,
    "mode": "tcp",
    "port": 0,
    "strikes-fail": 0,
    "strikes-ok": 0,
    "timeout": 0,
    "tls-skip-verify": true,
    "tls-sni": "string",
    "uri": "string"
  },
  "id": "string",
  "ip": "string",
  "labels": {}
}
```
</details>


SDK reference for `get-elastic-ip`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.GetElasticIP) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.get_elastic_ip) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#getElasticIp(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api get-elastic-ip`

## <span data-label="PUT" class="pill-PUT"></span>update-elastic-ip

Update an Elastic IP

```
PUT /elastic-ip/{id}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string | no | Elastic IP description<br/><br/>Max length: `255`. |
| `healthcheck` | [Elastic IP address healthcheck](/reference/api/_schemas/elastic-ip-healthcheck/) | no | Elastic IP healthcheck |
| `labels` | object | no | Resource labels |

<details>
<summary>Example</summary>

```json
{
  "description": "string",
  "healthcheck": {
    "interval": 0,
    "mode": "tcp",
    "port": 0,
    "strikes-fail": 0,
    "strikes-ok": 0,
    "timeout": 0,
    "tls-skip-verify": true,
    "tls-sni": "string",
    "uri": "string"
  },
  "labels": {}
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `update-elastic-ip`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.UpdateElasticIP) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.update_elastic_ip) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#updateElasticIp(java.util.UUID,com.exoscale.sdk.model.UpdateElasticIpRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api update-elastic-ip`

## <span data-label="DELETE" class="pill-DELETE"></span>delete-elastic-ip

Delete an Elastic IP

```
DELETE /elastic-ip/{id}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `delete-elastic-ip`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DeleteElasticIP) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.delete_elastic_ip) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#deleteElasticIp(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api delete-elastic-ip`


---

## Other Operations

## <span data-label="DELETE" class="pill-DELETE"></span>reset-elastic-ip-field

Reset an Elastic IP field to its default value

```
DELETE /elastic-ip/{id}/{field}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |
| `field` | `path` |  |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `reset-elastic-ip-field`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ResetElasticIPField) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.reset_elastic_ip_field) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#resetElasticIpField(java.util.UUID,java.lang.String))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api reset-elastic-ip-field`

## <span data-label="GET" class="pill-GET"></span>list-elastic-ips

List Elastic IPs

```
GET /elastic-ip
```

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `elastic-ips` | array of [Elastic IP](/reference/api/_schemas/elastic-ip/) |  |

<details>
<summary>Example output</summary>

```json
{
  "elastic-ips": [
    {
      "addressfamily": "inet4",
      "cidr": "string",
      "description": "string",
      "healthcheck": {
        "interval": 0,
        "mode": "tcp",
        "port": 0,
        "strikes-fail": 0,
        "strikes-ok": 0,
        "timeout": 0,
        "tls-skip-verify": true,
        "tls-sni": "string",
        "uri": "string"
      },
      "id": "string",
      "ip": "string",
      "labels": {}
    }
  ]
}
```
</details>


SDK reference for `list-elastic-ips`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ListElasticIPS) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.list_elastic_ips) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#listElasticIps())

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api list-elastic-ips`

## <span data-label="PUT" class="pill-PUT"></span>detach-instance-from-elastic-ip

Detach a Compute instance from an Elastic IP

```
PUT /elastic-ip/{id}:detach
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `instance` | [Target Instance](/reference/api/_schemas/instance-ref/) | **yes** | Compute instance |

<details>
<summary>Example</summary>

```json
{
  "instance": {
    "id": "string"
  }
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `detach-instance-from-elastic-ip`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DetachInstanceFromElasticIP) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.detach_instance_from_elastic_ip) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#detachInstanceFromElasticIp(java.util.UUID,com.exoscale.sdk.model.DetachInstanceFromElasticIpRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api detach-instance-from-elastic-ip`

## <span data-label="PUT" class="pill-PUT"></span>attach-instance-to-elastic-ip

Attach a Compute instance to an Elastic IP

```
PUT /elastic-ip/{id}:attach
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `instance` | [Target Instance](/reference/api/_schemas/instance-ref/) | **yes** | Compute instance |

<details>
<summary>Example</summary>

```json
{
  "instance": {
    "id": "string"
  }
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `attach-instance-to-elastic-ip`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.AttachInstanceToElasticIP) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.attach_instance_to_elastic_ip) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#attachInstanceToElasticIp(java.util.UUID,com.exoscale.sdk.model.AttachInstanceToElasticIpRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api attach-instance-to-elastic-ip`


