> For the complete documentation index, see [llms.txt](https://aegion-dynamic.gitbook.io/nimbus/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aegion-dynamic.gitbook.io/nimbus/server-side-development/core-api/tasks-and-queues.md).

# Tasks & Queues

## queues <a href="#nimbus-data-fabric-openapi-3-0-queues" id="nimbus-data-fabric-openapi-3-0-queues"></a>

Operations about queues

[Find out more](http://docs.aegiondynamic.com/nimbus/)

### renameNimbusQueue

> Code samples

```python
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('http://localhost:8080/api/v1/queue/{queueId}', headers = headers)

print(r.json())

```

`PUT /queue/{queueId}`

*Rename a queue*

Rename a queue

> Body parameter

```json
{
  "queueName": "string"
}
```

#### Parameters <a href="#renamenimbusqueue-parameters" id="renamenimbusqueue-parameters"></a>

| Name    | In   | Type             | Required | Description            |
| ------- | ---- | ---------------- | -------- | ---------------------- |
| queueId | path | integer(int64)   | true     | none                   |
| body    | body | queueNameRequest | false    | New name for the queue |

> Example responses

> 200 Response

```json
{
  "queueName": "queueName",
  "id": 0,
  "createdAt": "2000-01-23T04:56:07.000Z"
}
```

#### Responses <a href="#renamenimbusqueue-responses" id="renamenimbusqueue-responses"></a>

| Status | Meaning                                                          | Description          | Schema        |
| ------ | ---------------------------------------------------------------- | -------------------- | ------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | Successful operation | queueResponse |
| 400    | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | Invalid ID supplied  | None          |
| 404    | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)   | Queue not found      | None          |

To perform this operation, you must be authenticated by means of one of the following methods: jwt

### deleteNimbusQueue

> Code samples

```python
import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('http://localhost:8080/api/v1/queue/{queueId}', headers = headers)

print(r.json())

```

`DELETE /queue/{queueId}`

*Delete a queue*

Delete a queue

#### Parameters <a href="#deletenimbusqueue-parameters" id="deletenimbusqueue-parameters"></a>

| Name    | In   | Type           | Required | Description |
| ------- | ---- | -------------- | -------- | ----------- |
| queueId | path | integer(int64) | true     | none        |

> Example responses

> 200 Response

```json
{
  "queueName": "queueName",
  "id": 0,
  "createdAt": "2000-01-23T04:56:07.000Z"
}
```

#### Responses <a href="#deletenimbusqueue-responses" id="deletenimbusqueue-responses"></a>

| Status | Meaning                                                          | Description          | Schema        |
| ------ | ---------------------------------------------------------------- | -------------------- | ------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | Successful operation | queueResponse |
| 400    | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | Invalid ID supplied  | None          |
| 404    | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)   | Queue not found      | None          |

To perform this operation, you must be authenticated by means of one of the following methods: jwt

### getNimbusAllQueues

> Code samples

```python
import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('http://localhost:8080/api/v1/queue', headers = headers)

print(r.json())

```

`GET /queue`

*Get all queues*

Get all queues

> Example responses

> 200 Response

```json
{
  "queueName": "queueName",
  "id": 0,
  "createdAt": "2000-01-23T04:56:07.000Z"
}
```

#### Responses <a href="#getnimbusallqueues-responses" id="getnimbusallqueues-responses"></a>

| Status | Meaning                                                                    | Description          | Schema        |
| ------ | -------------------------------------------------------------------------- | -------------------- | ------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)                    | Successful operation | queueResponse |
| 500    | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | Server Error         | None          |

This operation does not require authentication

### createNimbusQueue

> Code samples

```python
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('http://localhost:8080/api/v1/queue', headers = headers)

print(r.json())

```

`POST /queue`

*Create a new queue*

Create a new queue

> Body parameter

```json
{
  "queueName": "string"
}
```

#### Parameters <a href="#createnimbusqueue-parameters" id="createnimbusqueue-parameters"></a>

| Name | In   | Type             | Required | Description                |
| ---- | ---- | ---------------- | -------- | -------------------------- |
| body | body | queueNameRequest | false    | Queue object to be created |

> Example responses

> 200 Response

```json
{
  "queueName": "queueName",
  "id": 0,
  "createdAt": "2000-01-23T04:56:07.000Z"
}
```

#### Responses <a href="#createnimbusqueue-responses" id="createnimbusqueue-responses"></a>

| Status | Meaning                                                                  | Description          | Schema        |
| ------ | ------------------------------------------------------------------------ | -------------------- | ------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)                  | Successful operation | queueResponse |
| 400    | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)         | Invalid input        | None          |
| 422    | [Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3) | Validation exception | None          |

To perform this operation, you must be authenticated by means of one of the following methods: jwt

### popNimbusTask

> Code samples

```python
import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('http://localhost:8080/api/v1/queue/pop/{queueName}', headers = headers)

print(r.json())

```

