{ "basePath": "/", "swaggerVersion": "1.1", "apiVersion": "0.1", "apis": [ { "operations": [ { "errorResponses": [ { "reason": "is returned if the logger was started successfully, or was already running. ", "code": "200" }, { "reason": "is returned when an invalid HTTP method is used. ", "code": "405" }, { "reason": "is returned if the logger could not be started. ", "code": "500" } ], "parameters": [], "notes": "Starts the server's replication logger. Will do nothing if the replication logger is already running.

The body of the response contains a JSON object with the following attributes:

- running: will contain true

", "summary": "starts the replication logger", "httpMethod": "PUT", "examples": "Starts the replication logger.

unix> curl -X PUT --dump - http://localhost:8529/_api/replication/logger-start\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"running\" : true \n}\n\n

", "nickname": "startsTheReplicationLogger" } ], "path": "/_api/replication/logger-start" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the logger was stopped successfully, or was not running before. ", "code": "200" }, { "reason": "is returned when an invalid HTTP method is used. ", "code": "405" }, { "reason": "is returned if the logger could not be stopped. ", "code": "500" } ], "parameters": [], "notes": "Stops the server's replication logger. Will do nothing if the replication logger is not running.

The body of the response contains a JSON object with the following attributes:

- running: will contain false

", "summary": "stops the replication logger", "httpMethod": "PUT", "examples": "Starts the replication logger.

unix> curl -X PUT --dump - http://localhost:8529/_api/replication/logger-stop\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"running\" : false \n}\n\n

", "nickname": "stopsTheReplicationLogger" } ], "path": "/_api/replication/logger-stop" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the logger state could be determined successfully. ", "code": "200" }, { "reason": "is returned when an invalid HTTP method is used. ", "code": "405" }, { "reason": "is returned if the logger state could not be determined. ", "code": "500" } ], "parameters": [], "notes": "Returns the current state of the server's replication logger. The state will include information about whether the logger is running and about the last logged tick value. This tick value is important for incremental fetching of data.

The state API can be called regardless of whether the logger is currently running or not.

The body of the response contains a JSON object with the following attributes:

- state: the current logger state as a JSON hash array with the following sub-attributes:

- running: whether or not the logger is running

- lastLogTick: the tick value of the latest tick the logger has logged. This value can be used for incremental fetching of log data.

- totalEvents: total number of events logged since the server was started. The value is not reset between multiple stops and re-starts of the logger.

- time: the current date and time on the logger server

- server: a JSON hash with the following sub-attributes:

- version: the logger server's version

- serverId: the logger server's id

- clients: a list of all replication clients that ever connected to the logger since it was started. This list can be used to determine approximately how much data the individual clients have already fetched from the logger server. Each entry in the list contains a time value indicating the server time the client last fetched data from the replication logger. The lastServedTick value of each client indicates the latest tick value sent to the client upon a client request to the replication logger.

", "summary": "returns the replication logger state", "httpMethod": "GET", "examples": "Returns the state of an inactive replication logger.

unix> curl --dump - http://localhost:8529/_api/replication/logger-state\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"state\" : { \n    \"running\" : false, \n    \"lastLogTick\" : \"397558183\", \n    \"totalEvents\" : 2, \n    \"time\" : \"2014-01-20T21:04:23Z\" \n  }, \n  \"server\" : { \n    \"version\" : \"1.4.6\", \n    \"serverId\" : \"190048212006786\" \n  }, \n  \"clients\" : [ ] \n}\n\n

Returns the state of an active replication logger.

unix> curl --dump - http://localhost:8529/_api/replication/logger-state\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"state\" : { \n    \"running\" : true, \n    \"lastLogTick\" : \"397885863\", \n    \"totalEvents\" : 3, \n    \"time\" : \"2014-01-20T21:04:24Z\" \n  }, \n  \"server\" : { \n    \"version\" : \"1.4.6\", \n    \"serverId\" : \"190048212006786\" \n  }, \n  \"clients\" : [ ] \n}\n\n

", "nickname": "returnsTheReplicationLoggerState" } ], "path": "/_api/replication/logger-state" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the request was executed successfully. ", "code": "200" }, { "reason": "is returned when an invalid HTTP method is used. ", "code": "405" }, { "reason": "is returned if an error occurred while assembling the response. ", "code": "500" } ], "parameters": [], "notes": "Returns the configuration of the replication logger.

The body of the response is a JSON hash with the configuration. The following attributes may be present in the configuration:

- autoStart: whether or not to automatically start the replication logger on server startup

- logRemoteChanges: whether or not externally created changes should be logged by the local logger

- maxEvents: the maximum number of log events kept by the replication logger before deleting oldest events. A value of 0 means that the number of events is not restricted.

- maxEventsSize: the maximum cumulated size of log event data kept by the replication logger before deleting oldest events. A value of 0 means that the cumulated size of events is not restricted.

", "summary": "returns the configuration of the replication logger", "httpMethod": "GET", "examples": "

unix> curl --dump - http://localhost:8529/_api/replication/logger-config\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"autoStart\" : false, \n  \"logRemoteChanges\" : false, \n  \"maxEvents\" : 1048576, \n  \"maxEventsSize\" : 134217728 \n}\n\n

", "nickname": "returnsTheConfigurationOfTheReplicationLogger" } ], "path": "/_api/replication/logger-config" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the request was executed successfully. ", "code": "200" }, { "reason": "is returned if the configuration is incomplete or malformed. ", "code": "400" }, { "reason": "is returned when an invalid HTTP method is used. ", "code": "405" }, { "reason": "is returned if an error occurred while assembling the response. ", "code": "500" } ], "parameters": [ { "dataType": "Json", "paramType": "body", "required": "true", "name": "configuration", "description": "A JSON representation of the configuration. " } ], "notes": "Sets the configuration of the replication logger.

