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

ArangoDB's Jobs 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.

# `cancel`

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

Cancel an async job

Cancels the currently running job identified by `job-id`. Note that it still
might take some time to actually cancel the running async job.

# `cancel!`

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

Cancel an async job. Raises on error.

See `cancel/2`.

# `delete`

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

Delete async job results

Deletes either all job results, expired job results, or the result of a
specific job.
Clients can use this method to perform an eventual garbage collection of job
results.

# `delete!`

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

Delete async job results. Raises on error.

See `delete/2`.

# `get`

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

List async jobs by status or get the status of specific job

This endpoint returns either of the following, depending on the specified value
for the `job-id` parameter:

- The IDs of async jobs with a specific status
- The processing status of a specific async job

# `get!`

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

List async jobs by status or get the status of specific job. Raises on error.

See `get/2`.

# `result`

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

Get the results of an async job

Returns the result of an async job identified by `job-id` if it's ready.

If the async job result is available on the server, the endpoint returns
the original operation's result headers and body, plus the additional
`x-arango-async-job-id` HTTP header. The result and job are then removed
which means that you can retrieve the result exactly once.

If the result is not available yet or if the job is not known (anymore),
the additional header is not present and you can tell the status from
the HTTP status code.

# `result!`

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

Get the results of an async job. Raises on error.

See `result/2`.

---

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