# `Arangox.API.Tasks`
[🔗](https://github.com/ArangoDB-Community/arangox/blob/v0.8.0/lib/arangox/api/tasks.ex#L1)

ArangoDB's Tasks operations.

Every function takes the pool as its first argument and returns the decoded
response body. See `Arangox.API.Client` for the options they all accept and
for what a `404` returns.

# `all`

```elixir
@spec all(
  Arangox.conn(),
  keyword()
) :: {:ok, term()} | {:error, Exception.t()}
```

List all tasks

Fetches all existing tasks on the server.

## Returns

Recorded against ArangoDB 3.12.10:

    [%{
      "command" => string,
      "created" => float,
      "database" => string,
      "id" => string,
      "name" => string,
      "offset" => float,
      "period" => integer,
      "type" => string
    }]

# `all!`

```elixir
@spec all!(
  Arangox.conn(),
  keyword()
) :: term()
```

List all tasks. Raises on error.

See `all/1`.

# `create`

```elixir
@spec create(Arangox.conn(), term(), keyword()) ::
  {:ok, term()} | {:error, Exception.t()}
```

Create a task

Creates a new task with a generated identifier.

# `create!`

```elixir
@spec create!(Arangox.conn(), term(), keyword()) :: term()
```

Create a task. Raises on error.

See `create/2`.

# `create_with_id`

```elixir
@spec create_with_id(Arangox.conn(), binary(), term(), keyword()) ::
  {:ok, term()} | {:error, Exception.t()}
```

Create a task with ID

Registers a new task with the specified ID.

Not compatible with load balancers.

# `create_with_id!`

```elixir
@spec create_with_id!(Arangox.conn(), binary(), term(), keyword()) :: term()
```

Create a task with ID. Raises on error.

See `create_with_id/3`.

# `delete`

```elixir
@spec delete(Arangox.conn(), binary(), keyword()) ::
  {:ok, term()} | {:error, Exception.t()}
```

Delete a task

Deletes the task identified by `id` on the server.

# `delete!`

```elixir
@spec delete!(Arangox.conn(), binary(), keyword()) :: term()
```

Delete a task. Raises on error.

See `delete/2`.

# `get`

```elixir
@spec get(Arangox.conn(), binary(), keyword()) ::
  {:ok, term()} | {:error, Exception.t()}
```

Get a task

fetches one existing task on the server specified by `id`

# `get!`

```elixir
@spec get!(Arangox.conn(), binary(), keyword()) :: term()
```

Get a task. Raises on error.

See `get/2`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
