HTTP RESTful API
Collection API
The following changes affect the behavior of the RESTful collection APIs at
endpoints starting with path /_api/collection/:
The collection properties indexBuckets, journalSize, doCompact and
isVolatile only had a meaning for the MMFiles storage engine, which is not
available anymore since ArangoDB 3.7.
ArangoDB 3.8 now removes any special handling for these obsolete collection properties, meaning these attributes will not be processed by the server and not be returned by any server APIs. Using these attributes in any API call will be ignored, and will not trigger any errors.
Client applications and tests that rely on the behavior that setting any of these obsolete properties produces an error on the server side may need to be adjusted now.
Www-Authenticate response header
ArangoDB 3.8 adds back the Www-Authenticate response header for HTTP server
responses with a status code of 401. Returning the Www-Authenticate header for
401 responses is required by the HTTP/1.1 specification and was also advertised
functionality in the ArangoDB documentation, but wasn’t happening in practice.
Now the functionality of returning Www-Authenticate response headers for HTTP
401 responses is restored, along with the already advertised functionality of
suppressing this header in case the client sends an X-Omit-Www-Authenticate
header with the request.
This change should not have any impact for client applications that use ArangoDB as a database only. It may have an effect for Foxx applications that use HTTP 401 status code responses and that will now see this extra header getting returned.
Endpoint return value changes
The endpoint
/_api/replication/clusterInventoryreturns, among other things, an array of the existing collections. Each collection has aplanVersionattribute, which in ArangoDB 3.8 is now hard-coded to the value of 1.Before 3.7, the most recent Plan version from the agency was returned inside
planVersionfor each collection. In 3.7, the attribute contained the Plan version that was in use when the in-memory LogicalCollection object was last constructed. The object was always reconstructed in case the underlying Plan data for the collection changed, or when a collection contained links to ArangoSearch Views. This made the attribute relatively useless for any real-world use cases, and so we are now hard-coding it to simplify the internal code. Using the attribute in client applications is also deprecated.The endpoint
/_api/transactionpreviously would allow users to list, query, commit, and abort transactions operating in any database as long as the user had sufficient permissions. Now the endpoint will restrict operations to transactions within the current database.The HTTP API for starting a Pregel run
/_api/control-pregelnow returns the Pregel execution number as a stringified execution number, e.g. “12345” instead of 12345. This is not downwards-compatible, so all client applications that depend on the return value being a numeric value need to be adjusted to handle a string return value and convert that string into a number.Changed the encoding of revision IDs returned by the below listed REST APIs.
Introduced in: v3.8.8
GET /_api/collection/<collection-name>/revision: The revision ID was previously returned as numeric value, and now it is returned as a string value with either numeric encoding or HLC-encoding inside.GET /_api/collection/<collection-name>/checksum: The revision ID in therevisionattribute was previously encoded as a numeric value in single server, and as a string in cluster. This is now unified so that therevisionattribute always contains a string value with either numeric encoding or HLC-encoding inside.
Endpoints added
The cursor API endpoint
PUT /_api/cursor/<cursor-id>to retrieve more data from an existing AQL query cursor is now also available underPOST /_api/cursor/<cursor-id>.The new POST API is a drop-in replacement for the existing PUT API and functionally equivalent to it. The benefit of using the POST API is that HTTP POST requests will not be considered as idempotent, so proxies may not retry them if they fail. This was the case with the existing PUT API, as HTTP PUT requests can be considered idempotent according to the HTTP specification.
The POST API is not yet used by ArangoDB 3.8, including the web UI and the client tools. This is to ensure the compatibility of 3.8 with earlier versions, which may be in use during upgrade to 3.8, or with one of the 3.8 client tools. The PUT API will remain fully functional in this version of ArangoDB and the next. The following version of ArangoDB will switch to using the POST variant instead of the PUT for its own requests, including web UI and client tools. Driver maintainers should eventually move to the POST variant of the cursor API as well. This is safe for drivers targeting 3.8 or higher.
The new REST endpoint at GET
/_admin/log/entriescan be used to retrieve server log messages in a more intuitive format than the already existing API at GET/_admin/log.The new API returns all matching log messages in an array, with one array entry per log message. Each log message is returned as an object containing the properties of the log message:
{ "total" : 13, "messages": [ { "id" : 12, "topic" : "general", "level" : "INFO", "date" : "2021-02-07T01:00:21Z", "message" : "[cf3f4] {general} ArangoDB (version 3.8.0-devel enterprise [linux]) is ready for business. Have fun!" }, { "id" : 11, "topic" : "general", "level" : "INFO", "date" : "2021-02-07T01:00:21Z", "message" : "[99d80] {general} You are using a milestone/alpha/beta/preview version ('3.8.0-devel') of ArangoDB" } ] }The previous API returned an object with 5 attributes at the top-level instead, which contained arrays with the attribute values of all log messages:
{ "totalAmount" : 13, "lid" : [ 12, 11 ], "topic" : [ "general", "general" ], "level" : [ 3, 3 ], "timestamp" : [ 1612659621, 1612659621 ], "text" : [ "[cf3f4] {general} ArangoDB (version 3.8.0-devel enterprise [linux]) is ready for business. Have fun!", "[99d80] {general} You are using a milestone/alpha/beta/preview version ('3.8.0-devel') of ArangoDB" ] }The old API endpoint GET
/_admin/logfor retrieving log messages is now deprecated, although it will stay available for some time.Added endpoint for new version “v2” of the metrics API:
GET /_admin/metrics/v2will return Prometheus-format of the server metrics.The old endpoint
GET /_admin/metricsis still supported but is considered to be obsolete from 3.8 on and will be removed in a future version. Also see Features and Improvements in 3.8.In the new API V2, there are quite a lot more metrics than in previous versions and a lot have been renamed to follow Prometheus conventions. Below is a list of renamed metrics:
/_admin/metrics /_admin/metrics/ v2 arangodb_agency_ cache_ callback_ count arangodb_agency_ cache_ callback_ number arangodb_agency_ callback_ count arangodb_agency_ callback_ number arangodb_agency_ callback_ registered arangodb_agency_ callback_ registered_ total arangodb_agency_ read_ no_ leader arangodb_agency_ read_ no_ leader_ total arangodb_agency_ read_ ok arangodb_agency_ read_ ok_ total arangodb_agency_ supervision_ accum_ runtime_ msec arangodb_agency_ supervision_ accum_ runtime_ msec_ total arangodb_agency_ supervision_ accum_ runtime_ wait_ for_ replication_ msec arangodb_agency_ supervision_ accum_ runtime_ wait_ for_ replication_ msec_ total arangodb_agency_ supervision_ failed_ server_ count arangodb_agency_ supervision_ failed_ server_ total arangodb_agency_ write_ no_ leader arangodb_agency_ write_ no_ leader_ total arangodb_agency_ write_ ok arangodb_agency_ write_ ok_ total arangodb_aql_ all_ query arangodb_aql_ all_ query_ total arangodb_aql_ slow_ query arangodb_aql_ slow_ query_ total arangodb_aql_ total_ query_ time_ msec arangodb_aql_ total_ query_ time_ msec_ total arangodb_collection_ lock_ acquisition_ micros arangodb_collection_ lock_ acquisition_ micros_ total arangodb_collection_ lock_ sequential_ mode arangodb_collection_ lock_ sequential_ mode_ total arangodb_collection_ lock_ timeouts_ exclusive arangodb_collection_ lock_ timeouts_ exclusive_ total arangodb_collection_ lock_ timeouts_ write arangodb_collection_ lock_ timeouts_ write_ total arangodb_collection_ truncates arangodb_collection_ truncates_ total arangodb_collection_ truncates_ replication arangodb_collection_ truncates_ replication_ total arangodb_connection_ connections_ current arangodb_connection_ pool_ connections_ current arangodb_connection_ leases_ successful arangodb_connection_ pool_ leases_ successful_ total arangodb_connection_ pool_ connections_ created arangodb_connection_ pool_ connections_ created_ total arangodb_connection_ pool_ leases_ failed arangodb_connection_ pool_ leases_ failed_ total arangodb_document_ writes arangodb_document_ writes_ total arangodb_document_ writes_ replication arangodb_document_ writes_ replication_ total arangodb_dropped_ followers_ count arangodb_dropped_ followers_ total arangodb_heartbeat_ failures arangodb_heartbeat_ failures_ total arangodb_http_ request_ statistics_ async_ requests arangodb_http_ request_ statistics_ async_ requests_ total arangodb_http_ request_ statistics_ http_ delete_ requests arangodb_http_ request_ statistics_ http_ delete_ requests_ total arangodb_http_ request_ statistics_ http_ get_ requests arangodb_http_ request_ statistics_ http_ get_ requests_ total arangodb_http_ request_ statistics_ http_ head_ requests arangodb_http_ request_ statistics_ http_ head_ requests_ total arangodb_http_ request_ statistics_ http_ options_ requests arangodb_http_ request_ statistics_ http_ options_ requests_ total arangodb_http_ request_ statistics_ http_ patch_ requests arangodb_http_ request_ statistics_ http_ patch_ requests_ total arangodb_http_ request_ statistics_ http_ post_ requests arangodb_http_ request_ statistics_ http_ post_ requests_ total arangodb_http_ request_ statistics_ http_ put_ requests arangodb_http_ request_ statistics_ http_ put_ requests_ total arangodb_http_ request_ statistics_ other_ http_ requests arangodb_http_ request_ statistics_ other_ http_ requests_ total arangodb_http_ request_ statistics_ superuser_ requests arangodb_http_ request_ statistics_ superuser_ requests_ total arangodb_http_ request_ statistics_ total_ requests arangodb_http_ request_ statistics_ total_ requests_ total arangodb_http_ request_ statistics_ user_ requests arangodb_http_ request_ statistics_ user_ requests_ total arangodb_intermediate_ commits arangodb_intermediate_ commits_ total arangodb_load_ current_ accum_ runtime_ msec arangodb_load_ current_ accum_ runtime_ msec_ total arangodb_load_ plan_ accum_ runtime_ msec arangodb_load_ plan_ accum_ runtime_ msec_ total arangodb_maintenance_ action_ accum_ queue_ time_ msec arangodb_maintenance_ action_ accum_ queue_ time_ msec_ total arangodb_maintenance_ action_ accum_ runtime_ msec arangodb_maintenance_ action_ accum_ runtime_ msec_ total arangodb_maintenance_ action_ done_ counter arangodb_maintenance_ action_ done_ total arangodb_maintenance_ action_ duplicate_ counter arangodb_maintenance_ action_ duplicate_ total arangodb_maintenance_ action_ failure_ counter arangodb_maintenance_ action_ failure_ total arangodb_maintenance_ action_ registered_ counter arangodb_maintenance_ action_ registered_ total arangodb_maintenance_ agency_ sync_ accum_ runtime_ msec arangodb_maintenance_ agency_ sync_ accum_ runtime_ msec_ total arangodb_maintenance_ phase1_ accum_ runtime_ msec arangodb_maintenance_ phase1_ accum_ runtime_ msec_ total arangodb_maintenance_ phase2_ accum_ runtime_ msec arangodb_maintenance_ phase2_ accum_ runtime_ msec_ total arangodb_network_ forwarded_ requests arangodb_network_ forwarded_ requests_ total arangodb_network_ request_ timeouts arangodb_network_ request_ timeouts_ total arangodb_process_ statistics_ major_ page_ faults arangodb_process_ statistics_ major_ page_ faults_ total arangodb_process_ statistics_ minor_ page_ faults arangodb_process_ statistics_ minor_ page_ faults_ total arangodb_refused_ followers_ count arangodb_refused_ followers_ total arangodb_replication_ cluster_ inventory_ requests arangodb_replication_ cluster_ inventory_ requests_ total arangodb_replication_ dump_ apply_ time arangodb_replication_ dump_ apply_ time_ total arangodb_replication_ dump_ bytes_ received arangodb_replication_ dump_ bytes_ received_ total arangodb_replication_ dump_ documents arangodb_replication_ dump_ documents_ total arangodb_replication_ dump_ requests arangodb_replication_ dump_ requests_ total arangodb_replication_ dump_ request_ time arangodb_replication_ dump_ request_ time_ total arangodb_replication_ failed_ connects arangodb_replication_ failed_ connects_ total arangodb_replication_ initial_ chunks_ requests_ time arangodb_replication_ initial_ chunks_ requests_ time_ total arangodb_replication_ initial_ docs_ requests_ time arangodb_replication_ initial_ docs_ requests_ time_ total arangodb_replication_ initial_ insert_ apply_ time arangodb_replication_ initial_ insert_ apply_ time_ total arangodb_replication_ initial_ keys_ requests_ time arangodb_replication_ initial_ keys_ requests_ time_ total arangodb_replication_ initial_ lookup_ time arangodb_replication_ initial_ lookup_ time_ total arangodb_replication_ initial_ remove_ apply_ time arangodb_replication_ initial_ remove_ apply_ time_ total arangodb_replication_ initial_ sync_ bytes_ received arangodb_replication_ initial_ sync_ bytes_ received_ total arangodb_replication_ initial_ sync_ docs_ inserted arangodb_replication_ initial_ sync_ docs_ inserted_ total arangodb_replication_ initial_ sync_ docs_ removed arangodb_replication_ initial_ sync_ docs_ removed_ total arangodb_replication_ initial_ sync_ docs_ requested arangodb_replication_ initial_ sync_ docs_ requested_ total arangodb_replication_ initial_ sync_ docs_ requests arangodb_replication_ initial_ sync_ docs_ requests_ total arangodb_replication_ initial_ sync_ keys_ requests arangodb_replication_ initial_ sync_ keys_ requests_ total arangodb_replication_ synchronous_ requests_ total_ number arangodb_replication_ synchronous_ requests_ total_ number_ total arangodb_replication_ synchronous_ requests_ total_ time arangodb_replication_ synchronous_ requests_ total_ time_ total arangodb_replication_ tailing_ apply_ time arangodb_replication_ tailing_ apply_ time_ total arangodb_replication_ tailing_ bytes_ received arangodb_replication_ tailing_ bytes_ received_ total arangodb_replication_ tailing_ documents arangodb_replication_ tailing_ documents_ total arangodb_replication_ tailing_ follow_ tick_ failures arangodb_replication_ tailing_ follow_ tick_ failures_ total arangodb_replication_ tailing_ markers arangodb_replication_ tailing_ markers_ total arangodb_replication_ tailing_ removals arangodb_replication_ tailing_ removals_ total arangodb_replication_ tailing_ requests arangodb_replication_ tailing_ requests_ total arangodb_replication_ tailing_ request_ time arangodb_replication_ tailing_ request_ time_ total arangodb_scheduler_ queue_ full_ failures arangodb_scheduler_ queue_ full_ failures_ total arangodb_scheduler_ threads_ started arangodb_scheduler_ threads_ started_ total arangodb_scheduler_ threads_ stopped arangodb_scheduler_ threads_ stopped_ total arangodb_server_ statistics_ server_ uptime arangodb_server_ statistics_ server_ uptime_ total arangodb_shards_ leader_ count arangodb_shards_ leader_ number arangodb_shards_ total_ count arangodb_shards_ number arangodb_sync_ wrong_ checksum arangodb_sync_ wrong_ checksum_ total arangodb_transactions_ aborted arangodb_transactions_ aborted_ total arangodb_transactions_ committed arangodb_transactions_ committed_ total arangodb_transactions_ expired arangodb_transactions_ expired_ total arangodb_transactions_ started arangodb_transactions_ started_ total arangodb_v8_ context_ created arangodb_v8_ context_ created_ total arangodb_v8_ context_ creation_ time_ msec arangodb_v8_ context_ creation_ time_ msec_ total arangodb_v8_ context_ destroyed arangodb_v8_ context_ destroyed_ total arangodb_v8_ context_ entered arangodb_v8_ context_ entered_ total arangodb_v8_ context_ enter_ failures arangodb_v8_ context_ enter_ failures_ total arangodb_v8_ context_ exited arangodb_v8_ context_ exited_ total rocksdbengine_throttle_ bps rocksdb_engine_ throttle_ bps rocksdb_write_ stalls arangodb_rocksdb_ write_ stalls_ total rocksdb_write_ stops arangodb_rocksdb_ write_ stops_ total
Endpoints augmented
The REST endpoint at GET
/_api/engine/statsnow returns useful information in cluster setups too. Previously calling this API on a Coordinator always produced an empty JSON object result, whereas now it will produce a JSON object with one key per DB-Server. The mapped value per DB-Server are the engine statistics for this particular server.The return value structure is different to the return value structure in single server, where the return value is a simple JSON object with the statistics at the top level.
The REST endpoint for creating indexes, POST
/_api/index, can now handle the attributeestimates, which determines if the to-be-created index should maintain selectivity estimates or not. If not specified, the default value for this attribute istruefor indexes of type “persistent”, so that selectivity estimates are maintained. They can be optionally turned off by setting the attribute tofalse. Turning off selectivity estimates can have a slightly positive effect on write performance. The attribute will only be picked up for indexes of type “persistent”, “hash” and “skiplist” (where the latter two are aliases for “persistent” nowadays).The REST endpoint at GET
/_api/collection/<collection>/checksumnow also works in cluster setups. In previous versions, this endpoint was not supported in cluster setups and returned HTTP 501 (Not implemented).The HTTP REST API endpoint
POST /_api/cursorcan now handle an additional sub-attributefillBlockCachefor itsoptionsattribute.fillBlockCachecontrols whether the to-be-executed query should populate the RocksDB block cache with the data read by the query. This is an optional attribute, and its default value istrue, meaning that the block cache will be populated (introduced in v3.8.1).The metrics endpoints include the following new traffic accounting metrics:
Introduced in: v3.8.9
arangodb_client_user_connection_statistics_bytes_receivedarangodb_client_user_connection_statistics_bytes_sentarangodb_http1_connections_total
Endpoints deprecated
The API endpoints /_admin/statistics and /_admin/statistics-description are
now deprecated in favor of the new metrics API endpoint /_admin/metrics/v2.
The metrics endpoint provides a lot more information than the statistics
endpoints, and will also be augmented with more metrics in the future.
The statistics endpoints will still be functional in 3.8, but will eventually
be removed in a future version of ArangoDB.
The REST API endpoint /_api/export is also deprecated in ArangoDB 3.8. This
endpoint was previously only present in single server, but never supported in
cluster deployments. The purpose of the endpoint was to provide the full data
of a collection without holding collection locks for a long time, which was
useful for the MMFile storage engine with its collection-level locks. If the
functionality provided by this endpoint is still required by client
applications, running a streaming AQL query to export the collection data can
be used as a substitution.
Endpoints removed
The API endpoint /_admin/repair/distributeShardsLike for repairing the
distributeShardsLike settings of cluster collections introduced before
version 3.2.12 or 3.3.4 respectively, is now deprecated and removed from
documentation.
There should not be any reasons to use this API with 3.8 or higher, and there was never any driver or official script support for it. The endpoint will be removed in ArangoDB 3.9.
JavaScript API
- The JavaScript API for starting a Pregel run
/_api/control-pregelnow returns the Pregel execution number as a stringified execution number, e.g. “12345” instead of 12345. This is not downwards-compatible. Foxx services, arangosh scripts etc. that depend on the return value being a numeric value may need to be adjusted to handle a string return value and convert that string into a number.
ArangoDB Server Environment Variables
The new environment variable TZ_DATA can be used to specify the path to the
directory containing the timezone information database for ArangoDB.
That directory is normally named tzdata and is shipped with ArangoDB releases.
It is normally not required to set this environment variable, but it may be
necessary in unusual setups with non-conventional directory layouts and paths.
