mirror of https://gitee.com/bigwinds/arangodb
117 lines
10 KiB
JSON
117 lines
10 KiB
JSON
{
|
|
"basePath": "/",
|
|
"swaggerVersion": "1.1",
|
|
"apiVersion": "0.1",
|
|
"apis": [
|
|
{
|
|
"operations": [
|
|
{
|
|
"errorResponses": [
|
|
{
|
|
"reason": "is returned if no <em>job-id</em> was specified in the request. In this case, no <em>x-arango-async-id</em> HTTP header will be returned. ",
|
|
"code": "400"
|
|
},
|
|
{
|
|
"reason": "is returned if the job was not found or already deleted or fetched from the job result list. In this case, no <em>x-arango-async-id</em> HTTP header will be returned. ",
|
|
"code": "404"
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "path",
|
|
"required": "true",
|
|
"name": "job-id",
|
|
"description": "The async job id. "
|
|
}
|
|
],
|
|
"notes": "Returns the result of an async job identified by <em>job-id</em>. If the async job result is present on the server, the result will be removed from the list of result. That means this method can be called for each <em>job-id</em> once. <br><br>The method will return the original job result's headers and body, plus the additional HTTP header <em>x-arango-async-job-id</em>. If this header is present, then the job was found and the response contains the original job's result. If the header is not present, the job was not found and the response contains status information from the job amanger. <br><br>",
|
|
"summary": "Returns the result of an async job",
|
|
"httpMethod": "PUT",
|
|
"examples": "Not providing a job-id: <br><br><pre><code class=\"json\" >unix> curl -X PUT --dump - http://localhost:8529/_api/job/\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{\"error\":true,\"errorMessage\":\"bad parameter\",\"code\":400,\"errorNum\":400}\n\n</code></pre><br>Providing a job-id for a non-existing job: <br><br><pre><code class=\"json\" >unix> curl -X PUT --dump - http://localhost:8529/_api/job/foobar\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{\"error\":true,\"errorMessage\":\"not found\",\"code\":404,\"errorNum\":404}\n\n</code></pre><br>Fetching the result of an HTTP GET job: <br><br><pre><code class=\"json\" >unix> curl --header 'x-arango-async: store' --dump - http://localhost:8529/_api/version\n\nHTTP/1.1 202 Accepted\ncontent-type: text/plain; charset=utf-8\nx-arango-async-id: 374817191\n\nunix> curl -X PUT --dump - http://localhost:8529/_api/job/374817191\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nx-arango-async-id: 374817191\n\n{\"server\":\"arango\",\"version\":\"1.4.0-alpha2\"}\n\n</code></pre><br>Fetching the result of an HTTP POST job that failed: <br><br><pre><code class=\"json\" >unix> curl -X POST --header 'x-arango-async: store' --data @- --dump - http://localhost:8529/_api/collection\n{\"name\":\" this name is invalid \"}\n\nHTTP/1.1 202 Accepted\ncontent-type: text/plain; charset=utf-8\nx-arango-async-id: 374882727\n\nunix> curl -X PUT --dump - http://localhost:8529/_api/job/374882727\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\nx-arango-async-id: 374882727\n\n{\"error\":true,\"code\":400,\"errorNum\":1208,\"errorMessage\":\"cannot create collection: illegal name\"}\n\n</code></pre><br>",
|
|
"nickname": "ReturnsTheResultOfAnAsyncJob"
|
|
}
|
|
],
|
|
"path": "/_api/job/{job-id}"
|
|
},
|
|
{
|
|
"operations": [
|
|
{
|
|
"errorResponses": [
|
|
{
|
|
"reason": "is returned if the list can be compiled successfully. Note: the list might be empty. ",
|
|
"code": "200"
|
|
},
|
|
{
|
|
"reason": "is returned if <em>type</em> is not specified or has an invalid value. ",
|
|
"code": "400"
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "path",
|
|
"required": "true",
|
|
"name": "type",
|
|
"description": "The type of jobs to return. The type can be either <em>done</em> or <em>pending</em>. Setting the type to <em>done</em> will make the method return the ids of already completed async jobs for which results can be fetched. Setting the type to <em>pending</em> will return the ids of not yet finished async jobs. "
|
|
},
|
|
{
|
|
"dataType": "Number",
|
|
"paramType": "query",
|
|
"name": "count",
|
|
"description": "The maximum number of ids to return per call. If not specified, a server-defined maximum value will be used. "
|
|
}
|
|
],
|
|
"notes": "Returns the list of ids of async jobs with a specific status (either done or pending). The list can be used by the client to get an overview of the job system status and to retrieve completed job results later. <br><br>",
|
|
"summary": "Returns the list of job result ids with a specific status",
|
|
"httpMethod": "GET",
|
|
"examples": "Fetching the list of done jobs: <br><br><pre><code class=\"json\" >unix> curl --header 'x-arango-async: store' --dump - http://localhost:8529/_api/version\n\nHTTP/1.1 202 Accepted\ncontent-type: text/plain; charset=utf-8\nx-arango-async-id: 374948263\n\nunix> curl --dump - http://localhost:8529/_api/job/done\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n[ \n \"374948263\" \n]\n\n</code></pre><br>Fetching the list of pending jobs: <br><br><pre><code class=\"json\" >unix> curl --header 'x-arango-async: store' --dump - http://localhost:8529/_api/version\n\nHTTP/1.1 202 Accepted\ncontent-type: text/plain; charset=utf-8\nx-arango-async-id: 375013799\n\nunix> curl --dump - http://localhost:8529/_api/job/pending\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n[ ]\n\n</code></pre><br>",
|
|
"nickname": "ReturnsTheListOfJobResultIdsWithASpecificStatus"
|
|
}
|
|
],
|
|
"path": "/_api/job/{type}"
|
|
},
|
|
{
|
|
"operations": [
|
|
{
|
|
"errorResponses": [
|
|
{
|
|
"reason": "is returned if the deletion operation was carried out successfully. This code will also be returned if no results were deleted. ",
|
|
"code": "200"
|
|
},
|
|
{
|
|
"reason": "is returned if <em>type</em> is not specified or has an invalid value. ",
|
|
"code": "400"
|
|
},
|
|
{
|
|
"reason": "is returned if <em>type</em> is a job-id but no async job with the specified id was found. ",
|
|
"code": "404"
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "path",
|
|
"required": "true",
|
|
"name": "type",
|
|
"description": "The type of jobs to delete. <em>type</em> can be: "
|
|
},
|
|
{
|
|
"dataType": "Number",
|
|
"paramType": "query",
|
|
"name": "stamp",
|
|
"description": "A UNIX timestamp specifying the expiration threshold when type is <em>expired</em>. "
|
|
}
|
|
],
|
|
"notes": "Deletes either all job results, expired job results, or the result of a specific job. Clients can use this method to perform an eventual garbage collection of job results. <br><br>",
|
|
"summary": "Deletes the result of async jobs",
|
|
"httpMethod": "DELETE",
|
|
"examples": "Deleting all jobs: <br><br><pre><code class=\"json\" >unix> curl --header 'x-arango-async: store' --dump - http://localhost:8529/_api/version\n\nHTTP/1.1 202 Accepted\ncontent-type: text/plain; charset=utf-8\nx-arango-async-id: 375079335\n\nunix> curl -X DELETE --dump - http://localhost:8529/_api/job/all\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true \n}\n\n</code></pre><br>Deleting expired jobs: <br><br><pre><code class=\"json\" >unix> curl --header 'x-arango-async: store' --dump - http://localhost:8529/_api/version\n\nHTTP/1.1 202 Accepted\ncontent-type: text/plain; charset=utf-8\nx-arango-async-id: 375144871\n\nunix> curl -X DELETE --dump - http://localhost:8529/_api/job/expired?stamp=1380545436\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true \n}\n\n</code></pre><br>Deleting the result of a specific job: <br><br><pre><code class=\"json\" >unix> curl --header 'x-arango-async: store' --dump - http://localhost:8529/_api/version\n\nHTTP/1.1 202 Accepted\ncontent-type: text/plain; charset=utf-8\nx-arango-async-id: 375210407\n\nunix> curl -X DELETE --dump - http://localhost:8529/_api/job/375210407\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true \n}\n\n</code></pre><br>Deleting the result of a non-existing job: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/job/foobar\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"not found\", \n \"code\" : 404, \n \"errorNum\" : 404 \n}\n\n</code></pre><br>",
|
|
"nickname": "DeletesTheResultOfAsyncJobs"
|
|
}
|
|
],
|
|
"path": "/_api/job/{type}"
|
|
}
|
|
]
|
|
}
|