# Public Cloud › Network › Public IP › Floating IPs API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Public Cloud product's sections: https://developers.eu.ovhcloud.com/reference/public-cloud/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 5 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/public-cloud/network/public-ip/floating-ips/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/public-cloud/network/public-ip/floating-ips.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/public-cloud/network/public-ip/floating-ips.json?format=openapi3

## Operations

- `GET /publicCloud/project/{projectId}/publicIp/floating` — List floating IPs
- `GET /publicCloud/project/{projectId}/publicIp/floating/{id}` — Get a floating IP
- `POST /publicCloud/project/{projectId}/publicIp/floating` — Create a floating IP
- `DELETE /publicCloud/project/{projectId}/publicIp/floating/{id}` — Delete a floating IP
- `PUT /publicCloud/project/{projectId}/publicIp/floating/{id}` — Update a floating IP

## List floating IPs

`GET /v2/publicCloud/project/{projectId}/publicIp/floating`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/network/public-ip/floating-ips/#getFloatingIps

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:publicIp/floating/get`

Returns the floating IPs of the project.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `projectId` | path | string | yes | Project ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.publicIp.FloatingIP[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the floating IP |
| `currentState` | publicCloud.publicIp.FloatingIPCurrentState | read-only | Current state of the floating IP |
| `currentState.associatedResource` | publicCloud.publicIp.PublicIPAssociatedResource | read-only | Resource currently associated with this floating IP |
| `currentState.associatedResource.id` | string | read-only | Identifier of the associated resource |
| `currentState.associatedResource.type` | publicCloud.publicIp.PublicIPAssociatedResourceTypeEnum | read-only | Associated resource type — one of `GATEWAY`, `INSTANCE` |
| `currentState.description` | string | read-only | Floating IP description |
| `currentState.id` | string (uuid) | read-only | Identifier of the underlying OpenStack resource |
| `currentState.ip` | ip | read-only | Floating IP address |
| `currentState.location` | publicCloud.common.Location | read-only | Current location |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.network` | publicCloud.publicIp.FloatingIPNetwork | read-only | Network the floating IP is allocated on |
| `currentState.network.id` | string (uuid) | read-only | Identifier of the network |
| `currentState.status` | publicCloud.publicIp.FloatingIPStatusEnum | read-only | OpenStack floating IP status — one of `ACTIVE`, `BUILD`, `DOWN`, `ERROR`, `PENDING_CREATE`, `PENDING_DELETE`, `PENDING_UPDATE` |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the floating IP |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | ip | read-only | The floating IP address, used as identifier |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Floating IP readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.publicIp.FloatingIPTargetSpec | read-only | Last target specification of the floating IP |
| `targetSpec.description` | string |  | Floating IP description |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `updatedAt` | string (date-time) | read-only | Last update date of the floating IP |

```json
[
  {
    "checksum": "string",
    "createdAt": "2024-01-01T12:00:00Z",
    "currentState": {
      "associatedResource": {
        "id": "string",
        "type": "GATEWAY"
      },
      "description": "string",
      "id": "00000000-0000-0000-0000-000000000000",
      "ip": "192.0.2.0",
      "location": {
        "availabilityZone": "string",
        "region": "string"
      },
      "network": {
        "id": "00000000-0000-0000-0000-000000000000"
      },
      "status": "ACTIVE"
    },
    "currentTasks": [
      {
        "errors": [
          {
            "message": "string"
          }
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "link": "string",
        "status": "ERROR",
        "type": "string"
      }
    ],
    "id": "192.0.2.0",
    "resourceStatus": "CREATING",
    "targetSpec": {
      "description": "string",
      "location": {
        "availabilityZone": "string",
        "region": "string"
      }
    },
    "updatedAt": "2024-01-01T12:00:00Z"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/publicIp/floating" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/publicIp/floating")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/publicIp/floating");

print_r($result);
?>
```

## Get a floating IP

`GET /v2/publicCloud/project/{projectId}/publicIp/floating/{id}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/network/public-ip/floating-ips/#getFloatingIp

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:publicIp/floating/get`

Returns the floating IP, including the resource it's currently associated with.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | ip | yes | Id |
| `projectId` | path | string | yes | Project ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.publicIp.FloatingIP | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the floating IP |
| `currentState` | publicCloud.publicIp.FloatingIPCurrentState | read-only | Current state of the floating IP |
| `currentState.associatedResource` | publicCloud.publicIp.PublicIPAssociatedResource | read-only | Resource currently associated with this floating IP |
| `currentState.associatedResource.id` | string | read-only | Identifier of the associated resource |
| `currentState.associatedResource.type` | publicCloud.publicIp.PublicIPAssociatedResourceTypeEnum | read-only | Associated resource type — one of `GATEWAY`, `INSTANCE` |
| `currentState.description` | string | read-only | Floating IP description |
| `currentState.id` | string (uuid) | read-only | Identifier of the underlying OpenStack resource |
| `currentState.ip` | ip | read-only | Floating IP address |
| `currentState.location` | publicCloud.common.Location | read-only | Current location |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.network` | publicCloud.publicIp.FloatingIPNetwork | read-only | Network the floating IP is allocated on |
| `currentState.network.id` | string (uuid) | read-only | Identifier of the network |
| `currentState.status` | publicCloud.publicIp.FloatingIPStatusEnum | read-only | OpenStack floating IP status — one of `ACTIVE`, `BUILD`, `DOWN`, `ERROR`, `PENDING_CREATE`, `PENDING_DELETE`, `PENDING_UPDATE` |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the floating IP |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | ip | read-only | The floating IP address, used as identifier |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Floating IP readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.publicIp.FloatingIPTargetSpec | read-only | Last target specification of the floating IP |
| `targetSpec.description` | string |  | Floating IP description |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `updatedAt` | string (date-time) | read-only | Last update date of the floating IP |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "associatedResource": {
      "id": "string",
      "type": "GATEWAY"
    },
    "description": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "ip": "192.0.2.0",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "network": {
      "id": "00000000-0000-0000-0000-000000000000"
    },
    "status": "ACTIVE"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "192.0.2.0",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "description": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    }
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/publicIp/floating/{id}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/publicIp/floating/{id}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/publicIp/floating/{id}");

print_r($result);
?>
```

## Create a floating IP