The body of the request must be JSON hash with the configuration. The following attributes are allowed for the configuration:

- autoStart: whether or not to automatically start the replication logger on server startup

- logRemoteChanges: whether or not externally created changes should be logged by the local logger

- maxEvents: the maximum number of log events kept by the replication logger before deleting oldest events. Use a value of 0 to not restrict the number of events.

- maxEventsSize: the maximum cumulated size of log event data kept by the replication logger before deleting oldest events. Use a value of 0 to not restrict the size.

Note that when setting both maxEvents and maxEventsSize, reaching either limitation will trigger a deletion of the \"oldest\" log events from the replication log.

In case of success, the body of the response is a JSON hash with the updated configuration.

", "summary": "adjusts the configuration of the replication logger", "httpMethod": "PUT", "examples": "

unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/replication/logger-config\n{\"logRemoteChanges\":true,\"maxEvents\":1048576}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"autoStart\" : false, \n  \"logRemoteChanges\" : true, \n  \"maxEvents\" : 1048576, \n  \"maxEventsSize\" : 134217728 \n}\n\n



unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/replication/logger-config\n{\"logRemoteChanges\":false,\"maxEvents\":16384,\"maxEventsSize\":16777216}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"autoStart\" : false, \n  \"logRemoteChanges\" : false, \n  \"maxEvents\" : 16384, \n  \"maxEventsSize\" : 16777216 \n}\n\n

", "nickname": "adjustsTheConfigurationOfTheReplicationLogger" } ], "path": "/_api/replication/logger-config" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the batch was created successfully. ", "code": "204" }, { "reason": "is returned if the ttl value is invalid. ", "code": "400" } ], "parameters": [ { "dataType": "Json", "paramType": "body", "required": "true", "name": "body", "description": "A JSON object with the batch configration. " } ], "notes": "Creates a new dump batch and returns the batch's id.

The body of the request must be a JSON hash with the following attributes:

- ttl: the time-to-live for the new batch (in seconds)

The response is a JSON hash with the following attributes:

- id: the id of the batch

", "summary": "creates a new dump batch", "httpMethod": "POST", "examples": "", "nickname": "createsANewDumpBatch" } ], "path": "/_api/replication/batch" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the batch's ttl was extended successfully. ", "code": "204" }, { "reason": "is returned if the ttl value is invalid or the batch was not found. ", "code": "400" } ], "parameters": [ { "dataType": "Json", "paramType": "body", "required": "true", "name": "body", "description": "A JSON object with the batch configration. " }, { "dataType": "String", "paramType": "path", "required": "true", "name": "id", "description": "The id of the batch. " } ], "notes": "Extends the ttl of an existing dump batch, using the batch's id and the provided ttl value.

The body of the request must be a JSON hash with the following attributes:

- ttl: the time-to-live for the batch (in seconds)

If the batch's ttl can be extended successully, the response is empty.

", "summary": "prolongs an existing dump batch", "httpMethod": "PUT", "examples": "", "nickname": "prolongsAnExistingDumpBatch" } ], "path": "/_api/replication/batch/{id}" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the batch was deleted successfully. ", "code": "204" }, { "reason": "is returned if the batch was not found. ", "code": "400" } ], "parameters": [ { "dataType": "String", "paramType": "path", "required": "true", "name": "id", "description": "The id of the batch. " } ], "notes": "Deletes the existing dump batch, allowing compaction and cleanup to resume.

", "summary": "deletes an existing dump batch", "httpMethod": "DELETE", "examples": "", "nickname": "deletesAnExistingDumpBatch" } ], "path": "/_api/replication/batch/{id}" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the request was executed successfully, and there are log events available for the requested range. The response body will not be empty in this case. ", "code": "200" }, { "reason": "is returned if the request was executed successfully, but there are no log events available for the requested range. The response body will be empty in this case. ", "code": "204" }, { "reason": "is returned if either the from or to values are invalid. ", "code": "400" }, { "reason": "is returned when an invalid HTTP method is used. ", "code": "405" }, { "reason": "is returned if an error occurred while assembling the response. ", "code": "500" } ], "parameters": [ { "dataType": "Number", "paramType": "query", "name": "from", "description": "Lower bound tick value for results. " }, { "dataType": "Number", "paramType": "query", "name": "to", "description": "Upper bound tick value for results. " }, { "dataType": "Number", "paramType": "query", "name": "chunkSize", "description": "Approximate maximum size of the returned result. " } ], "notes": "Returns data from the server's replication log. This method can be called by replication clients after an initial synchronisation of data. The method will return all \"recent\" log entries from the logger server, and the clients can replay and apply these entries locally so they get to the same data state as the logger server.

Clients can call this method repeatedly to incrementally fetch all changes from the logger server. In this case, they should provide the from value so they will only get returned the log events since their last fetch.

When the from URL parameter is not used, the logger server will return log entries starting at the beginning of its replication log. When the from parameter is used, the logger server will only return log entries which have higher tick values than the specified from value (note: the log entry with a tick value equal to from will be excluded). Use the from value when incrementally fetching log data.

The to URL parameter can be used to optionally restrict the upper bound of the result to a certain tick value. If used, the result will contain only log events with tick values up to (including) to. In incremental fetching, there is no need to use the to parameter. It only makes sense in special situations, when only parts of the change log are required.

The chunkSize URL parameter can be used to control the size of the result. It must be specified in bytes. The chunkSize value will only be honored approximately. Otherwise a too low chunkSize value could cause the server to not be able to put just one log entry into the result and return it. Therefore, the chunkSize value will only be consulted after a log entry has been written into the result. If the result size is then bigger than chunkSize, the server will respond with as many log entries as there are in the response already. If the result size is still smaller than chunkSize, the server will try to return more data if there's more data left to return.

