ArangoDB v3.9 reached End of Life (EOL) and is no longer supported.

This documentation is outdated. Please see the most recent version at docs.arangodb.com

Foxx Service Miscellaneous

List service scripts

list service scripts

GET /_api/foxx/scripts

Query Parameters

  • mount (string, required): Mount path of the installed service.

Fetches a list of the scripts defined by the service.

Returns an object mapping the raw script names to human-friendly names.

Responses

HTTP 200: Returned if the request was successful.

Run service script

run service script

POST /_api/foxx/scripts/{name}

Path Parameters

  • name (string, required): Name of the script to run.

Query Parameters

  • mount (string, required): Mount path of the installed service.

Request Body

(json, optional)

An arbitrary JSON value that will be parsed and passed to the script as its first argument.

Runs the given script for the service at the given mount path.

Returns the exports of the script, if any.

Responses

HTTP 200: Returned if the request was successful.

Run service tests

run service tests

POST /_api/foxx/tests

Query Parameters

  • mount (string, required): Mount path of the installed service.

  • reporter (string, optional): Test reporter to use.

  • idiomatic (boolean, optional): Use the matching format for the reporter, regardless of the Accept header.

  • filter (string, optional): Only run tests where the full name (including full test suites and test case) matches this string.

Runs the tests for the service at the given mount path and returns the results.

Supported test reporters are:

  • default: a simple list of test cases
  • suite: an object of test cases nested in suites
  • stream: a raw stream of test results
  • xunit: an XUnit/JUnit compatible structure
  • tap: a raw TAP compatible stream

The Accept request header can be used to further control the response format:

When using the stream reporter application/x-ldjson will result in the response body being formatted as a newline-delimited JSON stream.

When using the tap reporter text/plain or text/* will result in the response body being formatted as a plain text TAP report.

When using the xunit reporter application/xml or text/xml will result in the response body being formatted as XML instead of JSONML.

Otherwise the response body will be formatted as non-prettyprinted JSON.

Responses

HTTP 200: Returned if the request was successful.

Enable development mode

enable development mode

POST /_api/foxx/development

Query Parameters

  • mount (string, required): Mount path of the installed service.

Puts the service into development mode.

While the service is running in development mode the service will be reloaded from the filesystem and its setup script (if any) will be re-executed every time the service handles a request.

When running ArangoDB in a cluster with multiple Coordinators note that changes to the filesystem on one Coordinator will not be reflected across the other Coordinators. This means you should treat your Coordinators as inconsistent as long as any service is running in development mode.

Responses

HTTP 200: Returned if the request was successful.

Disable development mode

disable development mode

DELETE /_api/foxx/development

Query Parameters

  • mount (string, required): Mount path of the installed service.

Puts the service at the given mount path into production mode.

When running ArangoDB in a cluster with multiple Coordinators this will replace the service on all other Coordinators with the version on this Coordinator.

Responses

HTTP 200: Returned if the request was successful.

Service README

service README

GET /_api/foxx/readme

Query Parameters

  • mount (string, required): Mount path of the installed service.

Fetches the service’s README or README.md file’s contents if any.

Responses

HTTP 200: Returned if the request was successful.

HTTP 204: Returned if no README file was found.

Swagger description

swagger description

GET /_api/foxx/swagger

Query Parameters

  • mount (string, required): Mount path of the installed service.

Fetches the Swagger API description for the service at the given mount path.

The response body will be an OpenAPI 2.0 compatible JSON description of the service API.

Responses

HTTP 200: Returned if the request was successful.

Download service bundle

download service bundle

POST /_api/foxx/download

Query Parameters

  • mount (string, required): Mount path of the installed service.

Downloads a zip bundle of the service directory.

When development mode is enabled, this always creates a new bundle.

Otherwise the bundle will represent the version of a service that is installed on that ArangoDB instance.

Responses

HTTP 200: Returned if the request was successful.

HTTP 400: Returned if the mount path is unknown.

Commit local service state

commit local service state

POST /_api/foxx/commit

Query Parameters

  • replace (boolean, optional): Overwrite existing service files in database even if they already exist.

Commits the local service state of the Coordinator to the database.

This can be used to resolve service conflicts between Coordinators that can not be fixed automatically due to missing data.

Responses

HTTP 204: Returned if the request was successful.