`POST /v2/publicCloud/project/{projectId}/publicIp/floating`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/network/public-ip/floating-ips/#createFloatingIp

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:publicIp/floating/create`

Allocates a floating IP in a region.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |

### Request body (required)

Type: `publicCloud.publicIp.FloatingIPCreation`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `targetSpec` | publicCloud.publicIp.FloatingIPTargetSpec | yes | Desired target specification for the floating IP to create |
| `targetSpec.description` | string |  | Floating IP description |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |

```json
{
  "targetSpec": {
    "description": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    }
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.publicIp.FloatingIP | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the floating IP |
| `currentState` | publicCloud.publicIp.FloatingIPCurrentState | read-only | Current state of the floating IP |
| `currentState.associatedResource` | publicCloud.publicIp.PublicIPAssociatedResource | read-only | Resource currently associated with this floating IP |
| `currentState.associatedResource.id` | string | read-only | Identifier of the associated resource |
| `currentState.associatedResource.type` | publicCloud.publicIp.PublicIPAssociatedResourceTypeEnum | read-only | Associated resource type — one of `GATEWAY`, `INSTANCE` |
| `currentState.description` | string | read-only | Floating IP description |
| `currentState.id` | string (uuid) | read-only | Identifier of the underlying OpenStack resource |
| `currentState.ip` | ip | read-only | Floating IP address |
| `currentState.location` | publicCloud.common.Location | read-only | Current location |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.network` | publicCloud.publicIp.FloatingIPNetwork | read-only | Network the floating IP is allocated on |
| `currentState.network.id` | string (uuid) | read-only | Identifier of the network |
| `currentState.status` | publicCloud.publicIp.FloatingIPStatusEnum | read-only | OpenStack floating IP status — one of `ACTIVE`, `BUILD`, `DOWN`, `ERROR`, `PENDING_CREATE`, `PENDING_DELETE`, `PENDING_UPDATE` |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the floating IP |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | ip | read-only | The floating IP address, used as identifier |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Floating IP readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.publicIp.FloatingIPTargetSpec | read-only | Last target specification of the floating IP |
| `targetSpec.description` | string |  | Floating IP description |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `updatedAt` | string (date-time) | read-only | Last update date of the floating IP |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "associatedResource": {
      "id": "string",
      "type": "GATEWAY"
    },
    "description": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "ip": "192.0.2.0",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "network": {
      "id": "00000000-0000-0000-0000-000000000000"
    },
    "status": "ACTIVE"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "192.0.2.0",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "description": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    }
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/publicIp/floating" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: publicCloud.publicIp.FloatingIPCreation
result = client.post("/v2/publicCloud/project/{projectId}/publicIp/floating",
	targetSpec = None, # Desired target specification for the floating IP to create (type: publicCloud.publicIp.FloatingIPTargetSpec)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: publicCloud.publicIp.FloatingIPCreation
$result = $ovh->post("/v2/publicCloud/project/{projectId}/publicIp/floating", array(
	targetSpec => null, // Desired target specification for the floating IP to create (type: publicCloud.publicIp.FloatingIPTargetSpec)
));

print_r($result);
?>
```

## Delete a floating IP

`DELETE /v2/publicCloud/project/{projectId}/publicIp/floating/{id}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/network/public-ip/floating-ips/#deleteFloatingIp

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:publicIp/floating/delete`

Deletes the floating IP. If it's associated with a resource, it is disassociated automatically.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | ip | yes | Id |
| `projectId` | path | string | yes | Project ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.publicIp.FloatingIP | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the floating IP |
| `currentState` | publicCloud.publicIp.FloatingIPCurrentState | read-only | Current state of the floating IP |
| `currentState.associatedResource` | publicCloud.publicIp.PublicIPAssociatedResource | read-only | Resource currently associated with this floating IP |
| `currentState.associatedResource.id` | string | read-only | Identifier of the associated resource |
| `currentState.associatedResource.type` | publicCloud.publicIp.PublicIPAssociatedResourceTypeEnum | read-only | Associated resource type — one of `GATEWAY`, `INSTANCE` |
| `currentState.description` | string | read-only | Floating IP description |
| `currentState.id` | string (uuid) | read-only | Identifier of the underlying OpenStack resource |
| `currentState.ip` | ip | read-only | Floating IP address |
| `currentState.location` | publicCloud.common.Location | read-only | Current location |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.network` | publicCloud.publicIp.FloatingIPNetwork | read-only | Network the floating IP is allocated on |
| `currentState.network.id` | string (uuid) | read-only | Identifier of the network |
| `currentState.status` | publicCloud.publicIp.FloatingIPStatusEnum | read-only | OpenStack floating IP status — one of `ACTIVE`, `BUILD`, `DOWN`, `ERROR`, `PENDING_CREATE`, `PENDING_DELETE`, `PENDING_UPDATE` |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the floating IP |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | ip | read-only | The floating IP address, used as identifier |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Floating IP readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.publicIp.FloatingIPTargetSpec | read-only | Last target specification of the floating IP |
| `targetSpec.description` | string |  | Floating IP description |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `updatedAt` | string (date-time) | read-only | Last update date of the floating IP |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "associatedResource": {
      "id": "string",
      "type": "GATEWAY"
    },
    "description": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "ip": "192.0.2.0",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "network": {
      "id": "00000000-0000-0000-0000-000000000000"
    },
    "status": "ACTIVE"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "192.0.2.0",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "description": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    }
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/publicIp/floating/{id}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/v2/publicCloud/project/{projectId}/publicIp/floating/{id}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/v2/publicCloud/project/{projectId}/publicIp/floating/{id}");

print_r($result);
?>
```

## Update a floating IP

`PUT /v2/publicCloud/project/{projectId}/publicIp/floating/{id}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/network/public-ip/floating-ips/#editFloatingIp

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:publicIp/floating/edit`

Replaces the floating IP's target specification as a whole. The body carries the complete desired state of every field `publicCloud.publicIp.FloatingIPUpdateTargetSpec` exposes, which today is `description` alone. `description` is optional: restate it to keep it, and leave it out to clear it. This is how a description is removed. There is no separate delete.

The create-only field `location` cannot be changed once the floating IP exists. It is deliberately absent from the update model, and sending it is rejected with a 400.

The optional `checksum` guards against a lost update: when supplied it must match the floating IP's current checksum or the request is rejected with a 409 checksum mismatch. Omitting it skips the check and forces the write (last-write-wins).

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | ip | yes | Id |
| `projectId` | path | string | yes | Project ID |

### Request body (required)

Type: `publicCloud.publicIp.FloatingIPUpdate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string |  | Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). |
| `targetSpec` | publicCloud.publicIp.FloatingIPUpdateTargetSpec | yes | Desired target specification for the floating IP |
| `targetSpec.description` | string |  | Floating IP description |

```json
{
  "checksum": "string",
  "targetSpec": {
    "description": "string"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.publicIp.FloatingIP | successful operation |
| 400 | object | Error 400 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the floating IP |
| `currentState` | publicCloud.publicIp.FloatingIPCurrentState | read-only | Current state of the floating IP |
| `currentState.associatedResource` | publicCloud.publicIp.PublicIPAssociatedResource | read-only | Resource currently associated with this floating IP |
| `currentState.associatedResource.id` | string | read-only | Identifier of the associated resource |
| `currentState.associatedResource.type` | publicCloud.publicIp.PublicIPAssociatedResourceTypeEnum | read-only | Associated resource type — one of `GATEWAY`, `INSTANCE` |
| `currentState.description` | string | read-only | Floating IP description |
| `currentState.id` | string (uuid) | read-only | Identifier of the underlying OpenStack resource |
| `currentState.ip` | ip | read-only | Floating IP address |
| `currentState.location` | publicCloud.common.Location | read-only | Current location |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.network` | publicCloud.publicIp.FloatingIPNetwork | read-only | Network the floating IP is allocated on |
| `currentState.network.id` | string (uuid) | read-only | Identifier of the network |
| `currentState.status` | publicCloud.publicIp.FloatingIPStatusEnum | read-only | OpenStack floating IP status — one of `ACTIVE`, `BUILD`, `DOWN`, `ERROR`, `PENDING_CREATE`, `PENDING_DELETE`, `PENDING_UPDATE` |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the floating IP |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | ip | read-only | The floating IP address, used as identifier |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Floating IP readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.publicIp.FloatingIPTargetSpec | read-only | Last target specification of the floating IP |
| `targetSpec.description` | string |  | Floating IP description |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `updatedAt` | string (date-time) | read-only | Last update date of the floating IP |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "associatedResource": {
      "id": "string",
      "type": "GATEWAY"
    },
    "description": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "ip": "192.0.2.0",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "network": {
      "id": "00000000-0000-0000-0000-000000000000"
    },
    "status": "ACTIVE"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "192.0.2.0",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "description": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    }
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/publicIp/floating/{id}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: publicCloud.publicIp.FloatingIPUpdate
result = client.put("/v2/publicCloud/project/{projectId}/publicIp/floating/{id}",
	checksum = None, # Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). (type: string, nullable)
	targetSpec = None, # Desired target specification for the floating IP (type: publicCloud.publicIp.FloatingIPUpdateTargetSpec)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: publicCloud.publicIp.FloatingIPUpdate
$result = $ovh->put("/v2/publicCloud/project/{projectId}/publicIp/floating/{id}", array(
	checksum => null, // Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). (type: string, nullable)
	targetSpec => null, // Desired target specification for the floating IP (type: publicCloud.publicIp.FloatingIPUpdateTargetSpec)
));

print_r($result);
?>
```
