# Network › IP addresses › Tasks API

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

> 2 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/network/ip-addresses/tasks/

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

## Operations

- `GET /ip/{ip}/task` — List tasks
- `GET /ip/{ip}/task/{taskId}` — Get a task

## List tasks

`GET /1.0/ip/{ip}/task`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/tasks/#get-ip-ip-task

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:task/get`

List tasks. Returns the IDs of the block's asynchronous operations, filterable by function or status.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `function` | query | ip.TaskFunctionEnum |  | Filter the value of function property (=) — one of `arinBlockReassign`, `changeRipeOrg`, `checkAndReleaseIp`, `genericMoveFloatingIp`, `supernetByoipFailoverPartitioning` |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `status` | query | ip.TaskStatusEnum |  | Filter the value of status property (=) — one of `cancelled`, `customerError`, `doing`, `done`, `init`, `ovhError`, `todo` |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | integer[] | successful operation |

```json
[
  0
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/task" \
  -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("/ip/{ip}/task")

# 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("/ip/{ip}/task");

print_r($result);
?>
```

## Get a task

`GET /1.0/ip/{ip}/task/{taskId}`

Link: https://developers.eu.ovhcloud.com/reference/network/ip-addresses/tasks/#get-ip-ip-task-taskid

**Status:** Stable production version  
**IAM actions:** `ip:apiovh:task/get`

Get a task. Returns the task's function, status, details, and its start, last update and completion dates.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | path | ipBlock | yes | IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) |
| `taskId` | path | integer | yes | the id of the task |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ip.IpTask | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `comment` | string | read-only | Details of this task |
| `destination` | ip.RoutedTo | read-only | Destination for moveFloatingIp tasks |
| `destination.serviceName` | string |  | Service where ip is routed to |
| `doneDate` | string (date-time) | read-only | Completion date |
| `function` | ip.TaskFunctionEnum | read-only | Function name — one of `arinBlockReassign`, `changeRipeOrg`, `checkAndReleaseIp`, `genericMoveFloatingIp`, `supernetByoipFailoverPartitioning` |
| `lastUpdate` | string (date-time) | read-only | last update |
| `startDate` | string (date-time) | read-only | Task Creation date |
| `status` | ip.TaskStatusEnum | read-only | Task status — one of `cancelled`, `customerError`, `doing`, `done`, `init`, `ovhError`, `todo` |
| `taskId` | integer | read-only | the id of the task |

```json
{
  "comment": "string",
  "destination": {
    "serviceName": "string"
  },
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "arinBlockReassign",
  "lastUpdate": "2024-01-01T12:00:00Z",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled",
  "taskId": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ip/{ip}/task/{taskId}" \
  -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("/ip/{ip}/task/{taskId}")

# 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("/ip/{ip}/task/{taskId}");

print_r($result);
?>
```