If chunkSize is not specified, some server-side default value will be used.

The Content-Type of the result is application/x-arango-dump. This is an easy-to-process format, with all log events going onto separate lines in the response body. Each log event itself is a JSON hash, with at least the following attributes:

- tick: the log event tick value

- type: the log event type

Individual log events will also have additional attributes, depending on the event type. A few common attributes which are used for multiple events types are:

- cid: id of the collection the event was for

- tid: id of the transaction the event was contained in

- key: document key

- rev: document revision id

- data: the original document data

A more detailed description of the individual replication event types and their data structures can be found in the manual.

The response will also contain the following HTTP headers:

- x-arango-replication-active: whether or not the logger is active. Clients can use this flag as an indication for their polling frequency. If the logger is not active and there are no more replication events available, it might be sensible for a client to abort, or to go to sleep for a long time and try again later to check whether the logger has been activated.

- x-arango-replication-lastincluded: the tick value of the last included value in the result. In incremental log fetching, this value can be used as the from value for the following request. Note that if the result is empty, the value will be 0. This value should not be used as from value by clients in the next request (otherwise the server would return the log events from the start of the log again).

- x-arango-replication-lasttick: the last tick value the logger server has logged (not necessarily included in the result). By comparing the the last tick and last included tick values, clients have an approximate indication of how many events there are still left to fetch.

- x-arango-replication-checkmore: whether or not there already exists more log data which the client could fetch immediately. If there is more log data available, the client could call logger-follow again with an adjusted from value to fetch remaining log entries until there are no more.

If there isn't any more log data to fetch, the client might decide to go to sleep for a while before calling the logger again.

", "summary": "returns recent log entries from the replication log", "httpMethod": "GET", "examples": "No log events available:

unix> curl --dump - http://localhost:8529/_api/replication/logger-follow?from=398279079\n\nHTTP/1.1 204 No Content\ncontent-type: application/x-arango-dump; charset=utf-8\nx-arango-replication-active: true\nx-arango-replication-checkmore: false\nx-arango-replication-lastincluded: 0\nx-arango-replication-lasttick: 398279079\n\n

A few log events:

unix> curl --dump - http://localhost:8529/_api/replication/logger-follow?from=398672295\n\nHTTP/1.1 200 OK\ncontent-type: application/x-arango-dump; charset=utf-8\nx-arango-replication-active: true\nx-arango-replication-checkmore: false\nx-arango-replication-lastincluded: 401228199\nx-arango-replication-lasttick: 401228199\n\n{\"tick\":\"399458727\",\"type\":2000,\"cid\":\"398737831\",\"cname\":\"products\",\"collection\":{\"version\":4,\"type\":2,\"cid\":\"398737831\",\"deleted\":false,\"doCompact\":true,\"maximalSize\":1048576,\"name\":\"products\",\"isVolatile\":false,\"waitForSync\":false}}\n{\"tick\":\"399983015\",\"type\":2300,\"cid\":\"398737831\",\"cname\":\"products\",\"key\":\"p1\",\"rev\":\"399720871\",\"data\":{\"_key\":\"p1\",\"_rev\":\"399720871\",\"name\":\"flux compensator\"}}\n{\"tick\":\"400441767\",\"type\":2300,\"cid\":\"398737831\",\"cname\":\"products\",\"key\":\"p2\",\"rev\":\"400245159\",\"data\":{\"_key\":\"p2\",\"_rev\":\"400245159\",\"hp\":5100,\"name\":\"hybrid hovercraft\"}}\n{\"tick\":\"400769447\",\"type\":2302,\"cid\":\"398737831\",\"cname\":\"products\",\"key\":\"p1\",\"rev\":\"400572839\",\"oldRev\":\"399720871\"}\n{\"tick\":\"401097127\",\"type\":2300,\"cid\":\"398737831\",\"cname\":\"products\",\"key\":\"p2\",\"rev\":\"400900519\",\"oldRev\":\"400245159\",\"data\":{\"_key\":\"p2\",\"_rev\":\"400900519\",\"hp\":5100,\"name\":\"broken hovercraft\"}}\n{\"tick\":\"401228199\",\"type\":2001,\"cid\":\"398737831\",\"cname\":\"products\"}\n\n\n

More events than would fit into the response:

unix> curl --dump - http://localhost:8529/_api/replication/logger-follow?from=401621415&chunkSize=400\n\nHTTP/1.1 200 OK\ncontent-type: application/x-arango-dump; charset=utf-8\nx-arango-replication-active: true\nx-arango-replication-checkmore: true\nx-arango-replication-lastincluded: 402932135\nx-arango-replication-lasttick: 404177319\n\n{\"tick\":\"402407847\",\"type\":2000,\"cid\":\"401686951\",\"cname\":\"products\",\"collection\":{\"version\":4,\"type\":2,\"cid\":\"401686951\",\"deleted\":false,\"doCompact\":true,\"maximalSize\":1048576,\"name\":\"products\",\"isVolatile\":false,\"waitForSync\":false}}\n{\"tick\":\"402932135\",\"type\":2300,\"cid\":\"401686951\",\"cname\":\"products\",\"key\":\"p1\",\"rev\":\"402669991\",\"data\":{\"_key\":\"p1\",\"_rev\":\"402669991\",\"name\":\"flux compensator\"}}\n\n\n

", "nickname": "returnsRecentLogEntriesFromTheReplicationLog" } ], "path": "/_api/replication/logger-follow" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the request was executed successfully. ", "code": "200" }, { "reason": "is returned when an invalid HTTP method is used. ", "code": "405" }, { "reason": "is returned if an error occurred while assembling the response. ", "code": "500" } ], "parameters": [ { "dataType": "Boolean", "paramType": "query", "name": "includeSystem", "description": "Include system collections in the result. The default value is false. " } ], "notes": "Returns the list of collections and indexes available on the server. This list can be used by replication clients to initiate an initial sync with the server.

