{ "basePath": "/", "swaggerVersion": "1.1", "apiVersion": "0.1", "apis": [ { "operations": [ { "errorResponses": [], "parameters": [ { "dataType": "String", "paramType": "path", "required": false, "name": "id", "description": "The id of the task to fetch.

" } ], "notes": "fetches all existing tasks on the server; optionally just the one specified by id

", "summary": " Fetch all tasks or one task with id", "httpMethod": "GET", "examples": "

Getting all tasks:

shell> curl --dump - http://localhost:8529/_api/tasks\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n[ \n  { \n    \"id\" : \"21570613\", \n    \"name\" : \"user-defined task\", \n    \"type\" : \"periodic\", \n    \"period\" : 1, \n    \"created\" : 1430810903.549796, \n    \"command\" : \"(function () {\\n      require('org/arangodb/foxx/queues/manager').manage();\\n    })(params)\", \n    \"database\" : \"_system\" \n  }, \n  { \n    \"id\" : \"statistics-collector\", \n    \"name\" : \"statistics-collector\", \n    \"type\" : \"periodic\", \n    \"period\" : 10, \n    \"created\" : 1430810902.616952, \n    \"command\" : \"require('org/arangodb/statistics').historian();\", \n    \"database\" : \"_system\" \n  }, \n  { \n    \"id\" : \"statistics-average-collector\", \n    \"name\" : \"statistics-average-collector\", \n    \"type\" : \"periodic\", \n    \"period\" : 900, \n    \"created\" : 1430810902.617003, \n    \"command\" : \"require('org/arangodb/statistics').historianAverage();\", \n    \"database\" : \"_system\" \n  }, \n  { \n    \"id\" : \"statistics-gc\", \n    \"name\" : \"statistics-gc\", \n    \"type\" : \"periodic\", \n    \"period\" : 450, \n    \"created\" : 1430810902.617325, \n    \"command\" : \"require('org/arangodb/statistics').garbageCollector();\", \n    \"database\" : \"_system\" \n  } \n]\n



Getting a single task by id:

shell> curl --dump - http://localhost:8529/_api/tasks/statistics-average-collector\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"id\" : \"statistics-average-collector\", \n  \"name\" : \"statistics-average-collector\", \n  \"type\" : \"periodic\", \n  \"period\" : 900, \n  \"created\" : 1430810902.617003, \n  \"command\" : \"require('org/arangodb/statistics').historianAverage();\", \n  \"database\" : \"_system\", \n  \"error\" : false, \n  \"code\" : 200 \n}\n



Fetching a non-existing task:

shell> curl --dump - http://localhost:8529/_api/tasks/non-existing-task\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"error\" : true, \n  \"code\" : 404, \n  \"errorNum\" : 1852, \n  \"errorMessage\" : \"task not found\" \n}\n



", "nickname": "FetchAllTasksOrOneTaskWithId" } ], "path": "/_api/tasks/{id}" }, { "operations": [ { "errorResponses": [ { "reason": "If the post body is not accurate, a HTTP 400 is returned.

", "code": "400" } ], "parameters": [ { "dataType": "Json", "paramType": "body", "required": true, "name": "body", "description": "A JSON object describing the new task: