Foxx Service Miscellaneous

List service scripts

list service scripts

GET /_api/foxx/scripts

Query Parameters

  • mount (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.

Return codes

  • 200: Returned if the request was sucessful.

Run service script

run service script

POST /_api/foxx/scripts/{name}

Path Parameters

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

Query Parameters

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

Request Body (json)

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.

Return codes

  • 200: Returned if the request was sucessful.

Run service tests

run service tests

POST /_api/foxx/tests

Query Parameters

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

  • reporter (optional): Test reporter to use.

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

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.

Return codes

  • 200: Returned if the request was sucessful.

Enable development mode

enable development mode

POST /_api/foxx/development

Query Parameters

  • mount (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.

Return codes

  • 200: Returned if the request was sucessful.

Disable development mode

disable development mode

DELETE /_api/foxx/development

Query Parameters

  • mount (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.

Return codes

  • 200: Returned if the request was sucessful.

Service README

service README

GET /_api/foxx/readme

Query Parameters

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

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

Return codes

  • 200: Returned if the request was sucessful.

  • 204: Returned if no README file was found.

Swagger description

swagger description

GET /_api/foxx/swagger

Query Parameters

  • mount (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.

Return codes

  • 200: Returned if the request was sucessful.

Download service bundle

download service bundle

POST /_api/foxx/download

Query Parameters

  • mount (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.

Return codes

  • 200: Returned if the request was sucessful.

  • 400: Returned if the mount path is unknown.

Commit local service state

commit local service state

POST /_api/foxx/commit

Query Parameters

  • replace (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.

Return codes

  • 204: Returned if the request was sucessful.