The response will contain a JSON hash array with the collection and state attributes.

collections is a list of collections with the following sub-attributes:

- parameters: the collection properties

- indexes: a list of the indexes of a the collection. Primary indexes and edges indexes are not included in this list.

tick: the system-wide tick value at the start of the dump

The state attribute contains the current state of the replication logger. It contains the following sub-attributes:

- running: whether or not the replication logger is currently active

- lastLogTick: the value of the last tick the replication logger has written

- time: the current time on the server

Replication clients should note the lastLogTick value returned. They can then fetch collections' data using the dump method up to the value of lastLogTick, and query the continuous replication log for log events after this tick value.

To create a full copy of the collections on the logger server, a replication client can execute these steps:

- call the /inventory API method. This returns the lastLogTick value and the list of collections and indexes from the logger server.

- for each collection returned by /inventory, create the collection locally and call /dump to stream the collection data to the client, up to the value of lastLogTick. After that, the client can create the indexes on the collections as they were reported by /inventory.

If the clients wants to continuously stream replication log events from the logger server, the following additional steps need to be carried out:

- the client should call /logger-follow initially to fetch the first batch of replication events that were logged after the client's call to /inventory.

The call to /logger-follow should use a from parameter with the value of the lastLogTick as reported by /inventory. The call to /logger-follow will return the x-arango-replication-lastincluded which will contain the last tick value included in the response.

- the client can then continuously call /logger-follow to incrementally fetch new replication events that occurred after the last transfer.

Calls should use a from parameter with the value of the x-arango-replication-lastincluded header of the previous response. If there are no more replication events, the response will be empty and clients can go to sleep for a while and try again later.

", "summary": "returns an inventory of collections and indexes", "httpMethod": "GET", "examples": "

unix> curl --dump - http://localhost:8529/_api/replication/inventory\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"collections\" : [ \n    { \n      \"parameters\" : { \n        \"version\" : 4, \n        \"type\" : 2, \n        \"cid\" : \"16269735\", \n        \"deleted\" : false, \n        \"doCompact\" : true, \n        \"maximalSize\" : 1048576, \n        \"name\" : \"animals\", \n        \"isVolatile\" : false, \n        \"waitForSync\" : false \n      }, \n      \"indexes\" : [ ] \n    }, \n    { \n      \"parameters\" : { \n        \"version\" : 4, \n        \"type\" : 2, \n        \"cid\" : \"14827943\", \n        \"deleted\" : false, \n        \"doCompact\" : true, \n        \"maximalSize\" : 1048576, \n        \"name\" : \"demo\", \n        \"isVolatile\" : false, \n        \"waitForSync\" : false \n      }, \n      \"indexes\" : [ ] \n    }, \n    { \n      \"parameters\" : { \n        \"version\" : 4, \n        \"type\" : 2, \n        \"cid\" : \"132465063\", \n        \"deleted\" : false, \n        \"doCompact\" : true, \n        \"maximalSize\" : 1048576, \n        \"name\" : \"vertices1\", \n        \"isVolatile\" : false, \n        \"waitForSync\" : false \n      }, \n      \"indexes\" : [ ] \n    }, \n    { \n      \"parameters\" : { \n        \"version\" : 4, \n        \"type\" : 3, \n        \"cid\" : \"135217575\", \n        \"deleted\" : false, \n        \"doCompact\" : true, \n        \"maximalSize\" : 1048576, \n        \"name\" : \"edges2\", \n        \"isVolatile\" : false, \n        \"waitForSync\" : false \n      }, \n      \"indexes\" : [ ] \n    } \n  ], \n  \"state\" : { \n    \"running\" : false, \n    \"lastLogTick\" : \"404242855\", \n    \"totalEvents\" : 22, \n    \"time\" : \"2014-01-20T21:04:25Z\" \n  }, \n  \"tick\" : \"404308391\" \n}\n\n

With some additional indexes:

unix> curl --dump - http://localhost:8529/_api/replication/inventory\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"collections\" : [ \n    { \n      \"parameters\" : { \n        \"version\" : 4, \n        \"type\" : 2, \n        \"cid\" : \"16269735\", \n        \"deleted\" : false, \n        \"doCompact\" : true, \n        \"maximalSize\" : 1048576, \n        \"name\" : \"animals\", \n        \"isVolatile\" : false, \n        \"waitForSync\" : false \n      }, \n      \"indexes\" : [ ] \n    }, \n    { \n      \"parameters\" : { \n        \"version\" : 4, \n        \"type\" : 2, \n        \"cid\" : \"14827943\", \n        \"deleted\" : false, \n        \"doCompact\" : true, \n        \"maximalSize\" : 1048576, \n        \"name\" : \"demo\", \n        \"isVolatile\" : false, \n        \"waitForSync\" : false \n      }, \n      \"indexes\" : [ ] \n    }, \n    { \n      \"parameters\" : { \n        \"version\" : 4, \n        \"type\" : 2, \n        \"cid\" : \"404373927\", \n        \"deleted\" : false, \n        \"doCompact\" : true, \n        \"maximalSize\" : 1048576, \n        \"name\" : \"IndexedCollection1\", \n        \"isVolatile\" : false, \n        \"waitForSync\" : false \n      }, \n      \"indexes\" : [ \n        { \n          \"id\" : \"405160359\", \n          \"type\" : \"hash\", \n          \"unique\" : false, \n          \"fields\" : [ \n            \"name\" \n          ] \n        }, \n        { \n          \"id\" : \"405422503\", \n          \"type\" : \"skiplist\", \n          \"unique\" : true, \n          \"fields\" : [ \n            \"a\", \n            \"b\" \n          ] \n        }, \n        { \n          \"id\" : \"405488039\", \n          \"type\" : \"cap\", \n          \"unique\" : false, \n          \"size\" : 500, \n          \"byteSize\" : 0 \n        } \n      ] \n    }, \n    { \n      \"parameters\" : { \n        \"version\" : 4, \n        \"type\" : 2, \n        \"cid\" : \"405553575\", \n        \"deleted\" : false, \n        \"doCompact\" : true, \n        \"maximalSize\" : 1048576, \n        \"name\" : \"IndexedCollection2\", \n        \"isVolatile\" : false, \n        \"waitForSync\" : false \n      }, \n      \"indexes\" : [ \n        { \n          \"id\" : \"406340007\", \n          \"type\" : \"fulltext\", \n          \"unique\" : false, \n          \"minLength\" : 10, \n          \"fields\" : [ \n            \"text\" \n          ] \n        }, \n        { \n          \"id\" : \"406536615\", \n          \"type\" : \"skiplist\", \n          \"unique\" : false, \n          \"fields\" : [ \n            \"a\" \n          ] \n        }, \n        { \n          \"id\" : \"406602151\", \n          \"type\" : \"cap\", \n          \"unique\" : false, \n          \"size\" : 0, \n          \"byteSize\" : 1048576 \n        } \n      ] \n    }, \n    { \n      \"parameters\" : { \n        \"version\" : 4, \n        \"type\" : 2, \n        \"cid\" : \"132465063\", \n        \"deleted\" : false, \n        \"doCompact\" : true, \n        \"maximalSize\" : 1048576, \n        \"name\" : \"vertices1\", \n        \"isVolatile\" : false, \n        \"waitForSync\" : false \n      }, \n      \"indexes\" : [ ] \n    }, \n    { \n      \"parameters\" : { \n        \"version\" : 4, \n        \"type\" : 3, \n        \"cid\" : \"135217575\", \n        \"deleted\" : false, \n        \"doCompact\" : true, \n        \"maximalSize\" : 1048576, \n        \"name\" : \"edges2\", \n        \"isVolatile\" : false, \n        \"waitForSync\" : false \n      }, \n      \"indexes\" : [ ] \n    } \n  ], \n  \"state\" : { \n    \"running\" : false, \n    \"lastLogTick\" : \"404242855\", \n    \"totalEvents\" : 22, \n    \"time\" : \"2014-01-20T21:04:25Z\" \n  }, \n  \"tick\" : \"406602151\" \n}\n\n

", "nickname": "returnsAnInventoryOfCollectionsAndIndexes" } ], "path": "/_api/replication/inventory" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the request was executed successfully. ", "code": "200" }, { "reason": "is returned if either the from or to values are invalid. ", "code": "400" }, { "reason": "is returned when the collection could not be found. ", "code": "404" }, { "reason": "is returned when an invalid HTTP method is used. ", "code": "405" }, { "reason": "is returned if an error occurred while assembling the response. ", "code": "500" } ], "parameters": [ { "dataType": "String", "paramType": "query", "required": "True", "name": "collection", "description": "The name or id of the collection to dump. " }, { "dataType": "Number", "paramType": "query", "name": "from", "description": "Lower bound tick value for results. " }, { "dataType": "Number", "paramType": "query", "name": "to", "description": "Upper bound tick value for results. " }, { "dataType": "Number", "paramType": "query", "name": "chunkSize", "description": "Approximate maximum size of the returned result. " }, { "dataType": "Boolean", "paramType": "query", "name": "ticks", "description": "Whether or not to include tick values in the dump. Default value is true. " } ], "notes": "Returns the data from the collection for the requested range.

When the from URL parameter is not used, collection events are returned from the beginning. When the from parameter is used, the result will only contain collection entries which have higher tick values than the specified from value (note: the log entry with a tick value equal to from will be excluded).

The to URL parameter can be used to optionally restrict the upper bound of the result to a certain tick value. If used, the result will only contain collection entries with tick values up to (including) to.

The chunkSize URL parameter can be used to control the size of the result. It must be specified in bytes. The chunkSize value will only be honored approximately. Otherwise a too low chunkSize value could cause the server to not be able to put just one entry into the result and return it. Therefore, the chunkSize value will only be consulted after an entry has been written into the result. If the result size is then bigger than chunkSize, the server will respond with as many entries as there are in the response already. If the result size is still smaller than chunkSize, the server will try to return more data if there's more data left to return.

If chunkSize is not specified, some server-side default value will be used.

The Content-Type of the result is application/x-arango-dump. This is an easy-to-process format, with all entries going onto separate lines in the response body.

Each line itself is a JSON hash, with at least the following attributes:

- type: the type of entry. Possible values for type are:

- 2300: document insertion/update

- 2301: edge insertion/update

- 2302: document/edge deletion

- key: the key of the document/edge or the key used in the deletion operation

- rev: the revision id of the document/edge or the deletion operation

- data: the actual document/edge data for types 2300 and 2301. The full document/edge data will be returned even for updates.

A more detailed description of the different entry types and their data structures can be found in the manual.

Note: there will be no distinction between inserts and updates when calling this method.

", "summary": "returns the data of a collection", "httpMethod": "GET", "examples": "Empty collection:

unix> curl --dump - http://localhost:8529/_api/replication/dump?collection=testCollection\n\nHTTP/1.1 204 No Content\ncontent-type: application/x-arango-dump; charset=utf-8\nx-arango-replication-checkmore: false\nx-arango-replication-lastincluded: 0\n\n

Non-empty collection:

unix> curl --dump - http://localhost:8529/_api/replication/dump?collection=testCollection\n\nHTTP/1.1 200 OK\ncontent-type: application/x-arango-dump; charset=utf-8\nx-arango-replication-checkmore: false\nx-arango-replication-lastincluded: 409747879\n\n{\"tick\":\"408371623\",\"type\":2300,\"key\":\"abcdef\",\"rev\":\"408240551\",\"data\":{\"_key\":\"abcdef\",\"_rev\":\"408240551\",\"test\":true,\"a\":\"abc\"}}\n{\"tick\":\"408764839\",\"type\":2300,\"key\":\"123456\",\"rev\":\"408699303\",\"data\":{\"_key\":\"123456\",\"_rev\":\"408699303\",\"c\":false,\"b\":1}}\n{\"tick\":\"409092519\",\"type\":2300,\"key\":\"123456\",\"rev\":\"409026983\",\"data\":{\"_key\":\"123456\",\"_rev\":\"409026983\",\"c\":false,\"b\":1,\"d\":\"additional value\"}}\n{\"tick\":\"409354663\",\"type\":2300,\"key\":\"foobar\",\"rev\":\"409289127\",\"data\":{\"_key\":\"foobar\",\"_rev\":\"409289127\"}}\n{\"tick\":\"409551271\",\"type\":2302,\"key\":\"foobar\",\"rev\":\"409485735\"}\n{\"tick\":\"409747879\",\"type\":2302,\"key\":\"abcdef\",\"rev\":\"409682343\"}\n\n\n

", "nickname": "returnsTheDataOfACollection" } ], "path": "/_api/replication/dump" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the request was executed successfully. ", "code": "200" }, { "reason": "is returned if the configuration is incomplete or malformed. ", "code": "400" }, { "reason": "is returned when an invalid HTTP method is used. ", "code": "405" } ], "parameters": [ { "dataType": "Json", "paramType": "body", "required": "true", "name": "configuration", "description": "A JSON representation of the configuration. " } ], "notes": "Starts a full data synchronisation from a remote endpoint into the local ArangoDB database.

The body of the request must be JSON hash with the configuration. The following attributes are allowed for the configuration:

- endpoint: the endpoint to connect to (e.g. \"tcp://192.168.173.13:8529\").

- database: the database name on the master (if not specified, defaults to the name of the local current database).

- username: an optional ArangoDB username to use when connecting to the endpoint.

- password: the password to use when connecting to the endpoint.

- restrictType: an optional string value for collection filtering. When specified, the allowed values are include or exclude.

- restrictCollections: an optional list of collections for use with restrictType. If restrictType is include, only the specified collections will be sychronised. If restrictType is exclude, all but the specified collections will be synchronised.

In case of success, the body of the response is a JSON hash with the following attributes:

- collections: a list of collections that were transferred from the endpoint

- lastLogTick: the last log tick on the endpoint at the time the transfer was started. Use this value as the from value when starting the continuous synchronisation later.

WARNING: calling this method will sychronise data from the collections found on the remote endpoint to the local ArangoDB database. All data in the local collections will be purged and replaced with data from the endpoint.

Use with caution!

", "summary": "synchronises data from a remote endpoint", "httpMethod": "PUT", "examples": "", "nickname": "synchronisesDataFromARemoteEndpoint" } ], "path": "/_api/replication/sync" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the request was executed successfully. ", "code": "200" }, { "reason": "is returned when an invalid HTTP method is used. ", "code": "405" }, { "reason": "is returned if an error occurred while assembling the response. ", "code": "500" } ], "parameters": [], "notes": "Returns the servers id. The id is also returned by other replication API methods, and this method is an easy means of determining a server's id.

The body of the response is a JSON hash with the attribute serverId. The server id is returned as a string.

", "summary": "returns the servers id", "httpMethod": "GET", "examples": "

unix> curl --dump - http://localhost:8529/_api/replication/server-id\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"serverId\" : \"190048212006786\" \n}\n\n

", "nickname": "returnsTheServersId" } ], "path": "/_api/replication/server-id" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the request was executed successfully. ", "code": "200" }, { "reason": "is returned when an invalid HTTP method is used. ", "code": "405" }, { "reason": "is returned if an error occurred while assembling the response. ", "code": "500" } ], "parameters": [], "notes": "Returns the configuration of the replication applier.

The body of the response is a JSON hash with the configuration. The following attributes may be present in the configuration:

- endpoint: the logger server to connect to (e.g. \"tcp://192.168.173.13:8529\").

- database: the name of the database to connect to (e.g. \"_system\").

- username: an optional ArangoDB username to use when connecting to the endpoint.

- password: the password to use when connecting to the endpoint.

- maxConnectRetries: the maximum number of connection attempts the applier will make in a row. If the applier cannot establish a connection to the endpoint in this number of attempts, it will stop itself.

- connectTimeout: the timeout (in seconds) when attempting to connect to the endpoint. This value is used for each connection attempt.

- requestTimeout: the timeout (in seconds) for individual requests to the endpoint.

- chunkSize: the requested maximum size for log transfer packets that is used when the endpoint is contacted.

- autoStart: whether or not to auto-start the replication applier on (next and following) server starts

- adaptivePolling: whether or not the replication applier will use adaptive polling.

", "summary": "returns the configuration of the replication applier", "httpMethod": "GET", "examples": "

unix> curl --dump - http://localhost:8529/_api/replication/applier-config\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"requestTimeout\" : 300, \n  \"connectTimeout\" : 10, \n  \"maxConnectRetries\" : 100, \n  \"sslProtocol\" : 0, \n  \"chunkSize\" : 0, \n  \"autoStart\" : false, \n  \"adaptivePolling\" : true \n}\n\n

", "nickname": "returnsTheConfigurationOfTheReplicationApplier" } ], "path": "/_api/replication/applier-config" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the request was executed successfully. ", "code": "200" }, { "reason": "is returned if the configuration is incomplete or malformed, or if the replication applier is currently running. ", "code": "400" }, { "reason": "is returned when an invalid HTTP method is used. ", "code": "405" }, { "reason": "is returned if an error occurred while assembling the response. ", "code": "500" } ], "parameters": [ { "dataType": "Json", "paramType": "body", "required": "true", "name": "configuration", "description": "A JSON representation of the configuration. " } ], "notes": "Sets the configuration of the replication applier. The configuration can only be changed while the applier is not running. The updated configuration will be saved immediately but only become active with the next start of the applier.