`GET /queue/pop/{queueName}`

*Pop a task*

Pop a task from the task queue

#### Parameters <a href="#popnimbustask-parameters" id="popnimbustask-parameters"></a>

| Name      | In   | Type   | Required | Description |
| --------- | ---- | ------ | -------- | ----------- |
| queueName | path | string | true     | none        |

> Example responses

> 200 Response

```json
{
  "taskID": "taskID"
}
```

#### Responses <a href="#popnimbustask-responses" id="popnimbustask-responses"></a>

| Status | Meaning                                                        | Description          | Schema            |
| ------ | -------------------------------------------------------------- | -------------------- | ----------------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)        | Successful operation | inlineResponse200 |
| 404    | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) | No tasks available   | None              |

To perform this operation, you must be authenticated by means of one of the following methods: jwt

## tasks <a href="#nimbus-data-fabric-openapi-3-0-tasks" id="nimbus-data-fabric-openapi-3-0-tasks"></a>

### getAllNimbusTasks

> Code samples

```python
import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('http://localhost:8080/api/v1/task/{queueName}/fromqueue', headers = headers)

print(r.json())

```

`GET /task/{queueName}/fromqueue`

*Get all tasks from a queue*

Get all tasks

#### Parameters <a href="#getallnimbustasks-parameters" id="getallnimbustasks-parameters"></a>

| Name      | In   | Type   | Required | Description |
| --------- | ---- | ------ | -------- | ----------- |
| queueName | path | string | true     | none        |

> Example responses

> 200 Response

```json
[
  {
    "createdAt": "2000-01-23T04:56:07.000Z",
    "queueId": 6,
    "completedAt": "2000-01-23T04:56:07.000Z",
    "payload": "payload",
    "startedAt": "2000-01-23T04:56:07.000Z",
    "id": 0,
    "status": "TO_DO"
  }
]
```

#### Responses <a href="#getallnimbustasks-responses" id="getallnimbustasks-responses"></a>

| Status | Meaning                                                          | Description                | Schema |
| ------ | ---------------------------------------------------------------- | -------------------------- | ------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | Successful operation       | Inline |
| 400    | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | Invalid queuename supplied | None   |
| 404    | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)   | Task not found             | None   |

#### Response Schema <a href="#getallnimbustasks-responseschema" id="getallnimbustasks-responseschema"></a>

Status Code **200**

| Name          | Type              | Required | Restrictions | Description                   |
| ------------- | ----------------- | -------- | ------------ | ----------------------------- |
| *anonymous*   | \[taskResponse]   | false    | none         | none                          |
| » id          | integer(int64)    | false    | none         | Unique ID of the task         |
| » status      | string            | false    | none         | Current status of task        |
| » createdAt   | string(date-time) | false    | none         | Task creation time-date       |
| » startedAt   | string(date-time) | false    | none         | task starting time            |
| » completedAt | string(date-time) | false    | none         | task completion time-date     |
| » payload     | string            | false    | none         | data regarding task           |
| » queueId     | integer(int64)    | false    | none         | queueID to which task belongs |

**Enumerated Values**

| Property | Value        |
| -------- | ------------ |
| status   | TO\_DO       |
| status   | IN\_PROGRESS |
| status   | DONE         |

To perform this operation, you must be authenticated by means of one of the following methods: jwt

### createNimbusTask

> Code samples

```python
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('http://localhost:8080/api/v1/task', headers = headers)

print(r.json())

```

`POST /task`

*Create a new task*

Create a new task

> Body parameter

```json
{
  "queueName": "patient",
  "payload": "payload"
}
```

#### Parameters <a href="#createnimbustask-parameters" id="createnimbustask-parameters"></a>

| Name | In   | Type                  | Required | Description               |
| ---- | ---- | --------------------- | -------- | ------------------------- |
| body | body | addTaskToqueueRequest | false    | Task object to be created |

> Example responses

> 200 Response

```json
{
  "createdAt": "2000-01-23T04:56:07.000Z",
  "queueId": 6,
  "completedAt": "2000-01-23T04:56:07.000Z",
  "payload": "payload",
  "startedAt": "2000-01-23T04:56:07.000Z",
  "id": 0,
  "status": "TO_DO"
}
```

#### Responses <a href="#createnimbustask-responses" id="createnimbustask-responses"></a>

| Status | Meaning                                                                  | Description          | Schema       |
| ------ | ------------------------------------------------------------------------ | -------------------- | ------------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)                  | Successful operation | taskResponse |
| 400    | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)         | Invalid input        | None         |
| 422    | [Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3) | Validation exception | None         |

To perform this operation, you must be authenticated by means of one of the following methods: jwt

### getNimbusTaskById

> Code samples

```python
import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('http://localhost:8080/api/v1/task/{taskId}', headers = headers)

print(r.json())

```

`GET /task/{taskId}`

*Get task by ID*

