Arangox.API.Tasks (Arangox v0.8.0)

Copy Markdown View Source

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.

Summary

Functions

List all tasks

List all tasks. Raises on error.

Create a task. Raises on error.

Create a task with ID. Raises on error.

Delete a task. Raises on error.

Get a task. Raises on error.

Functions

all(conn, opts \\ [])

@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!(conn, opts \\ [])

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

List all tasks. Raises on error.

See all/1.

create(conn, body, opts \\ [])

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

Create a task

Creates a new task with a generated identifier.

create!(conn, body, opts \\ [])

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

Create a task. Raises on error.

See create/2.

create_with_id(conn, id, body, opts \\ [])

@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!(conn, id, body, opts \\ [])

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

Create a task with ID. Raises on error.

See create_with_id/3.

delete(conn, id, opts \\ [])

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

Delete a task

Deletes the task identified by id on the server.

delete!(conn, id, opts \\ [])

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

Delete a task. Raises on error.

See delete/2.

get(conn, id, opts \\ [])

@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!(conn, id, opts \\ [])

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

Get a task. Raises on error.

See get/2.