The body of the request must be JSON hash with the configuration. The following attributes are allowed for the configuration:

- endpoint: the logger server to connect to (e.g. \"tcp://192.168.173.13:8529\"). The endpoint must be specified.

- database: the name of the database on the endpoint. If not specified, defaults to the current local database name.

- username: an optional ArangoDB username to use when connecting to the endpoint.

- password: the password to use when connecting to the endpoint.

- maxConnectRetries: the maximum number of connection attempts the applier will make in a row. If the applier cannot establish a connection to the endpoint in this number of attempts, it will stop itself.

- connectTimeout: the timeout (in seconds) when attempting to connect to the endpoint. This value is used for each connection attempt.

- requestTimeout: the timeout (in seconds) for individual requests to the endpoint.

- chunkSize: the requested maximum size for log transfer packets that is used when the endpoint is contacted.

- autoStart: whether or not to auto-start the replication applier on (next and following) server starts

- adaptivePolling: if set to true, the replication applier will fall to sleep for an increasingly long period in case the logger server at the endpoint does not have any more replication events to apply. Using adaptive polling is thus useful to reduce the amount of work for both the applier and the logger server for cases when there are only infrequent changes. The downside is that when using adaptive polling, it might take longer for the replication applier to detect that there are new replication events on the logger server.

Setting adaptivePolling to false will make the replication applier contact the logger server in a constant interval, regardless of whether the logger server provides updates frequently or seldomly.

In case of success, the body of the response is a JSON hash with the updated configuration.

", "summary": "adjusts the configuration of the replication applier", "httpMethod": "PUT", "examples": "

unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/replication/applier-config\n{\"endpoint\":\"tcp://127.0.0.1:8529\",\"username\":\"replicationApplier\",\"password\":\"applier1234@foxx\",\"chunkSize\":4194304,\"autoStart\":false,\"adaptivePolling\":true}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"endpoint\" : \"tcp://127.0.0.1:8529\", \n  \"database\" : \"_system\", \n  \"username\" : \"replicationApplier\", \n  \"requestTimeout\" : 300, \n  \"connectTimeout\" : 10, \n  \"maxConnectRetries\" : 100, \n  \"sslProtocol\" : 0, \n  \"chunkSize\" : 4194304, \n  \"autoStart\" : false, \n  \"adaptivePolling\" : true \n}\n\n

", "nickname": "adjustsTheConfigurationOfTheReplicationApplier" } ], "path": "/_api/replication/applier-config" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the request was executed successfully. ", "code": "200" }, { "reason": "is returned if the replication applier is not fully configured or the configuration is invalid. ", "code": "400" }, { "reason": "is returned when an invalid HTTP method is used. ", "code": "405" }, { "reason": "is returned if an error occurred while assembling the response. ", "code": "500" } ], "parameters": [ { "dataType": "String", "paramType": "query", "name": "from", "description": "The remote lastLogTick value from which to start applying. If not specified, the last saved tick from the previous applier run is used. If there is no previous applier state saved, the applier will start at the beginning of the logger server's log. " } ], "notes": "Starts the replication applier. This will return immediately if the replication applier is already running.

If the replication applier is not already running, the applier configuration will be checked, and if it is complete, the applier will be started in a background thread. This means that even if the applier will encounter any errors while running, they will not be reported in the response to this method.

To detect replication applier errors after the applier was started, use the /_api/replication/applier-state API instead.

", "summary": "starts the replication applier", "httpMethod": "PUT", "examples": "

unix> curl -X PUT --dump - http://localhost:8529/_api/replication/applier-start\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"state\" : { \n    \"running\" : true, \n    \"lastAppliedContinuousTick\" : null, \n    \"lastProcessedContinuousTick\" : null, \n    \"lastAvailableContinuousTick\" : null, \n    \"progress\" : { \n      \"time\" : \"2014-01-20T21:03:04Z\", \n      \"message\" : \"applier created\", \n      \"failedConnects\" : 0 \n    }, \n    \"totalRequests\" : 0, \n    \"totalFailedConnects\" : 0, \n    \"totalEvents\" : 0, \n    \"lastError\" : { \n      \"errorNum\" : 0 \n    }, \n    \"time\" : \"2014-01-20T21:04:27Z\" \n  }, \n  \"server\" : { \n    \"version\" : \"1.4.6\", \n    \"serverId\" : \"190048212006786\" \n  }, \n  \"endpoint\" : \"tcp://127.0.0.1:8529\", \n  \"database\" : \"_system\" \n}\n\n

", "nickname": "startsTheReplicationApplier" } ], "path": "/_api/replication/applier-start" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the request was executed successfully. ", "code": "200" }, { "reason": "is returned when an invalid HTTP method is used. ", "code": "405" }, { "reason": "is returned if an error occurred while assembling the response. ", "code": "500" } ], "parameters": [], "notes": "Stops the replication applier. This will return immediately if the replication applier is not running.

", "summary": "stops the replication applier", "httpMethod": "PUT", "examples": "