Returns a single task

#### Parameters <a href="#getnimbustaskbyid-parameters" id="getnimbustaskbyid-parameters"></a>

| Name   | In   | Type           | Required | Description |
| ------ | ---- | -------------- | -------- | ----------- |
| taskId | path | integer(int64) | true     | none        |

> Example responses

> 200 Response

```json
{
  "createdAt": "2000-01-23T04:56:07.000Z",
  "queueId": 6,
  "completedAt": "2000-01-23T04:56:07.000Z",
  "payload": "payload",
  "startedAt": "2000-01-23T04:56:07.000Z",
  "id": 0,
  "status": "TO_DO"
}
```

#### Responses <a href="#getnimbustaskbyid-responses" id="getnimbustaskbyid-responses"></a>

| Status | Meaning                                                          | Description          | Schema       |
| ------ | ---------------------------------------------------------------- | -------------------- | ------------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | Successful operation | taskResponse |
| 400    | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | Invalid ID supplied  | None         |
| 404    | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)   | Task not found       | None         |

To perform this operation, you must be authenticated by means of one of the following methods: jwt

### updateNimbusTask

> Code samples

```python
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('http://localhost:8080/api/v1/task/{taskId}', headers = headers)

print(r.json())

```

`PUT /task/{taskId}`

*Update task*

Update an existing task by ID

> Body parameter

```json
{
  "status": "T0_D0"
}
```

#### Parameters <a href="#updatenimbustask-parameters" id="updatenimbustask-parameters"></a>

| Name   | In   | Type              | Required | Description                          |
| ------ | ---- | ----------------- | -------- | ------------------------------------ |
| taskId | path | integer(int64)    | true     | none                                 |
| body   | body | taskUpdateRequest | false    | Update an existing task in the store |

> Example responses

> 200 Response

```json
{
  "createdAt": "2000-01-23T04:56:07.000Z",
  "queueId": 6,
  "completedAt": "2000-01-23T04:56:07.000Z",
  "payload": "payload",
  "startedAt": "2000-01-23T04:56:07.000Z",
  "id": 0,
  "status": "TO_DO"
}
```

#### Responses <a href="#updatenimbustask-responses" id="updatenimbustask-responses"></a>

| Status | Meaning                                                          | Description          | Schema       |
| ------ | ---------------------------------------------------------------- | -------------------- | ------------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | Successful operation | taskResponse |
| 400    | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | Invalid ID supplied  | None         |
| 404    | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)   | Task not found       | None         |

To perform this operation, you must be authenticated by means of one of the following methods: jwt

### deleteNimbusTask

> Code samples

```python
import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('http://localhost:8080/api/v1/task/{taskId}', headers = headers)

print(r.json())

```

`DELETE /task/{taskId}`

*Delete task*

Delete a task by ID

#### Parameters <a href="#deletenimbustask-parameters" id="deletenimbustask-parameters"></a>

| Name   | In   | Type           | Required | Description |
| ------ | ---- | -------------- | -------- | ----------- |
| taskId | path | integer(int64) | true     | none        |

> Example responses

> 200 Response

```json
{
  "createdAt": "2000-01-23T04:56:07.000Z",
  "queueId": 6,
  "completedAt": "2000-01-23T04:56:07.000Z",
  "payload": "payload",
  "startedAt": "2000-01-23T04:56:07.000Z",
  "id": 0,
  "status": "TO_DO"
}
```

#### Responses <a href="#deletenimbustask-responses" id="deletenimbustask-responses"></a>

| Status | Meaning                                                          | Description          | Schema       |
| ------ | ---------------------------------------------------------------- | -------------------- | ------------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | Successful operation | taskResponse |
| 400    | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | Invalid ID supplied  | None         |
| 404    | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)   | Task not found       | None         |

To perform this operation, you must be authenticated by means of one of the following methods: jwt

### getNimbusTaskStatus

> Code samples

```python
import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('http://localhost:8080/api/v1/task/{taskId}/status', headers = headers)

print(r.json())

```

`GET /task/{taskId}/status`

*Get task status*

Get the status of a task by ID

#### Parameters <a href="#getnimbustaskstatus-parameters" id="getnimbustaskstatus-parameters"></a>

| Name   | In   | Type           | Required | Description |
| ------ | ---- | -------------- | -------- | ----------- |
| taskId | path | integer(int64) | true     | none        |

> Example responses

> 200 Response

```json
{
  "status": "status"
}
```

#### Responses <a href="#getnimbustaskstatus-responses" id="getnimbustaskstatus-responses"></a>

| Status | Meaning                                                          | Description          | Schema     |
| ------ | ---------------------------------------------------------------- | -------------------- | ---------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | Successful operation | taskStatus |
| 400    | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | Invalid ID supplied  | None       |
| 404    | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)   | Task not found       | None       |

To perform this operation, you must be authenticated by means of one of the following methods: jwt