unix> curl -X PUT --dump - http://localhost:8529/_api/replication/applier-stop\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"state\" : { \n    \"running\" : false, \n    \"lastAppliedContinuousTick\" : null, \n    \"lastProcessedContinuousTick\" : null, \n    \"lastAvailableContinuousTick\" : null, \n    \"progress\" : { \n      \"time\" : \"2014-01-20T21:04:27Z\", \n      \"message\" : \"applier stopped\", \n      \"failedConnects\" : 0 \n    }, \n    \"totalRequests\" : 0, \n    \"totalFailedConnects\" : 0, \n    \"totalEvents\" : 0, \n    \"lastError\" : { \n      \"time\" : \"2014-01-20T21:04:27Z\", \n      \"errorMessage\" : \"got same server id (190048212006786) from endpoint 'tcp://127.0.0.1:8529' as the...\", \n      \"errorNum\" : 1405 \n    }, \n    \"time\" : \"2014-01-20T21:04:27Z\" \n  }, \n  \"server\" : { \n    \"version\" : \"1.4.6\", \n    \"serverId\" : \"190048212006786\" \n  }, \n  \"endpoint\" : \"tcp://127.0.0.1:8529\", \n  \"database\" : \"_system\" \n}\n\n

", "nickname": "stopsTheReplicationApplier" } ], "path": "/_api/replication/applier-stop" }, { "operations": [ { "errorResponses": [ { "reason": "is returned if the request was executed successfully. ", "code": "200" }, { "reason": "is returned when an invalid HTTP method is used. ", "code": "405" }, { "reason": "is returned if an error occurred while assembling the response. ", "code": "500" } ], "parameters": [], "notes": "Returns the state of the replication applier, regardless of whether the applier is currently running or not.

The response is a JSON hash with the following attributes:

- state: a JSON hash with the following sub-attributes:

- running: whether or not the applier is active and running

- lastAppliedContinuousTick: the last tick value from the continuous replication log the applier has applied.

- lastProcessedContinuousTick: the last tick value from the continuous replication log the applier has processed.

Regularly, the last applied and last processed tick values should be identical. For transactional operations, the replication applier will first process incoming log events before applying them, so the processed tick value might be higher than the applied tick value. This will be the case until the applier encounters the transaction commit log event for the transaction.

- lastAvailableContinuousTick: the last tick value the logger server can provide.

- time: the time on the applier server.

- totalRequests: the total number of requests the applier has made to the endpoint.

- totalFailedConnects: the total number of failed connection attempts the applier has made.

- totalEvents: the total number of log events the applier has processed.

- progress: a JSON hash with details about the replication applier progress. It contains the following sub-attributes if there is progress to report:

- message: a textual description of the progress

- time: the date and time the progress was logged

- failedConnects: the current number of failed connection attempts

- lastError: a JSON hash with details about the last error that happened on the applier. It contains the following sub-attributes if there was an error:

- errorNum: a numerical error code

- errorMessage: a textual error description

- time: the date and time the error occurred

In case no error has occurred, lastError will be empty.

- server: a JSON hash with the following sub-attributes:

- version: the applier server's version

- serverId: the applier server's id

- endpoint: the endpoint the applier is connected to (if applier is active) or will connect to (if applier is currently inactive)

- database: the name of the database the applier is connected to (if applier is active) or will connect to (if applier is currently inactive)

", "summary": "returns the state of the replication applier", "httpMethod": "GET", "examples": "Fetching the state of an inactive applier:

unix> curl --dump - http://localhost:8529/_api/replication/applier-state\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"state\" : { \n    \"running\" : false, \n    \"lastAppliedContinuousTick\" : null, \n    \"lastProcessedContinuousTick\" : null, \n    \"lastAvailableContinuousTick\" : null, \n    \"progress\" : { \n      \"time\" : \"2014-01-20T21:04:27Z\", \n      \"message\" : \"applier stopped\", \n      \"failedConnects\" : 0 \n    }, \n    \"totalRequests\" : 0, \n    \"totalFailedConnects\" : 0, \n    \"totalEvents\" : 0, \n    \"lastError\" : { \n      \"time\" : \"2014-01-20T21:04:27Z\", \n      \"errorMessage\" : \"got same server id (190048212006786) from endpoint 'tcp://127.0.0.1:8529' as the...\", \n      \"errorNum\" : 1405 \n    }, \n    \"time\" : \"2014-01-20T21:04:27Z\" \n  }, \n  \"server\" : { \n    \"version\" : \"1.4.6\", \n    \"serverId\" : \"190048212006786\" \n  }, \n  \"endpoint\" : \"tcp://127.0.0.1:8529\", \n  \"database\" : \"_system\" \n}\n\n

Fetching the state of an active applier:

unix> curl --dump - http://localhost:8529/_api/replication/applier-state\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"state\" : { \n    \"running\" : false, \n    \"lastAppliedContinuousTick\" : null, \n    \"lastProcessedContinuousTick\" : null, \n    \"lastAvailableContinuousTick\" : null, \n    \"progress\" : { \n      \"time\" : \"2014-01-20T21:04:27Z\", \n      \"message\" : \"applier stopped\", \n      \"failedConnects\" : 0 \n    }, \n    \"totalRequests\" : 0, \n    \"totalFailedConnects\" : 0, \n    \"totalEvents\" : 0, \n    \"lastError\" : { \n      \"time\" : \"2014-01-20T21:04:27Z\", \n      \"errorMessage\" : \"got same server id (190048212006786) from endpoint 'tcp://127.0.0.1:8529' as the...\", \n      \"errorNum\" : 1405 \n    }, \n    \"time\" : \"2014-01-20T21:04:27Z\" \n  }, \n  \"server\" : { \n    \"version\" : \"1.4.6\", \n    \"serverId\" : \"190048212006786\" \n  }, \n  \"endpoint\" : \"tcp://127.0.0.1:8529\", \n  \"database\" : \"_system\" \n}\n\n

", "nickname": "returnsTheStateOfTheReplicationApplier" } ], "path": "/_api/replication/applier-state" } ] }