mirror of https://gitee.com/bigwinds/arangodb
added generated docs
This commit is contained in:
parent
7aafa3abd2
commit
e0aadd3e56
|
@ -0,0 +1,109 @@
|
|||
{
|
||||
"basePath": "/",
|
||||
"swaggerVersion": "1.1",
|
||||
"apiVersion": "0.1",
|
||||
"apis": [
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "if success <em>HTTP 200</em> is returned. ",
|
||||
"code": "200"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "namespace",
|
||||
"description": "Returns all registered AQL user functions from namespace <em>namespace</em>. "
|
||||
}
|
||||
],
|
||||
"notes": "Returns all registered AQL user functions. <br><br>The call will return a JSON list with all user functions found. Each user function will at least have the following attributes: <br><br>- <em>name</em>: The fully qualified name of the user function<br><br>- <em>code</em>: A string representation of the function body<br><br>",
|
||||
"summary": "returns registered AQL user functions",
|
||||
"httpMethod": "GET",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/aqlfunction\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n[ \n { \n \"name\" : \"myfunctions:temperature:celsiustofahrenheit\", \n \"code\" : \"function (celsius) { return celsius * 1.8 + 32; }\" \n } \n]\n\n</code></pre><br>",
|
||||
"nickname": "returnsRegisteredAqlUserFunctions"
|
||||
}
|
||||
],
|
||||
"path": "/_api/aqlfunction"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the function already existed and was replaced by the call, the server will respond with <em>HTTP 200</em>. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "If the function can be registered by the server, the server will respond with <em>HTTP 201</em>. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "If the JSON representation is malformed or mandatory data is missing from the request, the server will respond with <em>HTTP 400</em>. ",
|
||||
"code": "400"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "body",
|
||||
"description": "the body with name and code of the aql user function. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>The following data need to be passed in a JSON representation in the body of the POST request: <br><br>- <em>name</em>: the fully qualified name of the user functions.<br><br>- <em>code</em>: a string representation of the function body.<br><br>- <em>isDeterministic</em>: an optional boolean value to indicate that the function<br> results are fully deterministic (function return value solely depends on the input value and return value is the same for repeated calls with same input). The <em>isDeterministic</em> attribute is currently not used but may be used later for optimisations. <br><br>In case of success, the returned JSON object has the following properties: <br><br>- <em>error</em>: boolean flag to indicate that an error occurred (<em>false</em><br> in this case) <br><br>- <em>code</em>: the HTTP status code<br><br>The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br>- <em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case)<br><br>- <em>code</em>: the HTTP status code<br><br>- <em>errorNum</em>: the server error number<br><br>- <em>errorMessage</em>: a descriptive error message<br><br>",
|
||||
"summary": "creates or replaces an AQL user function",
|
||||
"httpMethod": "POST",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/aqlfunction\n{ \"name\" : \"myfunctions:temperature:celsiustofahrenheit\", \"code\" : \"function (celsius) { return celsius * 1.8 + 32; }\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "createsOrReplacesAnAqlUserFunction"
|
||||
}
|
||||
],
|
||||
"path": "/_api/aqlfunction"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the function can be removed by the server, the server will respond with <em>HTTP 200</em>. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "If the user function name is malformed, the server will respond with <em>HTTP 400</em>. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "If the specified user user function does not exist, the server will respond with <em>HTTP 404</em>. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "name",
|
||||
"description": "the name of the AQL user function. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "group",
|
||||
"description": "If set to <em>true</em>, then the function name provided in <em>name</em> is treated as a namespace prefix, and all functions in the specified namespace will be deleted. If set to <em>false</em>, the function name provided in <em>name</em> must be fully qualified, including any namespaces. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Removes an existing AQL user function, identified by <em>name</em>. <br><br>In case of success, the returned JSON object has the following properties: <br><br>- <em>error</em>: boolean flag to indicate that an error occurred (<em>false</em><br> in this case) <br><br>- <em>code</em>: the HTTP status code<br><br>The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br>- <em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case)<br><br>- <em>code</em>: the HTTP status code<br><br>- <em>errorNum</em>: the server error number<br><br>- <em>errorMessage</em>: a descriptive error message<br><br>",
|
||||
"summary": "remove an existing AQL user function",
|
||||
"httpMethod": "DELETE",
|
||||
"examples": "deletes a function: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/aqlfunction/square:x:y\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>function not found: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/aqlfunction/myfunction:x:y\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 1582, \n \"errorMessage\" : \"user function '%s()' not found\" \n}\n\n</code></pre><br>",
|
||||
"nickname": "removeAnExistingAqlUserFunction"
|
||||
}
|
||||
],
|
||||
"path": "/_api/aqlfunction/{name}"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,361 @@
|
|||
{
|
||||
"basePath": "/",
|
||||
"swaggerVersion": "1.1",
|
||||
"apiVersion": "0.1",
|
||||
"apis": [
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "body",
|
||||
"description": "the body with name, options of a collection. "
|
||||
}
|
||||
],
|
||||
"notes": "Creates an new collection with a given name. The request must contain an object with the following attributes. <br><br>- <em>name</em>: The name of the collection.<br><br>- <em>waitForSync</em> (optional, default: false): If <em>true</em> then<br> the data is synchronised to disk before returning from a create or update of a document. <br><br>- <em>journalSize</em> (optional, default is a @ref<br> CommandLineArangod \"configuration parameter\"): The maximal size of a journal or datafile. Note that this also limits the maximal size of a single object. Must be at least 1MB. <br><br>- <em>isSystem</em> (optional, default is <em>false</em>): If <em>true</em>, create a<br> system collection. In this case <em>collection-name</em> should start with an underscore. End users should normally create non-system collections only. API implementors may be required to create system collections in very special occasions, but normally a regular collection will do. <br><br>- <em>isVolatile</em> (optional, default is <em>false</em>): If <em>true</em> then the<br> collection data is kept in-memory only and not made persistent. Unloading the collection will cause the collection data to be discarded. Stopping or re-starting the server will also cause full loss of data in the collection. Setting this option will make the resulting collection be slightly faster than regular collections because ArangoDB does not enforce any synchronisation to disk and does not calculate any CRC checksums for datafiles (as there are no datafiles). <br><br> This option should threrefore be used for cache-type collections only, and not for data that cannot be re-created otherwise. <br><br>- <em>keyOptions</em> (optional) additional options for key generation. If<br> specified, then <em>keyOptions</em> should be a JSON array containing the following attributes (note: some of them are optional): - <em>type</em>: specifies the type of the key generator. The currently available generators are <em>traditional</em> and <em>autoincrement</em>. - <em>allowUserKeys</em>: if set to <em>true</em>, then it is allowed to supply own key values in the <em>_key</em> attribute of a document. If set to <em>false</em>, then the key generator will solely be responsible for generating keys and supplying own key values in the <em>_key</em> attribute of documents is considered an error. - <em>increment</em>: increment value for <em>autoincrement</em> key generator. Not used for other key generator types. - <em>offset</em>: initial offset value for <em>autoincrement</em> key generator. Not used for other key generator types. <br><br>- <em>type</em> (optional, default is <em>2</em>): the type of the collection to<br> create. The following values for <em>type</em> are valid: - <em>2</em>: document collection - <em>3</em>: edges collection <br><br>",
|
||||
"summary": "creates a collection",
|
||||
"httpMethod": "POST",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/collection\n{ \"name\": \"testCollectionBasics\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/testCollectionBasics\n\n{ \n \"id\" : \"78936590\", \n \"name\" : \"testCollectionBasics\", \n \"waitForSync\" : false, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\nunix> curl -X POST --data @- --dump - http://localhost:8529/_api/collection\n{ \"name\": \"testCollectionEdges\", \"type\" : 3 }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/testCollectionEdges\n\n{ \n \"id\" : \"79723022\", \n \"name\" : \"testCollectionEdges\", \n \"waitForSync\" : false, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"status\" : 3, \n \"type\" : 3, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br><br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/collection\n{ \"name\": \"testCollectionUsers\", \"keyOptions\" : { \"type\" : \"autoincrement\", \"increment\" : 5, \"allowUserKeys\" : true }}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/testCollectionUsers\n\n{ \n \"id\" : \"47544846\", \n \"name\" : \"testCollectionUsers\", \n \"waitForSync\" : false, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "createsACollection"
|
||||
}
|
||||
],
|
||||
"path": "/_api/collection"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "Boolean",
|
||||
"paramType": "path",
|
||||
"required": "false",
|
||||
"name": "excludeSystem",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "Returns an object with an attribute <em>collections</em> containing a list of all collection descriptions. The same information is also available in the <em>names</em> as hash map with the collection names as keys. <br><br>By providing the optional URL parameter <em>excludeSystem</em> with a value of <em>true</em>, all system collections will be excluded from the response. <br><br>",
|
||||
"summary": "reads all collections",
|
||||
"httpMethod": "GET",
|
||||
"examples": "Return information about all collections: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"collections\" : [ \n { \n \"id\" : \"6650382\", \n \"name\" : \"_aal\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"47544846\", \n \"name\" : \"testCollectionUsers\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"8813070\", \n \"name\" : \"_fishbowl\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"23099918\", \n \"name\" : \"animals\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"2718222\", \n \"name\" : \"_modules\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"5601806\", \n \"name\" : \"_structures\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"7830030\", \n \"name\" : \"_aqlfunctions\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"96782\", \n \"name\" : \"_users\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"21264910\", \n \"name\" : \"demo\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"3701262\", \n \"name\" : \"_routing\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"10058254\", \n \"name\" : \"_trx\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"1669646\", \n \"name\" : \"_graphs\", \n \"status\" : 3, \n \"type\" : 2 \n } \n ], \n \"names\" : { \n \"_aal\" : { \n \"id\" : \"6650382\", \n \"name\" : \"_aal\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"testCollectionUsers\" : { \n \"id\" : \"47544846\", \n \"name\" : \"testCollectionUsers\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_fishbowl\" : { \n \"id\" : \"8813070\", \n \"name\" : \"_fishbowl\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"animals\" : { \n \"id\" : \"23099918\", \n \"name\" : \"animals\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_modules\" : { \n \"id\" : \"2718222\", \n \"name\" : \"_modules\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_structures\" : { \n \"id\" : \"5601806\", \n \"name\" : \"_structures\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_aqlfunctions\" : { \n \"id\" : \"7830030\", \n \"name\" : \"_aqlfunctions\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_users\" : { \n \"id\" : \"96782\", \n \"name\" : \"_users\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"demo\" : { \n \"id\" : \"21264910\", \n \"name\" : \"demo\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_routing\" : { \n \"id\" : \"3701262\", \n \"name\" : \"_routing\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_trx\" : { \n \"id\" : \"10058254\", \n \"name\" : \"_trx\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_graphs\" : { \n \"id\" : \"1669646\", \n \"name\" : \"_graphs\", \n \"status\" : 3, \n \"type\" : 2 \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "readsAllCollections"
|
||||
}
|
||||
],
|
||||
"path": "/_api/collection"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "collection-name",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "The result is an object describing the collection with the following attributes: <br><br>- <em>id</em>: The identifier of the collection.<br><br>- <em>name</em>: The name of the collection.<br><br>- <em>status</em>: The status of the collection as number.<br> - 1: new born collection - 2: unloaded - 3: loaded - 4: in the process of being unloaded - 5: deleted <br><br>Every other status indicates a corrupted collection. <br><br>- <em>type</em>: The type of the collection as number.<br> - 2: document collection (normal case) - 3: edges collection <br><br>",
|
||||
"summary": "reads a collection",
|
||||
"httpMethod": "GET",
|
||||
"examples": "",
|
||||
"nickname": "readsACollection"
|
||||
}
|
||||
],
|
||||
"path": "/_api/collection/{collection-name}"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is missing, then a <em>HTTP 400</em> is returned. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "collection-name",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "In addition to the above, the result will always contain the <em>waitForSync</em>, <em>journalSize</em>, and <em>isVolatile</em> properties. This is achieved by forcing a load of the underlying collection. <br><br>- <em>waitForSync</em>: If <em>true</em> then creating or changing a<br> document will wait until the data has been synchronised to disk. <br><br>- <em>journalSize</em>: The maximal size of a journal / datafile.<br><br>- <em>isVolatile</em>: If <em>true</em> then the collection data will be<br> kept in memory only and ArangoDB will not write or sync the data to disk. <br><br>",
|
||||
"summary": "reads a collection with properties",
|
||||
"httpMethod": "GET",
|
||||
"examples": "Using an identifier: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/208370190/properties\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/products/properties\n\n{ \n \"id\" : \"208370190\", \n \"name\" : \"products\", \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Using a name: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/products/properties\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/products/properties\n\n{ \n \"id\" : \"171407886\", \n \"name\" : \"products\", \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "readsACollectionWithProperties"
|
||||
}
|
||||
],
|
||||
"path": "/_api/collection/{collection-name}/properties"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is missing, then a <em>HTTP 400</em> is returned. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "collection-name",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "In addition to the above, the result also contains the number of documents. Note that this will always load the collection into memory. <br><br>- <em>count</em>: The number of documents inside the collection.<br><br>",
|
||||
"summary": "reads a collection with count",
|
||||
"httpMethod": "GET",
|
||||
"examples": "Using an identifier and requesting the number of documents: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/172390926/count\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/products/count\n\n{ \n \"id\" : \"172390926\", \n \"name\" : \"products\", \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"count\" : 100, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "readsACollectionWithCount"
|
||||
}
|
||||
],
|
||||
"path": "/_api/collection/{collection-name}/count"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is missing, then a <em>HTTP 400</em> is returned. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "collection-name",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "In addition to the above, the result also contains the number of documents and additional statistical information about the collection. Note that this will always load the collection into memory. <br><br>- <em>count</em>: The number of documents inside the collection.<br><br>- <em>figures.alive.count</em>: The number of living documents.<br><br>- <em>figures.alive.size</em>: The total size in bytes used by all<br> living documents. <br><br>- <em>figures.dead.count</em>: The number of dead documents.<br><br>- <em>figures.dead.size</em>: The total size in bytes used by all<br> dead documents. <br><br>- <em>figures.dead.deletion</em>: The total number of deletion markers.<br><br>- <em>figures.datafiles.count</em>: The number of active datafiles.<br>- <em>figures.datafiles.fileSize</em>: The total filesize of datafiles.<br><br>- <em>figures.journals.count</em>: The number of journal files.<br>- <em>figures.journals.fileSize</em>: The total filesize of journal files.<br><br>- <em>figures.shapes.count</em>: The total number of shapes used in the <br> collection (this includes shapes that are not in use anymore) <br><br>- <em>figures.attributes.count</em>: The total number of attributes used <br> in the collection (this includes attributes that are not in use anymore) <br><br>- <em>journalSize</em>: The maximal size of the journal in bytes.<br><br>Note: the filesizes of shapes and compactor files are not reported. <br><br>",
|
||||
"summary": "reads a collection with stats",
|
||||
"httpMethod": "GET",
|
||||
"examples": "Using an identifier and requesting the figures of the collection: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/111442446/figures\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/products/figures\n\n{ \n \"id\" : \"111442446\", \n \"name\" : \"products\", \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"count\" : 0, \n \"figures\" : { \n \"alive\" : { \n \"count\" : 0, \n \"size\" : 0 \n }, \n \"dead\" : { \n \"count\" : 0, \n \"size\" : 0, \n \"deletion\" : 0 \n }, \n \"datafiles\" : { \n \"count\" : 0, \n \"fileSize\" : 0 \n }, \n \"journals\" : { \n \"count\" : 0, \n \"fileSize\" : 0 \n }, \n \"shapes\" : { \n \"count\" : 6 \n }, \n \"attributes\" : { \n \"count\" : 0 \n } \n }, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "readsACollectionWithStats"
|
||||
}
|
||||
],
|
||||
"path": "/_api/collection/{collection-name}/figures"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is missing, then a <em>HTTP 400</em> is returned. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "collection-name",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "In addition to the above, the result will also contain the collection's revision id. The revision id is a server-generated string that clients can use to check whether data in a collection has changed since the last revision check. <br><br>- <em>revision</em>: The collection revision id as a string.<br><br>",
|
||||
"summary": " reads a collection with revision id",
|
||||
"httpMethod": "GET",
|
||||
"examples": "",
|
||||
"nickname": "readsACollectionWithRevisionId"
|
||||
}
|
||||
],
|
||||
"path": "/_api/collection/{collection-name}/revision"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is missing, then a <em>HTTP 400</em> is returned. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "collection-name",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "Loads a collection into memory. Returns the collection on success. <br><br>The request might optionally contain the following attribute: <br><br>- <em>count</em>: If set, this controls whether the return value should include<br> the number of documents in the collection. Setting <em>count</em> to <em>false</em> may speed up loading a collection. The default value for <em>count</em> is <em>true</em>. <br><br>On success an object with the following attributes is returned: <br><br>- <em>id</em>: The identifier of the collection.<br><br>- <em>name</em>: The name of the collection.<br><br>- <em>count</em>: The number of documents inside the collection. This is only<br> returned if the <em>count</em> input parameters is set to <em>true</em> or has not been specified. <br><br>- <em>status</em>: The status of the collection as number.<br><br>- <em>type</em>: The collection type. Valid types are:<br> - 2: document collection - 3: edges collection <br><br>",
|
||||
"summary": "loads a collection",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --dump - http://localhost:8529/_api/collection/244808206/load\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"244808206\", \n \"name\" : \"products\", \n \"count\" : 0, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "loadsACollection"
|
||||
}
|
||||
],
|
||||
"path": "/_api/collection/{collection-name}/load"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is missing, then a <em>HTTP 400</em> is returned. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "collection-name",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "Removes a collection from memory. This call does not delete any documents. You can use the collection afterwards; in which case it will be loaded into memory, again. On success an object with the following attributes is returned: <br><br>- <em>id</em>: The identifier of the collection.<br><br>- <em>name</em>: The name of the collection.<br><br>- <em>status</em>: The status of the collection as number.<br><br>- <em>type</em>: The collection type. Valid types are:<br> - 2: document collection - 3: edges collection <br><br>",
|
||||
"summary": "unloads a collection",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --dump - http://localhost:8529/_api/collection/39090702/unload\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"39090702\", \n \"name\" : \"products\", \n \"status\" : 4, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "unloadsACollection"
|
||||
}
|
||||
],
|
||||
"path": "/_api/collection/{collection-name}/unload"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "collection-name",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "Removes all documents from the collection, but leaves the indexes intact. <br><br>",
|
||||
"summary": "truncates a collection",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --dump - http://localhost:8529/_api/collection/159087118/truncate\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"159087118\", \n \"name\" : \"products\", \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "truncatesACollection"
|
||||
}
|
||||
],
|
||||
"path": "/_api/collection/{collection-name}/truncate"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "collection-name",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "Changes the properties of a collection. Expects an object with the attribute(s) <br><br>- <em>waitForSync</em>: If <em>true</em> then creating or changing a<br> document will wait until the data has been synchronised to disk. <br><br>- <em>journalSize</em>: Size (in bytes) for new journal files that are<br> created for the collection. <br><br>If returns an object with the attributes <br><br>- <em>id</em>: The identifier of the collection.<br><br>- <em>name</em>: The name of the collection.<br><br>- <em>waitForSync</em>: The new value.<br><br>- <em>journalSize</em>: The new value.<br><br>- <em>status</em>: The status of the collection as number.<br><br>- <em>type</em>: The collection type. Valid types are:<br> - 2: document collection - 3: edges collection <br><br>Note: some other collection properties, such as <em>type</em> or <em>isVolatile</em> cannot be changed once the collection is created. <br><br>",
|
||||
"summary": "changes the properties of a collection",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/collection/201751054/properties\n{\"waitForSync\":true}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"201751054\", \n \"name\" : \"products\", \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "changesThePropertiesOfACollection"
|
||||
}
|
||||
],
|
||||
"path": "/_api/collection/{collection-name}/properties"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "collection-name",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "Renames a collection. Expects an object with the attribute(s) <br><br>- <em>name</em>: The new name.<br><br>If returns an object with the attributes <br><br>- <em>id</em>: The identifier of the collection.<br><br>- <em>name</em>: The new name of the collection.<br><br>- <em>status</em>: The status of the collection as number.<br><br>- <em>type</em>: The collection type. Valid types are:<br> - 2: document collection - 3: edges collection <br><br>",
|
||||
"summary": "renames a collection",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/collection/199260686/rename\n{\"name\":\"newname\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"199260686\", \n \"name\" : \"newname\", \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "renamesACollection"
|
||||
}
|
||||
],
|
||||
"path": "/_api/collection/{collection-name}/rename"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is missing, then a <em>HTTP 400</em> is returned. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "collection-name",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "Deletes a collection identified by <em>collection-name</em>. <br><br>If the collection was successfully deleted then, an object is returned with the following attributes: <br><br>- <em>error</em>: <em>false</em><br><br>- <em>id</em>: The identifier of the deleted collection.<br><br>",
|
||||
"summary": "deletes a collection",
|
||||
"httpMethod": "DELETE",
|
||||
"examples": "Using an identifier: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/collection/216889870\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"216889870\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Using a name: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/collection/products1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"132610574\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "deletesACollection"
|
||||
}
|
||||
],
|
||||
"path": "/_api/collection/{collection-name}"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
{
|
||||
"basePath": "/",
|
||||
"swaggerVersion": "1.1",
|
||||
"apiVersion": "0.1",
|
||||
"apis": [
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the result set can be created by the server. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the JSON representation is malformed or the query specification is missing from the request. ",
|
||||
"code": "400"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "query",
|
||||
"description": "The following attributes can be used inside the JSON object: - <em>query</em>: contains the query string to be executed (mandatory) - <em>count</em>: boolean flag that indicates whether the number of documents found should be returned as \"count\" attribute in the result set (optional). Calculating the \"count\" attribute might have a performance penalty for some queries so this option is turned off by default. - <em>batchSize</em>: maximum number of result documents to be transferred from the server to the client in one roundtrip (optional). If this attribute is not set, a server-controlled default value will be used. - <em>bindVars</em>: key/value list of bind parameters (optional). "
|
||||
}
|
||||
],
|
||||
"notes": "The query details include the query string plus optional query options and bind parameters. These values need to be passed in a JSON representation in the body of the POST request. <br><br>The following attributes can be used inside the JSON object: <br><br>- <em>query</em>: contains the query string to be executed (mandatory)<br><br>- <em>count</em>: boolean flag that indicates whether the number of documents<br> found should be returned as \"count\" attribute in the result set (optional). Calculating the \"count\" attribute might have a performance penalty for some queries so this option is turned off by default. <br><br>- <em>batchSize</em>: maximum number of result documents to be transferred from<br> the server to the client in one roundtrip (optional). If this attribute is not set, a server-controlled default value will be used. <br><br>- <em>bindVars</em>: key/value list of bind parameters (optional). <br><br>If the result set can be created by the server, the server will respond with <em>HTTP 201</em>. The body of the response will contain a JSON object with the result set. <br><br>The JSON object has the following properties: <br><br>- <em>error</em>: boolean flag to indicate that an error occurred (<em>false</em><br> in this case) <br><br>- <em>code</em>: the HTTP status code<br><br>- <em>result</em>: an array of result documents (might be empty if query has no results)<br><br>- <em>hasMore</em>: a boolean indicator whether there are more results<br> available on the server <br><br>- <em>count</em>: the total number of result documents available (only<br> available if the query was executed with the <em>count</em> attribute set. <br><br>- <em>id</em>: id of temporary cursor created on the server (optional, see above)<br><br>If the JSON representation is malformed or the query specification is missing from the request, the server will respond with <em>HTTP 400</em>. <br><br>The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br>- <em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case)<br><br>- <em>code</em>: the HTTP status code<br><br>- <em>errorNum</em>: the server error number<br><br>- <em>errorMessage</em>: a descriptive error message<br><br>If the query specification is complete, the server will process the query. If an error occurs during query processing, the server will respond with <em>HTTP 400</em>. Again, the body of the response will contain details about the error. <br><br>A list of query errors can be found @ref ArangoErrors here. <br><br>",
|
||||
"summary": "creates a cursor",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Executes a query and extract the result in a single go: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/cursor\n{ \"query\" : \"FOR p IN products LIMIT 2 RETURN p\", \"count\" : true, \"batchSize\" : 2 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/135100942\", \n \"_rev\" : \"135100942\", \n \"_key\" : \"135100942\", \n \"hello2\" : \"world1\" \n }, \n { \n \"_id\" : \"products/134642190\", \n \"_rev\" : \"134642190\", \n \"_key\" : \"134642190\", \n \"hello1\" : \"world1\" \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Executes a query and extract part of the result: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/cursor\n{ \"query\" : \"FOR p IN products LIMIT 5 RETURN p\", \"count\" : true, \"batchSize\" : 2 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/165509646\", \n \"_rev\" : \"165509646\", \n \"_key\" : \"165509646\", \n \"hello5\" : \"world1\" \n }, \n { \n \"_id\" : \"products/164264462\", \n \"_rev\" : \"164264462\", \n \"_key\" : \"164264462\", \n \"hello1\" : \"world1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"165640718\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Bad queries: Missing body: <br><br><pre><code class=\"json\" >unix> curl -X POST --dump - http://localhost:8529/_api/cursor\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1502, \n \"errorMessage\" : \"query is empty\" \n}\n\n</code></pre><br>Unknown collection: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/cursor\n{ \"query\" : \"FOR u IN unknowncoll LIMIT 2 RETURN u\", \"count\" : true, \"batchSize\" : 2 }\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1203, \n \"errorMessage\" : \"cannot execute query: collection not found\" \n}\n\n</code></pre><br>",
|
||||
"nickname": "createsACursor"
|
||||
}
|
||||
],
|
||||
"path": "/_api/cursor"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "The server will respond with <em>HTTP 200</em> in case of success. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "If the cursor identifier is ommitted or somehow invalid, the server will respond with <em>HTTP 404</em>. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "cursor-identifer",
|
||||
"description": "The name of the cursor "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>If the cursor is still alive, returns an object with the following attributes. <br><br>- <em>id</em>: the <em>cursor-identifier</em><br>- <em>result</em>: a list of documents for the current batch<br>- <em>hasMore</em>: <em>false</em> if this was the last batch<br>- <em>count</em>: if present the total number of elements<br><br>Note that even if <em>hasMore</em> returns <em>true</em>, the next call might still return no documents. If, however, <em>hasMore</em> is <em>false</em>, then the cursor is exhausted. Once the <em>hasMore</em> attribute has a value of <em>false</em>, the client can stop. <br><br>",
|
||||
"summary": "reads next batch from a cursor",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "Valid request for next batch: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/cursor\n{ \"query\" : \"FOR p IN products LIMIT 5 RETURN p\", \"count\" : true, \"batchSize\" : 2 }\n\nunix> curl -X PUT --dump - http://localhost:8529/_api/cursor/226785806\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/226654734\", \n \"_rev\" : \"226654734\", \n \"_key\" : \"226654734\", \n \"hello5\" : \"world1\" \n }, \n { \n \"_id\" : \"products/225868302\", \n \"_rev\" : \"225868302\", \n \"_key\" : \"225868302\", \n \"hello2\" : \"world1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"226785806\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Missing identifier <br><br><pre><code class=\"json\" >unix> curl -X PUT --dump - http://localhost:8529/_api/cursor\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 400, \n \"errorMessage\" : \"bad parameter\" \n}\n\n</code></pre><br>Unknown identifier <br><br><pre><code class=\"json\" >unix> curl -X PUT --dump - http://localhost:8529/_api/cursor/123123\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1600, \n \"errorMessage\" : \"cursor not found\" \n}\n\n</code></pre><br>",
|
||||
"nickname": "readsNextBatchFromACursor"
|
||||
}
|
||||
],
|
||||
"path": "/_api/cursor/{cursor-identifier}"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the server is aware of the cursor. ",
|
||||
"code": "202"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the server is not aware of the cursor. It is also returned if a cursor is used after it has been destroyed. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "cursor-identifer",
|
||||
"description": "The name of the cursor "
|
||||
}
|
||||
],
|
||||
"notes": "Deletes the cursor and frees the resources associated with it. <br><br>The cursor will automatically be destroyed on the server when the client has retrieved all documents from it. The client can also explicitly destroy the cursor at any earlier time using an HTTP DELETE request. The cursor id must be included as part of the URL. <br><br>Note: the server will also destroy abandoned cursors automatically after a certain server-controlled timeout to avoid resource leakage. <br><br>",
|
||||
"summary": "deletes a cursor",
|
||||
"httpMethod": "DELETE",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/cursor\n{ \"query\" : \"FOR p IN products LIMIT 5 RETURN p\", \"count\" : true, \"batchSize\" : 2 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/231897614\", \n \"_rev\" : \"231897614\", \n \"_key\" : \"231897614\", \n \"hello2\" : \"world1\" \n }, \n { \n \"_id\" : \"products/232684046\", \n \"_rev\" : \"232684046\", \n \"_key\" : \"232684046\", \n \"hello5\" : \"world1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"232815118\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 201 \n}\n\nunix> curl -X DELETE --dump - http://localhost:8529/_api/cursor/232815118\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"232815118\", \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
|
||||
"nickname": "deletesACursor"
|
||||
}
|
||||
],
|
||||
"path": "/_api/cursor/{cursor-identifier}"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,407 @@
|
|||
{
|
||||
"basePath": "/",
|
||||
"swaggerVersion": "1.1",
|
||||
"apiVersion": "0.1",
|
||||
"apis": [
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the document was created sucessfully and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the document was created sucessfully and <em>waitForSync</em> was <em>false</em>. ",
|
||||
"code": "202"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "document",
|
||||
"description": "A JSON representation of document. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"required": "True",
|
||||
"name": "collection",
|
||||
"description": "The collection name. "
|
||||
},
|
||||
{
|
||||
"dataType": "Boolean",
|
||||
"paramType": "query",
|
||||
"name": "createCollection",
|
||||
"description": "If this parameter has a value of <em>true</em> or <em>yes</em>, then the collection is created if it does not yet exist. Other values will be ignored so the collection must be present for the operation to succeed. "
|
||||
},
|
||||
{
|
||||
"dataType": "Boolean",
|
||||
"paramType": "query",
|
||||
"name": "waitForSync",
|
||||
"description": "Wait until document has been sync to disk. "
|
||||
}
|
||||
],
|
||||
"notes": "Creates a new document in the collection named <em>collection</em>. A JSON representation of the document must be passed as the body of the POST request. <br><br>If the document was created successfully, then the \"Location\" header contains the path to the newly created document. The \"ETag\" header field contains the revision of the document. <br><br>The body of the response contains a JSON object with the following attributes: <br><br>- <em>_id</em> contains the document handle of the newly created document<br>- <em>_key</em> contains the document key<br>- <em>_rev</em> contains the document revision<br><br>If the collection parameter <em>waitForSync</em> is <em>false</em>, then the call returns as soon as the document has been accepted. It will not wait, until the documents has been sync to disk. <br><br>Optionally, the URL parameter <em>waitForSync</em> can be used to force synchronisation of the document creation operation to disk even in case that the <em>waitForSync</em> flag had been disabled for the entire collection. Thus, the <em>waitForSync</em> URL parameter can be used to force synchronisation of just this specific operations. To use this, set the <em>waitForSync</em> parameter to <em>true</em>. If the <em>waitForSync</em> parameter is not specified or set to <em>false</em>, then the collection's default <em>waitForSync</em> behavior is applied. The <em>waitForSync</em> URL parameter cannot be used to disable synchronisation for collections that have a default <em>waitForSync</em> value of <em>true</em>. <br><br>",
|
||||
"summary": "creates a document",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Create a document given a collection named <em>products</em>. Note that the revision identifier might or might not by equal to the auto-generated key. <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/document?collection=products\n{ \"Hello\": \"World\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\netag: \"210532878\"\nlocation: /_api/document/products/210532878\n\n{ \n \"error\" : false, \n \"_id\" : \"products/210532878\", \n \"_rev\" : \"210532878\", \n \"_key\" : \"210532878\" \n}\n\n</code></pre><br>Create a document in a collection named <em>products</em> with a collection-level <em>waitForSync</em> value of <em>false</em>. <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/document?collection=products\n{ \"Hello\": \"World\" }\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"24869390\"\nlocation: /_api/document/products/24869390\n\n{ \n \"error\" : false, \n \"_id\" : \"products/24869390\", \n \"_rev\" : \"24869390\", \n \"_key\" : \"24869390\" \n}\n\n</code></pre><br>Create a document in a collection with a collection-level <em>waitForSync</em> value of <em>false</em>, but using the <em>waitForSync</em> URL parameter. <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/document?collection=products&waitForSync=true\n{ \"Hello\": \"World\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\netag: \"158824974\"\nlocation: /_api/document/products/158824974\n\n{ \n \"error\" : false, \n \"_id\" : \"products/158824974\", \n \"_rev\" : \"158824974\", \n \"_key\" : \"158824974\" \n}\n\n</code></pre><br>Create a document in a new, named collection <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/document?collection=products&createCollection=true\n{ \"Hello\": \"World\" }\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"211581454\"\nlocation: /_api/document/products/211581454\n\n{ \n \"error\" : false, \n \"_id\" : \"products/211581454\", \n \"_rev\" : \"211581454\", \n \"_key\" : \"211581454\" \n}\n\n</code></pre><br>Unknown collection name: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/document?collection=products\n{ \"Hello\": \"World\" }\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"collection /_api/collection/products not found\", \n \"code\" : 404, \n \"errorNum\" : 1203 \n}\n\n</code></pre><br>Illegal document: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/document?collection=products\n{ 1: \"World\" }\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"expecting attribute name\", \n \"code\" : 400, \n \"errorNum\" : 600 \n}\n\n</code></pre><br>",
|
||||
"nickname": "createsADocument"
|
||||
}
|
||||
],
|
||||
"path": "/_api/document"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the document was found ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the document or collection was not found ",
|
||||
"code": "404"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the \"If-None-Match\" header is given and the document has same version ",
|
||||
"code": "304"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the found document has a different version ",
|
||||
"code": "412"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "document-handle",
|
||||
"description": "The Handle of the Document. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "If-None-Match",
|
||||
"description": "If the \"If-None-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has a different revision than the given etag. Otherwise a <em>HTTP 304</em> is returned. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "If-Match",
|
||||
"description": "If the \"If-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has the same revision ad the given etag. Otherwise a <em>HTTP 412</em> is returned. As an alternative you can supply the etag in an attribute <em>rev</em> in the URL. "
|
||||
}
|
||||
],
|
||||
"notes": "Returns the document identified by <em>document-handle</em>. The returned document contains two special attributes: <em>_id</em> containing the document handle and <em>_rev</em> containing the revision. <br><br>",
|
||||
"summary": "reads a document",
|
||||
"httpMethod": "GET",
|
||||
"examples": "Use a document handle: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/document/products/162101774\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"162101774\"\n\n{ \n \"hello\" : \"world\", \n \"_id\" : \"products/162101774\", \n \"_rev\" : \"162101774\", \n \"_key\" : \"162101774\" \n}\n\n</code></pre><br>Use a document handle and an etag: <br><br><pre><code class=\"json\" >unix> curl --header 'If-None-Match:\"149191182\"' --dump - http://localhost:8529/_api/document/products/149191182\n\nHTTP/1.1 304 Not Modified\ncontent-type: text/plain; charset=utf-8\netag: \"149191182\"\n\n</code></pre><br>Unknown document handle: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/document/products/unknownhandle\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"collection /_api/collection/products not found\", \n \"code\" : 404, \n \"errorNum\" : 1203 \n}\n\n</code></pre><br>",
|
||||
"nickname": "readsADocument"
|
||||
}
|
||||
],
|
||||
"path": "/_api/document/{document-handle}"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "All went good. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "The collection does not exist. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"required": "True",
|
||||
"name": "collection",
|
||||
"description": "The Id of the collection. "
|
||||
}
|
||||
],
|
||||
"notes": "Returns a list of all URI for all documents from the collection identified by <em>collection</em>. <br><br>",
|
||||
"summary": "reads all documents from collection",
|
||||
"httpMethod": "GET",
|
||||
"examples": "Returns a collection. <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/document/?collection=products\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"documents\" : [ \n \"/_api/document/products/37911054\", \n \"/_api/document/products/37648910\", \n \"/_api/document/products/37190158\" \n ] \n}\n\n</code></pre><br>Collection does not exist. <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/document/?collection=doesnotexist\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"collection /_api/collection/doesnotexist not found\", \n \"code\" : 404, \n \"errorNum\" : 1203 \n}\n\n</code></pre><br>",
|
||||
"nickname": "readsAllDocumentsFromCollection"
|
||||
}
|
||||
],
|
||||
"path": "/_api/document"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the document was found ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the document or collection was not found ",
|
||||
"code": "404"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the \"If-None-Match\" header is given and the document has same version ",
|
||||
"code": "304"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the found document has a different version ",
|
||||
"code": "412"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "document-handle",
|
||||
"description": "The Handle of the Document. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "rev",
|
||||
"description": "You can conditionally delete a document based on a target revision id by using the <em>rev</em> URL parameter. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "policy",
|
||||
"description": "To control the update behavior in case there is a revision mismatch, you can use the <em>policy</em> parameter. This is the same as when replacing documents (see replacing documents for more details). "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "If-Match",
|
||||
"description": "You can conditionally get a document based on a target revision id by using the <em>if-match</em> HTTP header. "
|
||||
}
|
||||
],
|
||||
"notes": "Like <em>GET</em>, but only returns the header fields and not the body. You can use this call to get the current revision of a document or check if the document was deleted. <br><br>",
|
||||
"summary": "reads a document header",
|
||||
"httpMethod": "HEAD",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X HEAD --dump - http://localhost:8529/_api/document/products/216562190\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"216562190\"\n\n</code></pre><br>",
|
||||
"nickname": "readsADocumentHeader"
|
||||
}
|
||||
],
|
||||
"path": "/_api/document/{document-handle}"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the document was created sucessfully and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the document was created sucessfully and <em>waitForSync</em> was <em>false</em>. ",
|
||||
"code": "202"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if collection or the document was not found ",
|
||||
"code": "404"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the found document has a different version ",
|
||||
"code": "412"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "document-handle",
|
||||
"description": "The Handle of the Document. "
|
||||
},
|
||||
{
|
||||
"dataType": "Boolean",
|
||||
"paramType": "query",
|
||||
"name": "waitForSync",
|
||||
"description": "Wait until document has been sync to disk. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "rev",
|
||||
"description": "You can conditionally replace a document based on a target revision id by using the <em>rev</em> URL parameter. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "policy",
|
||||
"description": "To control the update behavior in case there is a revision mismatch, you can use the <em>policy</em> parameter. This is the same as when replacing documents (see replacing documents for more details). "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "If-Match",
|
||||
"description": "You can conditionally replace a document based on a target revision id by using the <em>if-match</em> HTTP header. "
|
||||
}
|
||||
],
|
||||
"notes": "Completely updates (i.e. replaces) the document identified by <em>document-handle</em>. If the document exists and can be updated, then a <em>HTTP 201</em> is returned and the \"ETag\" header field contains the new revision of the document. <br><br>If the new document passed in the body of the request contains the <em>document-handle</em> in the attribute <em>_id</em> and the revision in <em>_rev</em>, these attributes will be ignored. Only the URI and the \"ETag\" header are relevant in order to avoid confusion when using proxies. <br><br>Optionally, the URL parameter <em>waitForSync</em> can be used to force synchronisation of the document replacement operation to disk even in case that the <em>waitForSync</em> flag had been disabled for the entire collection. Thus, the <em>waitForSync</em> URL parameter can be used to force synchronisation of just specific operations. To use this, set the <em>waitForSync</em> parameter to <em>true</em>. If the <em>waitForSync</em> parameter is not specified or set to <em>false</em>, then the collection's default <em>waitForSync</em> behavior is applied. The <em>waitForSync</em> URL parameter cannot be used to disable synchronisation for collections that have a default <em>waitForSync</em> value of <em>true</em>. <br><br>The body of the response contains a JSON object with the information about the handle and the revision. The attribute <em>_id</em> contains the known <em>document-handle</em> of the updated document, the attribute <em>_rev</em> contains the new document revision. <br><br>If the document does not exist, then a <em>HTTP 404</em> is returned and the body of the response contains an error document. <br><br>There are two ways for specifying the targeted document revision id for conditional replacements (i.e. replacements that will only be executed if the revision id found in the database matches the document revision id specified in the request): - specifying the target revision in the <em>rev</em> URL query parameter<br>- specifying the target revision in the <em>if-match</em> HTTP header<br><br>Specifying a target revision is optional, however, if done, only one of the described mechanisms must be used (either the <em>rev</em> URL parameter or the <em>if-match</em> HTTP header). Regardless which mechanism is used, the parameter needs to contain the target document revision id as returned in the <em>_rev</em> attribute of a document or by an HTTP <em>etag</em> header. <br><br>For example, to conditionally replace a document based on a specific revision id, you the following request: <br><br>- PUT /_api/document/<em>document-handle</em>?rev=<em>etag</em><br><br>If a target revision id is provided in the request (e.g. via the <em>etag</em> value in the <em>rev</em> URL query parameter above), ArangoDB will check that the revision id of the document found in the database is equal to the target revision id provided in the request. If there is a mismatch between the revision id, then by default a <em>HTTP 412</em> conflict is returned and no replacement is performed. <br><br>The conditional update behavior can be overriden with the <em>policy</em> URL query parameter: <br><br>- PUT /_api/document/<em>document-handle</em>?policy=<em>policy</em><br><br>If <em>policy</em> is set to <em>error</em>, then the behavior is as before: replacements will fail if the revision id found in the database does not match the target revision id specified in the request. <br><br>If <em>policy</em> is set to <em>last</em>, then the replacement will succeed, even if the revision id found in the database does not match the target revision id specified in the request. You can use the <em>last</em> `policy` to force replacements. <br><br>",
|
||||
"summary": "replaces a document",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "Using document handle: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/document/products/97942030\n{\"Hello\": \"you\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"98400782\"\nlocation: /_api/document/products/97942030\n\n{ \n \"error\" : false, \n \"_id\" : \"products/97942030\", \n \"_rev\" : \"98400782\", \n \"_key\" : \"97942030\" \n}\n\n</code></pre><br>Unknown document handle: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/document/products/201161230\n{}\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"document /_api/document/products/201161230 not found\", \n \"code\" : 404, \n \"errorNum\" : 1202 \n}\n\n</code></pre><br>Produce a revision conflict: <br><br><pre><code class=\"json\" >unix> curl -X PUT --header 'If-Match:\"29719054\"' --data @- --dump - http://localhost:8529/_api/document/products/29260302\n{\"other\":\"content\"}\n\nHTTP/1.1 412 Precondition Failed\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 412, \n \"errorNum\" : 1200, \n \"errorMessage\" : \"precondition failed\", \n \"_id\" : \"products/29260302\", \n \"_rev\" : \"29260302\", \n \"_key\" : \"29260302\" \n}\n\n</code></pre><br>Last write wins: <br><br><pre><code class=\"json\" >unix> curl -X PUT --header 'If-Match:\"95058446\"' --data @- --dump - http://localhost:8529/_api/document/products/94730766?policy=last\n{}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"95255054\"\nlocation: /_api/document/products/94730766\n\n{ \n \"error\" : false, \n \"_id\" : \"products/94730766\", \n \"_rev\" : \"95255054\", \n \"_key\" : \"94730766\" \n}\n\n</code></pre><br>Alternative to header field: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/document/products/150501902?rev=150960654\n{\"other\":\"content\"}\n\nHTTP/1.1 412 Precondition Failed\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 412, \n \"errorNum\" : 1200, \n \"errorMessage\" : \"precondition failed\", \n \"_id\" : \"products/150501902\", \n \"_rev\" : \"150501902\", \n \"_key\" : \"150501902\" \n}\n\n</code></pre><br>",
|
||||
"nickname": "replacesADocument"
|
||||
}
|
||||
],
|
||||
"path": "/_api/document/{document-handle}"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the document was created sucessfully and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the document was created sucessfully and <em>waitForSync</em> was <em>false</em>. ",
|
||||
"code": "202"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if collection or the document was not found ",
|
||||
"code": "404"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the found document has a different version ",
|
||||
"code": "412"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "document-handle",
|
||||
"description": "The Handle of the Document. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "keepNull",
|
||||
"description": "If the intention is to delete existing attributes with the patch command, the URL query parameter <em>keepNull</em> can be used with a value of <em>false</em>. This will modify the behavior of the patch command to remove any attributes from the existing document that are contained in the patch document with an attribute value of <em>null</em>. "
|
||||
},
|
||||
{
|
||||
"dataType": "Boolean",
|
||||
"paramType": "query",
|
||||
"name": "waitForSync",
|
||||
"description": "Wait until document has been sync to disk. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "rev",
|
||||
"description": "You can conditionally patch a document based on a target revision id by using the <em>rev</em> URL parameter. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "policy",
|
||||
"description": "To control the update behavior in case there is a revision mismatch, you can use the <em>policy</em> parameter. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "If-Match",
|
||||
"description": "You can conditionally delete a document based on a target revision id by using the <em>if-match</em> HTTP header. "
|
||||
}
|
||||
],
|
||||
"notes": "Partially updates the document identified by <em>document-handle</em>. The body of the request must contain a JSON document with the attributes to patch (the patch document). All attributes from the patch document will be added to the existing document if they do not yet exist, and overwritten in the existing document if they do exist there. <br><br>Setting an attribute value to <em>null</em> in the patch document will cause a value of <em>null</em> be saved for the attribute by default. <br><br>Optionally, the URL parameter <em>waitForSync</em> can be used to force synchronisation of the document update operation to disk even in case that the <em>waitForSync</em> flag had been disabled for the entire collection. Thus, the <em>waitForSync</em> URL parameter can be used to force synchronisation of just specific operations. To use this, set the <em>waitForSync</em> parameter to <em>true</em>. If the <em>waitForSync</em> parameter is not specified or set to <em>false</em>, then the collection's default <em>waitForSync</em> behavior is applied. The <em>waitForSync</em> URL parameter cannot be used to disable synchronisation for collections that have a default <em>waitForSync</em> value of <em>true</em>. <br><br>The body of the response contains a JSON object with the information about the handle and the revision. The attribute <em>_id</em> contains the known <em>document-handle</em> of the updated document, the attribute <em>_rev</em> contains the new document revision. <br><br>If the document does not exist, then a <em>HTTP 404</em> is returned and the body of the response contains an error document. <br><br>You can conditionally update a document based on a target revision id by using either the <em>rev</em> URL parameter or the <em>if-match</em> HTTP header. To control the update behavior in case there is a revision mismatch, you can use the <em>policy</em> parameter. This is the same as when replacing documents (see replacing documents for details). <br><br>",
|
||||
"summary": "patches a document",
|
||||
"httpMethod": "PATCH",
|
||||
"examples": "patches an existing document with new content. <br><br><pre><code class=\"json\" >unix> curl -X PATCH --data @- --dump - http://localhost:8529/_api/document/products/92109326\n{\"hello\":\"world\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"92568078\"\nlocation: /_api/document/products/92109326\n\n{ \n \"error\" : false, \n \"_id\" : \"products/92109326\", \n \"_rev\" : \"92568078\", \n \"_key\" : \"92109326\" \n}\n\nunix> curl -X PATCH --data @- --dump - http://localhost:8529/_api/document/products/92109326\n{\"numbers\":{\"one\":1,\"two\":2,\"three\":3,\"empty\":null}}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"93092366\"\nlocation: /_api/document/products/92109326\n\n{ \n \"error\" : false, \n \"_id\" : \"products/92109326\", \n \"_rev\" : \"93092366\", \n \"_key\" : \"92109326\" \n}\n\nunix> curl --dump - http://localhost:8529/_api/document/products/92109326\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"93092366\"\n\n{ \n \"one\" : \"world\", \n \"hello\" : \"world\", \n \"numbers\" : { \n \"empty\" : null, \n \"one\" : 1, \n \"two\" : 2, \n \"three\" : 3 \n }, \n \"_id\" : \"products/92109326\", \n \"_rev\" : \"93092366\", \n \"_key\" : \"92109326\" \n}\n\nunix> curl -X PATCH --data @- --dump - http://localhost:8529/_api/document/products/92109326?keepNull=false\n{\"hello\":null,\"numbers\":{\"four\":4}}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"93485582\"\nlocation: /_api/document/products/92109326\n\n{ \n \"error\" : false, \n \"_id\" : \"products/92109326\", \n \"_rev\" : \"93485582\", \n \"_key\" : \"92109326\" \n}\n\nunix> curl --dump - http://localhost:8529/_api/document/products/92109326\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"93485582\"\n\n{ \n \"one\" : \"world\", \n \"numbers\" : { \n \"empty\" : null, \n \"one\" : 1, \n \"two\" : 2, \n \"three\" : 3, \n \"four\" : 4 \n }, \n \"_id\" : \"products/92109326\", \n \"_rev\" : \"93485582\", \n \"_key\" : \"92109326\" \n}\n\n</code></pre><br>",
|
||||
"nickname": "patchesADocument"
|
||||
}
|
||||
],
|
||||
"path": "/_api/document/{document-handle}"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the document was deleted sucessfully and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the document was deleted sucessfully and <em>waitForSync</em> was <em>false</em>. ",
|
||||
"code": "202"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the collection or the document was not found. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the current document has a different version ",
|
||||
"code": "412"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "document-handle",
|
||||
"description": "Deletes the document identified by <em>document-handle</em>. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "rev",
|
||||
"description": "You can conditionally delete a document based on a target revision id by using the <em>rev</em> URL parameter. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "policy",
|
||||
"description": "To control the update behavior in case there is a revision mismatch, you can use the <em>policy</em> parameter. This is the same as when replacing documents (see replacing documents for more details). "
|
||||
},
|
||||
{
|
||||
"dataType": "Boolean",
|
||||
"paramType": "query",
|
||||
"name": "waitForSync",
|
||||
"description": "Wait until document has been sync to disk. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "If-Match",
|
||||
"description": "You can conditionally delete a document based on a target revision id by using the <em>if-match</em> HTTP header. "
|
||||
}
|
||||
],
|
||||
"notes": "The body of the response contains a JSON object with the information about the handle and the revision. The attribute <em>_id</em> contains the known <em>document-handle</em> of the updated document, the attribute <em>_rev</em> contains the known document revision. <br><br>If the <em>waitForSync</em> parameter is not specified or set to <em>false</em>, then the collection's default <em>waitForSync</em> behavior is applied. The <em>waitForSync</em> URL parameter cannot be used to disable synchronisation for collections that have a default <em>waitForSync</em> value of <em>true</em>. <br><br>",
|
||||
"summary": "deletes a document",
|
||||
"httpMethod": "DELETE",
|
||||
"examples": "Using document handle: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/document/products/53574158\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : false, \n \"_id\" : \"products/53574158\", \n \"_rev\" : \"53574158\", \n \"_key\" : \"53574158\" \n}\n\n</code></pre><br>Unknown document handle: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/document/products/78608910\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"document /_api/document/products/78608910 not found\", \n \"code\" : 404, \n \"errorNum\" : 1202 \n}\n\n</code></pre><br>Revision conflict: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --header 'If-Match:\"96762382\"' --dump - http://localhost:8529/_api/document/products/96303630\n\nHTTP/1.1 412 Precondition Failed\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 412, \n \"errorNum\" : 1200, \n \"errorMessage\" : \"precondition failed\", \n \"_id\" : \"products/96303630\", \n \"_rev\" : \"96303630\", \n \"_key\" : \"96303630\" \n}\n\n</code></pre><br>",
|
||||
"nickname": "deletesADocument"
|
||||
}
|
||||
],
|
||||
"path": "/_api/document/{document-handle}"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
"basePath": "/",
|
||||
"swaggerVersion": "1.1",
|
||||
"apiVersion": "0.1",
|
||||
"apis": [
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the edge was created successfully. ",
|
||||
"code": "202"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the edge collection was not found. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"required": "True",
|
||||
"name": "collection",
|
||||
"description": "Creates a new edge in the collection identified by <em>collection</em> name. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"required": "True",
|
||||
"name": "from",
|
||||
"description": "The document handle of the start point must be passed in <em>from</em> handle. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"required": "True",
|
||||
"name": "to",
|
||||
"description": "The document handle of the end point must be passed in <em>to</em> handle. "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "edge-document",
|
||||
"description": "A JSON representation of the edge document must be passed as the body of the POST request. This JSON object may contain the edge's document key in the <em>_key</em> attribute if needed. "
|
||||
}
|
||||
],
|
||||
"notes": "<em>from</em> handle and <em>to</em> handle are immutable once the edge has been created. <br><br>In all other respects the method works like <em>POST /document</em>, see @ref RestDocument for details. <br><br>",
|
||||
"summary": "creates an edge",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Create an edge and reads it back: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/edge/?collection=edges&from=vertices/1&to=vertices/2\n{\"name\":\"Emil\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: \"193427982\"\nlocation: /_api/document/edges/193427982\n\n{ \n \"error\" : false, \n \"_id\" : \"edges/193427982\", \n \"_rev\" : \"193427982\", \n \"_key\" : \"193427982\" \n}\n\nunix> curl --dump - http://localhost:8529/_api/edge/edges/193427982\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: \"193427982\"\n\n{ \n \"name\" : \"Emil\", \n \"_id\" : \"edges/193427982\", \n \"_rev\" : \"193427982\", \n \"_key\" : \"193427982\", \n \"_from\" : \"vertices/1\", \n \"_to\" : \"vertices/2\" \n}\n\n</code></pre><br>",
|
||||
"nickname": "createsAnEdge"
|
||||
}
|
||||
],
|
||||
"path": "/_api/edge"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"basePath": "/",
|
||||
"swaggerVersion": "1.1",
|
||||
"apiVersion": "0.1",
|
||||
"apis": [
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "collection-id",
|
||||
"description": "The id of the collection. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"required": "True",
|
||||
"name": "vertex",
|
||||
"description": "The id of the start vertex. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "direction",
|
||||
"description": "Selects <em>in</em> or <em>out</em> direction for edges. If not set, any edges are returned. "
|
||||
}
|
||||
],
|
||||
"notes": "Returns the list of edges starting or ending in the vertex identified by <em>vertex-handle</em>. <br><br>",
|
||||
"summary": "reads in- or outbound edges",
|
||||
"httpMethod": "GET",
|
||||
"examples": "Any direction <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/edges/edges?vertex=vertices/1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"edges\" : [ \n { \n \"_id\" : \"edges/6\", \n \"_rev\" : \"222263822\", \n \"_key\" : \"6\", \n \"_from\" : \"vertices/2\", \n \"_to\" : \"vertices/1\", \n \"$label\" : \"v2 -> v1\" \n }, \n { \n \"_id\" : \"edges/7\", \n \"_rev\" : \"222788110\", \n \"_key\" : \"7\", \n \"_from\" : \"vertices/4\", \n \"_to\" : \"vertices/1\", \n \"$label\" : \"v4 -> v1\" \n }, \n { \n \"_id\" : \"edges/5\", \n \"_rev\" : \"221739534\", \n \"_key\" : \"5\", \n \"_from\" : \"vertices/1\", \n \"_to\" : \"vertices/3\", \n \"$label\" : \"v1 -> v3\" \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>In edges <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/edges/edges?vertex=vertices/1&direction=in\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"edges\" : [ \n { \n \"_id\" : \"edges/6\", \n \"_rev\" : \"156989966\", \n \"_key\" : \"6\", \n \"_from\" : \"vertices/2\", \n \"_to\" : \"vertices/1\", \n \"$label\" : \"v2 -> v1\" \n }, \n { \n \"_id\" : \"edges/7\", \n \"_rev\" : \"157514254\", \n \"_key\" : \"7\", \n \"_from\" : \"vertices/4\", \n \"_to\" : \"vertices/1\", \n \"$label\" : \"v4 -> v1\" \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Out edges <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/edges/edges?vertex=vertices/1&direction=out\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"edges\" : [ \n { \n \"_id\" : \"edges/5\", \n \"_rev\" : \"122190350\", \n \"_key\" : \"5\", \n \"_from\" : \"vertices/1\", \n \"_to\" : \"vertices/3\", \n \"$label\" : \"v1 -> v3\" \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "readsIn-OrOutboundEdges"
|
||||
}
|
||||
],
|
||||
"path": "/_api/edges/{collection-id}"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"basePath": "/",
|
||||
"swaggerVersion": "1.1",
|
||||
"apiVersion": "0.1",
|
||||
"apis": [
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the query is valid, the server will respond with <em>HTTP 200</em> and return a list of the individual query execution steps in the <em>\"plan\"</em> attribute of the response. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "The server will respond with <em>HTTP 400</em> in case of a malformed request, or if the query contains a parse error. The body of the response will contain the error details embedded in a JSON object. Omitting bind variables if the query references any will result also result in an <em>HTTP 400</em> error. ",
|
||||
"code": "400"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "body",
|
||||
"description": "The query string needs to be passed in the attribute <em>query</em> of a JSON object as the body of the POST request. If the query references any bind variables, these must also be passed in the attribute <em>bindVars</em>. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>To explain how an AQL query would be executed on the server, the query string can be sent to the server via an HTTP POST request. The server will then validate the query and create an execution plan for it, but will not execute it. <br><br>The execution plan that is returned by the server can be used to estimate the probable performance of an AQL query. Though the actual performance will depend on many different factors, the execution plan normally can give some good hint on the amount of work the server needs to do in order to actually run the query. <br><br>The top-level statements will appear in the result in the same order in which they have been used in the original query. Each result element has at most the following attributes: - <em>id</em>: the row number of the top-level statement, starting at 1<br>- <em>type</em>: the type of the top-level statement (e.g. <em>for</em>, <em>return</em> ...)<br>- <em>loopLevel</em>: the nesting level of the top-level statement, starting at 1<br>Depending on the type of top-level statement, there might be other attributes providing additional information, for example, if and which indexed will be used. Many top-level statements will provide an <em>expression</em> attribute that contains data about the expression they operate on. This is true for <em>FOR</em>, <em>FILTER</em>, <em>SORT</em>, <em>COLLECT</em>, and <em>RETURN</em> statements. The <em>expression</em> attribute has the following sub-attributes: - <em>type</em>: the type of the expression. Some possible values are:<br> - <em>collection</em>: an iteration over documents from a collection. The <em>value</em> attribute will then contain the collection name. The <em>extra</em> attribute will contain information about if and which index is used when accessing the documents from the collection. If no index is used, the <em>accessType</em> sub-attribute of the <em>extra</em> attribute will have the value <em>all</em>, otherwise it will be <em>index</em>. - <em>list</em>: a list of dynamic values. The <em>value</em> attribute will contain the list elements. - <em>const list</em>: a list of constant values. The <em>value</em> attribute will contain the list elements. - <em>reference</em>: a reference to another variable. The <em>value</em> attribute will contain the name of the variable that is referenced. <br><br>Please note that the structure of the explain result data might change in future versions of ArangoDB without further notice and without maintaining backwards compatibility. <br><br>",
|
||||
"summary": "explains a query",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Valid query: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/explain\n{ \"query\" : \"FOR p IN products FILTER p.id == @id LIMIT 2 RETURN p.name\", \"bindVars\": { \"id\" : 3 } }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"plan\" : [ \n { \n \"id\" : 1, \n \"loopLevel\" : 1, \n \"type\" : \"for\", \n \"resultVariable\" : \"p\", \n \"limit\" : true, \n \"expression\" : { \n \"type\" : \"collection\", \n \"value\" : \"products\", \n \"extra\" : { \n \"accessType\" : \"all\" \n } \n } \n }, \n { \n \"id\" : 2, \n \"loopLevel\" : 1, \n \"type\" : \"filter\", \n \"expression\" : { \n \"type\" : \"expression\", \n \"value\" : \"p.id == 3\" \n } \n }, \n { \n \"id\" : 3, \n \"loopLevel\" : 1, \n \"type\" : \"return\", \n \"expression\" : { \n \"type\" : \"expression\", \n \"value\" : \"p.name\" \n } \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Invalid query: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/explain\n{ \"query\" : \"FOR p IN products FILTER p.id == @id LIMIT 2 RETURN p.n\" }\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1551, \n \"errorMessage\" : \"no value specified for declared bind parameter 'id'\" \n}\n\n</code></pre><br>The data returned in the <em>plan</em> attribute of the result contains one element per AQL top-level statement (i.e. <em>FOR</em>, <em>RETURN</em>, <em>FILTER</em> etc.). If the query optimiser removed some unnecessary statements, the result might also contain less elements than there were top-level statements in the AQL query. The following example shows a query with a non-sensible filter condition that the optimiser has removed so that there are less top-level statements: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/explain\n{ \"query\" : \"FOR i IN [ 1, 2, 3 ] FILTER 1 == 2 RETURN i\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"plan\" : [ \n { \n \"id\" : 1, \n \"loopLevel\" : 0, \n \"type\" : \"return (empty)\", \n \"expression\" : { \n \"type\" : \"const list\", \n \"value\" : \"[ ]\" \n } \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "explainsAQuery"
|
||||
}
|
||||
],
|
||||
"path": "/_api/explain"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,871 @@
|
|||
{
|
||||
"basePath": "/",
|
||||
"swaggerVersion": "1.1",
|
||||
"apiVersion": "0.1",
|
||||
"apis": [
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the graph was created sucessfully and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the graph was created sucessfully and <em>waitForSync</em> was <em>false</em>. ",
|
||||
"code": "202"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if it failed. The response body contains an error document in this case. ",
|
||||
"code": "400"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "Boolean",
|
||||
"paramType": "query",
|
||||
"name": "waitForSync",
|
||||
"description": "Wait until document has been sync to disk. "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "graph",
|
||||
"description": "The call expects a JSON hash array as body with the following attributes: <em>_key</em>: The name of the new graph. <em>vertices</em>: The name of the vertices collection. <em>edges</em>: The name of the egde collection. "
|
||||
}
|
||||
],
|
||||
"notes": "Creates a new graph. <br><br>Returns an object with an attribute <em>graph</em> containing a list of all graph properties. <br><br>",
|
||||
"summary": "create graph",
|
||||
"httpMethod": "POST",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/graph/\n{\"_key\":\"graph\",\"vertices\":\"vertices\",\"edges\":\"edges\"}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\netag: 229079566\n\n{ \n \"graph\" : { \n \"_id\" : \"_graphs/graph\", \n \"_rev\" : \"229079566\", \n \"_key\" : \"graph\", \n \"edges\" : \"edges\", \n \"vertices\" : \"vertices\" \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "createGraph"
|
||||
}
|
||||
],
|
||||
"path": "/_api/graph"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the graph was found ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the graph was not found. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
},
|
||||
{
|
||||
"reason": "\"If-None-Match\" header is given and the current graph has not a different version ",
|
||||
"code": "304"
|
||||
},
|
||||
{
|
||||
"reason": "\"If-Match\" header or <em>rev</em> is given and the current graph has a different version ",
|
||||
"code": "412"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "If-None-Match",
|
||||
"description": "If the \"If-None-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has a different revision than the given etag. Otherwise a <em>HTTP 304</em> is returned. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "If-Match",
|
||||
"description": "If the \"If-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has the same revision ad the given etag. Otherwise a <em>HTTP 412</em> is returned. As an alternative you can supply the etag in an attribute <em>rev</em> in the URL. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Returns an object with an attribute <em>graph</em> containing a list of all graph properties. <br><br>",
|
||||
"summary": "get graph properties",
|
||||
"httpMethod": "GET",
|
||||
"examples": "get graph by name <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/graph/graph\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 215185934\n\n{ \n \"graph\" : { \n \"_id\" : \"_graphs/graph\", \n \"_rev\" : \"215185934\", \n \"_key\" : \"graph\", \n \"edges\" : \"edges\", \n \"vertices\" : \"vertices\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "getGraphProperties"
|
||||
}
|
||||
],
|
||||
"path": "/_api/graph/{graph-name}"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the graph was deleted and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the graph was deleted and <em>waitForSync</em> was <em>false</em>. ",
|
||||
"code": "202"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the graph was not found. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
},
|
||||
{
|
||||
"reason": "\"If-Match\" header or <em>rev</em> is given and the current graph has a different version ",
|
||||
"code": "412"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "If-Match",
|
||||
"description": "If the \"If-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has the same revision ad the given etag. Otherwise a <em>HTTP 412</em> is returned. As an alternative you can supply the etag in an attribute <em>rev</em> in the URL. "
|
||||
}
|
||||
],
|
||||
"notes": "Deletes graph, edges and vertices <br><br>",
|
||||
"summary": "delete graph",
|
||||
"httpMethod": "DELETE",
|
||||
"examples": "delete graph by name <br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/graph/graph\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "deleteGraph"
|
||||
}
|
||||
],
|
||||
"path": "/_api/graph/{graph-name}"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the graph was created sucessfully and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the graph was created sucessfully and <em>waitForSync</em> was <em>false</em>. ",
|
||||
"code": "202"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "Boolean",
|
||||
"paramType": "query",
|
||||
"name": "waitForSync",
|
||||
"description": "Wait until document has been sync to disk. "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "vertex",
|
||||
"description": "The call expects a JSON hash array as body with the vertex properties: - <em>_key</em>: The name of the vertex (optional). - further optional attributes. "
|
||||
}
|
||||
],
|
||||
"notes": "Creates a vertex in a graph. <br><br>Returns an object with an attribute <em>vertex</em> containing a list of all vertex properties. <br><br>",
|
||||
"summary": "create vertex",
|
||||
"httpMethod": "POST",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/graph/graph/vertex\n{\"_key\":\"v1\",\"optional1\":\"val1\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 205421070\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"205421070\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
|
||||
"nickname": "createVertex"
|
||||
}
|
||||
],
|
||||
"path": "/_api/graph/{graph-name}/vertex"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the graph was found ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "\"If-Match\" header is given and the current graph has not a different version ",
|
||||
"code": "304"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the graph or vertex was not found. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
},
|
||||
{
|
||||
"reason": "\"If-None-Match\" header or <em>rev</em> is given and the current graph has a different version ",
|
||||
"code": "412"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "rev",
|
||||
"description": "Revision of a vertex "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "If-None-Match",
|
||||
"description": "If the \"If-None-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has a different revision than the given etag. Otherwise a <em>HTTP 304</em> is returned. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "If-Match",
|
||||
"description": "If the \"If-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has the same revision ad the given etag. Otherwise a <em>HTTP 412</em> is returned. As an alternative you can supply the etag in an attribute <em>rev</em> in the URL. "
|
||||
}
|
||||
],
|
||||
"notes": "Returns an object with an attribute <em>vertex</em> containing a list of all vertex properties. <br><br>",
|
||||
"summary": "get vertex",
|
||||
"httpMethod": "GET",
|
||||
"examples": "get vertex properties by name <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 196377102\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"196377102\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "getVertex"
|
||||
}
|
||||
],
|
||||
"path": "/_api/graph/{graph-name}/vertex"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the vertex was deleted and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the vertex was deleted and <em>waitForSync</em> was <em>false</em>. ",
|
||||
"code": "202"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the graph or the vertex was not found. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
},
|
||||
{
|
||||
"reason": "\"If-Match\" header or <em>rev</em> is given and the current vertex has a different version ",
|
||||
"code": "412"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "Boolean",
|
||||
"paramType": "query",
|
||||
"name": "waitForSync",
|
||||
"description": "Wait until document has been sync to disk. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "rev",
|
||||
"description": "Revision of a vertex "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "If-Match",
|
||||
"description": "If the \"If-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has the same revision ad the given etag. Otherwise a <em>HTTP 412</em> is returned. As an alternative you can supply the etag in an attribute <em>rev</em> in the URL. "
|
||||
}
|
||||
],
|
||||
"notes": "Deletes vertex and all in and out edges of the vertex <br><br>",
|
||||
"summary": "delete vertex",
|
||||
"httpMethod": "DELETE",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : true, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
|
||||
"nickname": "deleteVertex"
|
||||
}
|
||||
],
|
||||
"path": "/_api/graph/{graph-name}/vertex"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the vertex was updated sucessfully and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the vertex was updated sucessfully and <em>waitForSync</em> was <em>false</em>. ",
|
||||
"code": "202"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the graph or the vertex was not found. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
},
|
||||
{
|
||||
"reason": "\"If-Match\" header or <em>rev</em> is given and the current vertex has a different version ",
|
||||
"code": "412"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "Boolean",
|
||||
"paramType": "query",
|
||||
"name": "waitForSync",
|
||||
"description": "Wait until vertex has been sync to disk. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "rev",
|
||||
"description": "Revision of a vertex "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "vertex",
|
||||
"description": "The call expects a JSON hash array as body with the new vertex properties. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "if-match",
|
||||
"description": "If the \"If-Match\" header is given, then it must contain exactly one etag. The document is updated, if it has the same revision ad the given etag. Otherwise a <em>HTTP 412</em> is returned. As an alternative you can supply the etag in an attribute <em>rev</em> in the URL. "
|
||||
}
|
||||
],
|
||||
"notes": "Replaces the vertex properties. <br><br>Returns an object with an attribute <em>vertex</em> containing a list of all vertex properties. <br><br>",
|
||||
"summary": "update vertex",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n{\"optional1\":\"val2\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 111180302\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"111180302\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val2\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
|
||||
"nickname": "updateVertex"
|
||||
}
|
||||
],
|
||||
"path": "/_api/graph/{graph-name}/vertex"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the vertex was updated sucessfully and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the vertex was updated sucessfully and <em>waitForSync</em> was <em>false</em>. ",
|
||||
"code": "202"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the graph or the vertex was not found. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
},
|
||||
{
|
||||
"reason": "\"If-Match\" header or <em>rev</em> is given and the current vertex has a different version ",
|
||||
"code": "412"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "Boolean",
|
||||
"paramType": "query",
|
||||
"name": "waitForSync",
|
||||
"description": "Wait until vertex has been sync to disk. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "rev",
|
||||
"description": "Revision of a vertex "
|
||||
},
|
||||
{
|
||||
"dataType": "Boolean",
|
||||
"paramType": "query",
|
||||
"name": "keepNull",
|
||||
"description": "Modify the behavior of the patch command to remove any attribute "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "graph",
|
||||
"description": "The call expects a JSON hash array as body with the properties to patch. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "if-match",
|
||||
"description": "If the \"If-Match\" header is given, then it must contain exactly one etag. The document is updated, if it has the same revision ad the given etag. Otherwise a <em>HTTP 412</em> is returned. As an alternative you can supply the etag in an attribute <em>rev</em> in the URL. "
|
||||
}
|
||||
],
|
||||
"notes": "Partially updates the vertex properties. <br><br>Setting an attribute value to <em>null</em> in the patch document will cause a value of <em>null</em> be saved for the attribute by default. If the intention is to delete existing attributes with the patch command, the URL parameter <em>keepNull</em> can be used with a value of <em>false</em>. This will modify the behavior of the patch command to remove any attributes from the existing document that are contained in the patch document with an attribute value of <em>null</em>. Returns an object with an attribute <em>vertex</em> containing a list of all vertex properties. <br><br>",
|
||||
"summary": "update vertex",
|
||||
"httpMethod": "PATCH",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PATCH --data @- --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n{\"optional1\":\"vertexPatch\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 51608078\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"51608078\", \n \"_key\" : \"v1\", \n \"optional1\" : \"vertexPatch\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\nunix> curl -X PATCH --data @- --dump - http://localhost:8529/_api/graph/graph/vertex/v1\n{\"optional1\":null}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 52132366\n\n{ \n \"vertex\" : { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"52132366\", \n \"_key\" : \"v1\", \n \"optional1\" : null \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
|
||||
"nickname": "updateVertex"
|
||||
}
|
||||
],
|
||||
"path": "/_api/graph/{graph-name}/vertex"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the cursor was created ",
|
||||
"code": "201"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "filter",
|
||||
"description": "The call expects a JSON hash array as body to filter the result: "
|
||||
}
|
||||
],
|
||||
"notes": "Returns a cursor. <br><br>The call expects a JSON hash array as body to filter the result: <br><br>- <em>batchSize</em>: the batch size of the returned cursor<br>- <em>limit</em>: limit the result size<br>- <em>count</em>: return the total number of results (default \"false\")<br>- <em>filter</em>: a optional filter<br><br>The attributes of filter - <em>properties</em>: filter by an array of vertex properties<br><br>The attributes of a property filter - <em>key</em>: filter the result vertices by a key value pair<br>- <em>value</em>: the value of the <em>key</em><br>- <em>compare</em>: a compare operator<br><br>",
|
||||
"summary": "get vertices",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Select all vertices <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/graph/graph/vertices\n{\"batchSize\":100}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"vertices/v5\", \n \"_rev\" : \"44661262\", \n \"_key\" : \"v5\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v4\", \n \"_rev\" : \"44399118\", \n \"_key\" : \"v4\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"43612686\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v3\", \n \"_rev\" : \"44136974\", \n \"_key\" : \"v3\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v2\", \n \"_rev\" : \"43874830\", \n \"_key\" : \"v2\", \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "getVertices"
|
||||
}
|
||||
],
|
||||
"path": "/_api/graph/{graph-name}/vertices"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the cursor was created ",
|
||||
"code": "201"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "graph",
|
||||
"description": "The call expects a JSON hash array as body to filter the result: "
|
||||
}
|
||||
],
|
||||
"notes": "Returns a cursor. <br><br>The call expects a JSON hash array as body to filter the result: <br><br>- <em>batchSize</em>: the batch size of the returned cursor<br>- <em>limit</em>: limit the result size<br>- <em>count</em>: return the total number of results (default \"false\")<br>- <em>filter</em>: a optional filter<br><br>The attributes of filter - <em>direction</em>: Filter for inbound (value \"in\") or outbound (value \"out\")<br> neighbors. Default value is \"any\". - <em>labels</em>: filter by an array of edge labels (empty array means no restriction)<br>- <em>properties</em>: filter neighbors by an array of edge properties<br><br>The attributes of a property filter - <em>key</em>: filter the result vertices by a key value pair<br>- <em>value</em>: the value of the <em>key</em><br>- <em>compare</em>: a compare operator<br><br>",
|
||||
"summary": "get vertices",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Select all vertices <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/graph/graph/vertices/v2\n{\"batchSize\" : 100, \"filter\" : {\"direction\" : \"any\", \"properties\":[] }}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"87063054\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"vertices/v4\", \n \"_rev\" : \"87849486\", \n \"_key\" : \"v4\", \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Select vertices by direction and property filter <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/graph/graph/vertices/v2\n{\"batchSize\" : 100, \"filter\" : {\"direction\" : \"out\", \"properties\":[ { \"key\": \"optional1\", \"value\": \"val2\", \"compare\" : \"==\" }, ] }}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"vertices/v4\", \n \"_rev\" : \"144996878\", \n \"_key\" : \"v4\", \n \"optional1\" : \"val2\" \n }, \n { \n \"_id\" : \"vertices/v1\", \n \"_rev\" : \"144210446\", \n \"_key\" : \"v1\", \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "getVertices"
|
||||
}
|
||||
],
|
||||
"path": "/_api/graph/{graph-name}/vertices/{vertice-name}"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the edge was created sucessfully and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the edge was created sucessfully and <em>waitForSync</em> was <em>false</em>. ",
|
||||
"code": "202"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "Boolean",
|
||||
"paramType": "query",
|
||||
"name": "waitForSync",
|
||||
"description": "Wait until edge has been sync to disk. "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "edge",
|
||||
"description": "The call expects a JSON hash array as body with the edge properties: "
|
||||
}
|
||||
],
|
||||
"notes": "Creates an edge in a graph. <br><br>The call expects a JSON hash array as body with the edge properties: <br><br>- <em>_key</em>: The name of the edge.<br>- <em>_from</em>: The name of the from vertex.<br>- <em>_to</em>: The name of the to vertex.<br>- <em>$label</em>: A label for the edge (optional).<br>- further optional attributes.<br><br>Returns an object with an attribute <em>edge</em> containing the list of all edge properties. <br><br>",
|
||||
"summary": "create edge",
|
||||
"httpMethod": "POST",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/graph/graph/edge\n{\"_key\":\"edge1\",\"_from\":\"vert2\",\"_to\":\"vert1\",\"optional1\":\"val1\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 131234318\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"131234318\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/vert2\", \n \"_to\" : \"vertices/vert1\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
|
||||
"nickname": "createEdge"
|
||||
}
|
||||
],
|
||||
"path": "/_api/graph/{graph-name}/edge"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the edge was found ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "\"If-Match\" header is given and the current edge has not a different version ",
|
||||
"code": "304"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the graph or edge was not found. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
},
|
||||
{
|
||||
"reason": "\"If-None-Match\" header or <em>rev</em> is given and the current edge has a different version ",
|
||||
"code": "412"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "rev",
|
||||
"description": "Revision of an edge "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "if-none-match",
|
||||
"description": "If the \"If-None-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has a different revision than the given etag. Otherwise a <em>HTTP 304</em> is returned. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "if-match",
|
||||
"description": "If the \"If-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has the same revision ad the given etag. Otherwise a <em>HTTP 412</em> is returned. As an alternative you can supply the etag in an attribute <em>rev</em> in the URL. "
|
||||
}
|
||||
],
|
||||
"notes": "Returns an object with an attribute <em>edge</em> containing a list of all edge properties. <br><br>",
|
||||
"summary": "get edge",
|
||||
"httpMethod": "GET",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/graph/graph/edge/edge1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\netag: 127171086\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"127171086\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/vert1\", \n \"_to\" : \"vertices/vert2\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "getEdge"
|
||||
}
|
||||
],
|
||||
"path": "/_api/graph/{graph-name}/edge"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the edge was deletd sucessfully and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the edge was deleted sucessfully and <em>waitForSync</em> was <em>false</em>. ",
|
||||
"code": "202"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the graph or the edge was not found. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
},
|
||||
{
|
||||
"reason": "\"If-Match\" header or <em>rev</em> is given and the current edge has a different version ",
|
||||
"code": "412"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "Boolean",
|
||||
"paramType": "query",
|
||||
"name": "waitForSync",
|
||||
"description": "Wait until edge has been sync to disk. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "rev",
|
||||
"description": "Revision of an edge "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "if-match",
|
||||
"description": "If the \"If-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has the same revision ad the given etag. Otherwise a <em>HTTP 412</em> is returned. As an alternative you can supply the etag in an attribute <em>rev</em> in the URL. "
|
||||
}
|
||||
],
|
||||
"notes": "Deletes an edge of the graph <br><br>",
|
||||
"summary": "delete edge",
|
||||
"httpMethod": "DELETE",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/graph/graph/edge/edge1\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : true, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
|
||||
"nickname": "deleteEdge"
|
||||
}
|
||||
],
|
||||
"path": "/_api/graph/{graph-name}/edge"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the edge was updated sucessfully and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the edge was updated sucessfully and <em>waitForSync</em> was <em>false</em>. ",
|
||||
"code": "202"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the graph or the edge was not found. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
},
|
||||
{
|
||||
"reason": "\"If-Match\" header or <em>rev</em> is given and the current edge has a different version ",
|
||||
"code": "412"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "Boolean",
|
||||
"paramType": "query",
|
||||
"name": "waitForSync",
|
||||
"description": "Wait until edge has been sync to disk. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "rev",
|
||||
"description": "Revision of an edge "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "edge",
|
||||
"description": "The call expects a JSON hash array as body with the new edge properties. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "if-match",
|
||||
"description": "If the \"If-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has the same revision ad the given etag. Otherwise a <em>HTTP 412</em> is returned. As an alternative you can supply the etag in an attribute <em>rev</em> in the URL. "
|
||||
}
|
||||
],
|
||||
"notes": "Replaces the optional edge properties. <br><br>The call expects a JSON hash array as body with the new edge properties. <br><br>Returns an object with an attribute <em>edge</em> containing a list of all edge properties. <br><br>",
|
||||
"summary": "update edge",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/graph/graph/edge/edge1\n{\"optional1\":\"val2\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 104888846\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"104888846\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/vert1\", \n \"_to\" : \"vertices/vert2\", \n \"$label\" : null, \n \"optional1\" : \"val2\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
|
||||
"nickname": "updateEdge"
|
||||
}
|
||||
],
|
||||
"path": "/_api/graph/{graph-name}/edge"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the edge was updated sucessfully and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the edge was updated sucessfully and <em>waitForSync</em> was <em>false</em>. ",
|
||||
"code": "202"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the graph or the edge was not found. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
},
|
||||
{
|
||||
"reason": "\"If-Match\" header or <em>rev</em> is given and the current edge has a different version ",
|
||||
"code": "412"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "Boolean",
|
||||
"paramType": "query",
|
||||
"name": "waitForSync",
|
||||
"description": "Wait until edge has been sync to disk. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"name": "rev",
|
||||
"description": "Revision of an edge "
|
||||
},
|
||||
{
|
||||
"dataType": "Boolean",
|
||||
"paramType": "query",
|
||||
"name": "keepNull",
|
||||
"description": "Modify the behavior of the patch command to remove any attribute "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "edge-properties",
|
||||
"description": "The call expects a JSON hash array as body with the properties to patch. "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "header",
|
||||
"name": "if-match",
|
||||
"description": "If the \"If-Match\" header is given, then it must contain exactly one etag. The document is returned, if it has the same revision ad the given etag. Otherwise a <em>HTTP 412</em> is returned. As an alternative you can supply the etag in an attribute <em>rev</em> in the URL. "
|
||||
}
|
||||
],
|
||||
"notes": "Partially updates the edge properties. <br><br>Setting an attribute value to <em>null</em> in the patch document will cause a value of <em>null</em> be saved for the attribute by default. If the intention is to delete existing attributes with the patch command, the URL parameter <em>keepNull</em> can be used with a value of <em>false</em>. This will modify the behavior of the patch command to remove any attributes from the existing document that are contained in the patch document with an attribute value of <em>null</em>. <br><br>Returns an object with an attribute <em>edge</em> containing a list of all edge properties. <br><br>",
|
||||
"summary": "update edge",
|
||||
"httpMethod": "PATCH",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PATCH --data @- --dump - http://localhost:8529/_api/graph/graph/edge/edge1\n{\"optional3\":\"val3\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 171145742\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"171145742\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/vert1\", \n \"_to\" : \"vertices/vert2\", \n \"$label\" : null, \n \"optional1\" : \"val1\", \n \"optional3\" : \"val3\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
|
||||
"nickname": "updateEdge"
|
||||
}
|
||||
],
|
||||
"path": "/_api/graph/{graph-name}/edge"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the cursor was created ",
|
||||
"code": "201"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "edge-properties",
|
||||
"description": "The call expects a JSON hash array as body to filter the result: "
|
||||
}
|
||||
],
|
||||
"notes": "Returns a cursor. <br><br>The call expects a JSON hash array as body to filter the result: <br><br>- <em>batchSize</em>: the batch size of the returned cursor<br>- <em>limit</em>: limit the result size<br>- <em>count</em>: return the total number of results (default \"false\")<br>- <em>filter</em>: a optional filter<br><br>The attributes of filter - <em>labels</em>: filter by an array of edge labels<br>- <em>properties</em>: filter by an array of edge properties<br><br>The attributes of a property filter - <em>key</em>: filter the result edges by a key value pair<br>- <em>value</em>: the value of the <em>key</em><br>- <em>compare</em>: a compare operator<br><br>",
|
||||
"summary": "get edges",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Select all edges <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/graph/graph/edges\n{\"batchSize\":100}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"edges/edge4\", \n \"_rev\" : \"66615822\", \n \"_key\" : \"edge4\", \n \"_from\" : \"vertices/v1\", \n \"_to\" : \"vertices/v5\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"65042958\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/v1\", \n \"_to\" : \"vertices/v2\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"edges/edge2\", \n \"_rev\" : \"65567246\", \n \"_key\" : \"edge2\", \n \"_from\" : \"vertices/v1\", \n \"_to\" : \"vertices/v3\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"edges/edge3\", \n \"_rev\" : \"66091534\", \n \"_key\" : \"edge3\", \n \"_from\" : \"vertices/v2\", \n \"_to\" : \"vertices/v4\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "getEdges"
|
||||
}
|
||||
],
|
||||
"path": "/_api/graph/{graph-name}/edges"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the cursor was created ",
|
||||
"code": "201"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "vertex-name",
|
||||
"description": "The name of the vertex "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "edge-properties",
|
||||
"description": "The call expects a JSON hash array as body to filter the result: "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Returns a cursor. <br><br>The call expects a JSON hash array as body to filter the result: <br><br>- <em>batchSize</em>: the batch size of the returned cursor<br>- <em>limit</em>: limit the result size<br>- <em>count</em>: return the total number of results (default \"false\")<br>- <em>filter</em>: a optional filter<br><br>The attributes of filter - <em>direction</em>: Filter for inbound (value \"in\") or outbound (value \"out\")<br> neighbors. Default value is \"any\". - <em>labels</em>: filter by an array of edge labels<br>- <em>properties</em>: filter neighbors by an array of properties<br><br>The attributes of a property filter - <em>key</em>: filter the result vertices by a key value pair<br>- <em>value</em>: the value of the <em>key</em><br>- <em>compare</em>: a compare operator<br><br>",
|
||||
"summary": "get edges",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Select all edges <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/graph/graph/edges/v2\n{\"batchSize\" : 100, \"filter\" : { \"direction\" : \"any\" }}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"72317454\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/v1\", \n \"_to\" : \"vertices/v2\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n { \n \"_id\" : \"edges/edge3\", \n \"_rev\" : \"73366030\", \n \"_key\" : \"edge3\", \n \"_from\" : \"vertices/v2\", \n \"_to\" : \"vertices/v4\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n } \n ], \n \"hasMore\" : false, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "getEdges"
|
||||
}
|
||||
],
|
||||
"path": "/_api/graph/{graph-name}/edges/{vertex-name}"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,385 @@
|
|||
{
|
||||
"basePath": "/",
|
||||
"swaggerVersion": "1.1",
|
||||
"apiVersion": "0.1",
|
||||
"apis": [
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"required": "True",
|
||||
"name": "collection",
|
||||
"description": "The collection name. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Returns an object with an attribute <em>indexes</em> containing a list of all index descriptions for the given collection. The same information is also available in the <em>identifiers</em> as hash map with the index handle as keys. <br><br>",
|
||||
"summary": "reads all indexes of a collection",
|
||||
"httpMethod": "GET",
|
||||
"examples": "Return information about all indexes: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/index?collection=products\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"indexes\" : [ \n { \n \"id\" : \"products/0\", \n \"type\" : \"primary\", \n \"unique\" : true, \n \"fields\" : [ \n \"_id\" \n ] \n } \n ], \n \"identifiers\" : { \n \"products/0\" : { \n \"id\" : \"products/0\", \n \"type\" : \"primary\", \n \"unique\" : true, \n \"fields\" : [ \n \"_id\" \n ] \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "readsAllIndexesOfACollection"
|
||||
}
|
||||
],
|
||||
"path": "/_api/index"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the index exists, then a <em>HTTP 200</em> is returned. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "If the index does not exist, then a <em>HTTP 404</em> is returned. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "index-handle",
|
||||
"description": "The index-handle. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>The result is an objects describing the index. It has at least the following attributes: <br><br>- <em>id</em>: The identifier of the index.<br><br>- <em>type</em>: The type of the collection.<br><br>All other attributes are type-dependent. <br><br>",
|
||||
"summary": "reads an index",
|
||||
"httpMethod": "GET",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/index/products/0\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/0\", \n \"type\" : \"primary\", \n \"unique\" : true, \n \"fields\" : [ \n \"_id\" \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "readsAnIndex"
|
||||
}
|
||||
],
|
||||
"path": "/_api/index/{index-handle}"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the index already exists, then a <em>HTTP 200</em> is returned. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "If the index does not already exist and could be created, then a <em>HTTP 201</em> is returned. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"required": "True",
|
||||
"name": "collection",
|
||||
"description": "The collection name. "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "cap-constraint",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Creates a cap constraint (@ref IndexCapIntro) for the collection <em>collection-name</em>, if it does not already exist. Expects an object containing the index details. <br><br>- <em>type</em>: must be equal to <em>\"cap\"</em>.<br><br>- <em>size</em>: The maximal number of documents for the collection.<br><br>Note that the cap constraint does not index particular attributes of the documents in a collection, but limits the number of documents in the collection to a maximum value. The cap constraint thus does not support attribute names specified in the <em>fields</em> attribute nor uniqueness of any kind via the <em>unique</em> attribute. <br><br>",
|
||||
"summary": "creates a cap constraint",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Creating a cap collection <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"cap\", \"size\" : 10 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/230324750\", \n \"type\" : \"cap\", \n \"unique\" : false, \n \"size\" : 10, \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "createsACapConstraint"
|
||||
}
|
||||
],
|
||||
"path": "/_api/index"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the index already exists, then a <em>HTTP 200</em> is returned. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "If the index does not already exist and could be created, then a <em>HTTP 201</em> is returned. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"required": "True",
|
||||
"name": "collection",
|
||||
"description": "The collection name. "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "index-details",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Creates a geo-spatial index in the collection <em>collection-name</em>, if it does not already exist. Expects an object containing the index details. <br><br>- <em>type</em>: must be equal to <em>\"geo\"</em>.<br><br>- <em>fields</em>: A list with one or two attribute paths. <br><br> If it is a list with one attribute path <em>location</em>, then a geo-spatial index on all documents is created using <em>location</em> as path to the coordinates. The value of the attribute must be a list with at least two double values. The list must contain the latitude (first value) and the longitude (second value). All documents, which do not have the attribute path or with value that are not suitable, are ignored. <br><br> If it is a list with two attribute paths <em>latitude</em> and <em>longitude</em>, then a geo-spatial index on all documents is created using <em>latitude</em> and <em>longitude</em> as paths the latitude and the longitude. The value of the attribute <em>latitude</em> and of the attribute <em>longitude</em> must a double. All documents, which do not have the attribute paths or which values are not suitable, are ignored. <br><br>- <em>geoJson</em>: If a geo-spatial index on a <em>location</em> is constructed<br> and <em>geoJson</em> is <em>true</em>, then the order within the list is longitude followed by latitude. This corresponds to the format described in http://geojson.org/geojson-spec.html#positions <br><br>- <em>constraint</em>: If <em>constraint</em> is <em>true</em>, then a geo-spatial<br> constraint is created. The constraint is a non-unique variant of the index. Note that it is also possible to set the <em>unique</em> attribute instead of the <em>constraint</em> attribute. <br><br>- <em>ignoreNull</em>: If a geo-spatial constraint is created and<br> <em>ignoreNull</em> is true, then documents with a null in <em>location</em> or at least one null in <em>latitude</em> or <em>longitude</em> are ignored. <br><br>",
|
||||
"summary": "creates a geo-spatial index",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Creating a geo index with a location attribute: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"geo\", \"fields\" : [ \"b\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/233863694\", \n \"type\" : \"geo1\", \n \"unique\" : false, \n \"geoJson\" : false, \n \"constraint\" : false, \n \"fields\" : [ \n \"b\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Creating a geo index with latitude and longitude attributes: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"geo\", \"fields\" : [ \"e\", \"f\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/82016782\", \n \"type\" : \"geo2\", \n \"unique\" : false, \n \"constraint\" : false, \n \"fields\" : [ \n \"e\", \n \"f\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "createsAGeo-spatialIndex"
|
||||
}
|
||||
],
|
||||
"path": "/_api/index"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the index already exists, then a <em>HTTP 200</em> is returned. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "If the index does not already exist and could be created, then a <em>HTTP 201</em> is returned. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "If the collection already contains documents and you try to create a unique hash index in such a way that there are documents violating the uniqueness, then a <em>HTTP 400</em> is returned. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"required": "True",
|
||||
"name": "collection-name",
|
||||
"description": "The collection name. "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "index-details",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Creates a hash index for the collection <em>collection-name</em>, if it does not already exist. The call expects an object containing the index details. <br><br>- <em>type</em>: must be equal to <em>\"hash\"</em>.<br><br>- <em>fields</em>: A list of attribute paths.<br><br>- <em>unique</em>: If <em>true</em>, then create a unique index.<br><br>",
|
||||
"summary": "creates a hash index",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Creating an unique constraint: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"hash\", \"unique\" : true, \"fields\" : [ \"a\", \"b\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/242383374\", \n \"type\" : \"hash\", \n \"unique\" : true, \n \"fields\" : [ \n \"a\", \n \"b\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Creating a hash index: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"hash\", \"unique\" : false, \"fields\" : [ \"a\", \"b\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/246905358\", \n \"type\" : \"hash\", \n \"unique\" : false, \n \"fields\" : [ \n \"a\", \n \"b\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "createsAHashIndex"
|
||||
}
|
||||
],
|
||||
"path": "/_api/index"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the index already exists, then a <em>HTTP 200</em> is returned. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "If the index does not already exist and could be created, then a <em>HTTP 201</em> is returned. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "If the collection already contains documents and you try to create a unique skip-list index in such a way that there are documents violating the uniqueness, then a <em>HTTP 400</em> is returned. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"required": "True",
|
||||
"name": "collection-name",
|
||||
"description": "The collection name. "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "index-details",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Creates a skip-list index for the collection <em>collection-name</em>, if it does not already exist. The call expects an object containing the index details. <br><br>- <em>type</em>: must be equal to <em>\"skiplist\"</em>.<br><br>- <em>fields</em>: A list of attribute paths.<br><br>- <em>unique</em>: If <em>true</em>, then create a unique index.<br><br>",
|
||||
"summary": "creates a skip list",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Creating a skiplist: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"skiplist\", \"unique\" : false, \"fields\" : [ \"a\", \"b\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/132545038\", \n \"type\" : \"skiplist\", \n \"unique\" : false, \n \"fields\" : [ \n \"a\", \n \"b\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "createsASkipList"
|
||||
}
|
||||
],
|
||||
"path": "/_api/index"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the index already exists, then a <em>HTTP 200</em> is returned. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "If the index does not already exist and could be created, then a <em>HTTP 201</em> is returned. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"required": "True",
|
||||
"name": "collection-name",
|
||||
"description": "The collection name. "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "index-details",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Creates a fulltext index for the collection <em>collection-name</em>, if it does not already exist. The call expects an object containing the index details. <br><br>- <em>type</em>: must be equal to <em>\"fulltext\"</em>.<br><br>- <em>fields</em>: A list of attribute names. Currently, the list is limited <br> to exactly one attribute, so the value of <em>fields</em> should look like this for example: <em>[ \"text\" ]</em>. <br><br>- <em>minLength</em>: Minimum character length of words to index. Will default<br> to a server-defined value if unspecified. It is thus recommended to set this value explicitly when creating the index. <br><br>",
|
||||
"summary": "creates a fulltext index",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Creating a fulltext index: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\" : \"fulltext\", \"fields\" : [ \"text\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/113539598\", \n \"type\" : \"fulltext\", \n \"unique\" : false, \n \"minLength\" : 2, \n \"fields\" : [ \n \"text\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "createsAFulltextIndex"
|
||||
}
|
||||
],
|
||||
"path": "/_api/index"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the index already exists, then a <em>HTTP 200</em> is returned. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "If the index does not already exist and could be created, then a <em>HTTP 201</em> is returned. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"required": "True",
|
||||
"name": "collection-name",
|
||||
"description": "The collection name. "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "index-details",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Creates a bitarray index for the collection <em>collection-name</em>, if it does not already exist. The call expects an object containing the index details. <br><br>- <em>type</em>: must be equal to <em>\"bitarray\"</em>.<br><br>- <em>fields</em>: A list of pairs. A pair consists of an attribute path followed by a list of values.<br><br>- <em>unique</em>: Must always be set to <em>false</em>.<br><br>",
|
||||
"summary": "creates a bitarray index",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Creating a bitarray index: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\" : \"bitarray\", \"unique\" : false, \"fields\" : [ \"x\", [0,1,[]], \"y\", [\"a\",\"b\",[]] ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/152271374\", \n \"type\" : \"bitarray\", \n \"unique\" : false, \n \"fields\" : [ \n [ \n \"x\", \n [ \n 0, \n 1, \n [ ] \n ] \n ], \n [ \n \"y\", \n [ \n \"a\", \n \"b\", \n [ ] \n ] \n ] \n ], \n \"undefined\" : false, \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "createsABitarrayIndex"
|
||||
}
|
||||
],
|
||||
"path": "/_api/index"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the index already exists, then a <em>HTTP 200</em> is returned. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "If the index does not already exist and could be created, then a <em>HTTP 201</em> is returned. ",
|
||||
"code": "201"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"required": "True",
|
||||
"name": "collection-name",
|
||||
"description": "The collection name. "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "index-details",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Creates a new index in the collection <em>collection-name</em>. Expects an object containing the index details. <br><br>The type of the index to be created must specified in the <em>type</em> attribute of the index details. Depending on the index type, additional other attributes may need to specified in the request in order to create the index. <br><br>See @ref IndexCapHttp, @ref IndexGeoHttp, @ref IndexHashHttp, @ref IndexFulltextHttp, and @ref IndexSkiplistHttp for details. <br><br>Most indexes (a notable exception being the cap constraint) require the list of attributes to be indexed in the <em>fields</em> attribute of the index details. Depending on the index type, a single attribute or multiple attributes may be indexed. <br><br>Some indexes can be created as unique or non-unique variants. Uniqueness can be controlled for most indexes by specifying the <em>unique</em> in the index details. Setting it to <em>true</em> will create a unique index. Setting it to <em>false</em> or omitting the <em>unique</em> attribute will create a non-unique index. <br><br>Note that the following index types do not support uniqueness, and using the <em>unique</em> attribute with these types may lead to an error: - cap constraints<br>- fulltext indexes<br><br>",
|
||||
"summary": "creates an index",
|
||||
"httpMethod": "POST",
|
||||
"examples": "",
|
||||
"nickname": "createsAnIndex"
|
||||
}
|
||||
],
|
||||
"path": "/_api/index"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the index could be deleted, then a <em>HTTP 202</em> is returned. ",
|
||||
"code": "202"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"required": "True",
|
||||
"name": "index-handle",
|
||||
"description": "The index handle. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Deletes an index with <em>index-handle</em>. <br><br>",
|
||||
"summary": "deletes an index",
|
||||
"httpMethod": "DELETE",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/index/products/190085646\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/190085646\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "deletesAnIndex"
|
||||
}
|
||||
],
|
||||
"path": "/_api/index/{index-handle}"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"basePath": "/",
|
||||
"swaggerVersion": "1.1",
|
||||
"apiVersion": "0.1",
|
||||
"apis": [
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the query is valid, the server will respond with <em>HTTP 200</em> and return the names of the bind parameters it found in the query (if any) in the <em>\"bindVars\"</em> attribute of the response. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "The server will respond with <em>HTTP 400</em> in case of a malformed request, or if the query contains a parse error. The body of the response will contain the error details embedded in a JSON object. ",
|
||||
"code": "400"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "query",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>To validate a query string without executing it, the query string can be passed to the server via an HTTP POST request. <br><br>These query string needs to be passed in the attribute <em>query</em> of a JSON object as the body of the POST request. <br><br>",
|
||||
"summary": "parses a query",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Valid query: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/query\n{ \"query\" : \"FOR p IN products FILTER p.name == @name LIMIT 2 RETURN p.n\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"bindVars\" : [ \n \"name\" \n ], \n \"collections\" : [ \n \"products\" \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Invalid query: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/query\n{ \"query\" : \"FOR p IN products FILTER p.name = @name LIMIT 2 RETURN p.n\" }\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1501, \n \"errorMessage\" : \"1:33 syntax error, unexpected assignment near '= @name LIMIT 2 RETURN p.n'\" \n}\n\n</code></pre><br>",
|
||||
"nickname": "parsesAQuery"
|
||||
}
|
||||
],
|
||||
"path": "/_api/query"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,352 @@
|
|||
{
|
||||
"basePath": "/",
|
||||
"swaggerVersion": "1.1",
|
||||
"apiVersion": "0.1",
|
||||
"apis": [
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the return set contains at least one document and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "query",
|
||||
"description": "Contains the query. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Returns all documents of a collections. The call expects a JSON object as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>skip</em>: The number of documents to skip in the query (optional).<br><br>- <em>limit</em>: The maximal amount of documents to return. The <em>skip</em><br> is applied before the <em>limit</em> restriction. (optional) <br><br>Returns a cursor containing the result, see @ref HttpCursor for details. <br><br>",
|
||||
"summary": "executes simple query ALL",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "Limit the amount of documents using <em>limit</em> <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/all\n{ \"collection\": \"products\", \"skip\": 2, \"limit\" : 2 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/198801934\", \n \"_rev\" : \"198801934\", \n \"_key\" : \"198801934\", \n \"Hello4\" : \"World4\" \n }, \n { \n \"_id\" : \"products/199064078\", \n \"_rev\" : \"199064078\", \n \"_key\" : \"199064078\", \n \"Hello5\" : \"World5\" \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Using a <em>batchSize</em> value <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/all\n{ \"collection\": \"products\", \"batchSize\" : 3 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/99908110\", \n \"_rev\" : \"99908110\", \n \"_key\" : \"99908110\", \n \"Hello2\" : \"World2\" \n }, \n { \n \"_id\" : \"products/100170254\", \n \"_rev\" : \"100170254\", \n \"_key\" : \"100170254\", \n \"Hello3\" : \"World3\" \n }, \n { \n \"_id\" : \"products/100432398\", \n \"_rev\" : \"100432398\", \n \"_key\" : \"100432398\", \n \"Hello4\" : \"World4\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"100825614\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "executesSimpleQueryAll"
|
||||
}
|
||||
],
|
||||
"path": "/_api/simple/all"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the return set contains at least one document and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "query",
|
||||
"description": "Contains the query. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Returns a random document of a collection. The call expects a JSON object as body with the following attributes: <br><br>- <em>collection</em>: The identifier or name of the collection to query.<br><br>Returns a JSON object with the document stored in the attribute <em>document</em> if the collection contains at least one document. If the collection is empty, the attrbute contains null. <br><br>",
|
||||
"summary": "executes simple query ANY",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/any\n{ \"collection\": \"products\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"document\" : { \n \"_id\" : \"products/187660814\", \n \"_rev\" : \"187660814\", \n \"_key\" : \"187660814\", \n \"Hello1\" : \"World1\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "executesSimpleQueryAny"
|
||||
}
|
||||
],
|
||||
"path": "/_api/simple/any"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the return set contains at least one document and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "query",
|
||||
"description": "Contains the query. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>The default will find at most 100 documents near a given coordinate. The returned list is sorted according to the distance, with the nearest document coming first. If there are near documents of equal distance, documents are chosen randomly from this set until the limit is reached. <br><br>In order to use the <em>near</em> operator, a geo index must be defined for the collection. This index also defines which attribute holds the coordinates for the document. If you have more then one geo-spatial index, you can use the <em>geo</em> field to select a particular index. <br><br>The call expects a JSON hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>latitude</em>: The latitude of the coordinate.<br><br>- <em>longitude</em>: The longitude of the coordinate.<br><br>- <em>distance</em>: If given, the attribute key used to store the<br> distance. (optional) <br><br>- <em>skip</em>: The number of documents to skip in the query. (optional)<br><br>- <em>limit</em>: The maximal amount of documents to return. The <em>skip</em> is<br> applied before the <em>limit</em> restriction. The default is 100. (optional) <br><br>- <em>geo</em>: If given, the identifier of the geo-index to use. (optional)<br><br>Returns a cursor containing the result, see @ref HttpCursor for details. <br><br>",
|
||||
"summary": "executes simple query NEAR",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "Without distance: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/near\n{ \"collection\": \"products\", \"latitude\" : 0, \"longitude\" : 0, \"skip\" : 1, \"limit\" : 2 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/236157454\", \n \"_rev\" : \"236157454\", \n \"_key\" : \"236157454\", \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/235895310\", \n \"_rev\" : \"235895310\", \n \"_key\" : \"235895310\", \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>With distance: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/near\n{ \"collection\": \"products\", \"latitude\" : 0, \"longitude\" : 0, \"skip\" : 1, \"limit\" : 3, \"distance\" : \"distance\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/76380686\", \n \"_rev\" : \"76380686\", \n \"_key\" : \"76380686\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/76642830\", \n \"_rev\" : \"76642830\", \n \"_key\" : \"76642830\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/76249614\", \n \"_rev\" : \"76249614\", \n \"_key\" : \"76249614\", \n \"distance\" : 444.779706578235, \n \"name\" : \"Name/-0.004/\", \n \"loc\" : [ \n -0.004, \n 0 \n ] \n } \n ], \n \"hasMore\" : false, \n \"count\" : 3, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "executesSimpleQueryNear"
|
||||
}
|
||||
],
|
||||
"path": "/_api/simple/near"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the return set contains at least one document and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "query",
|
||||
"description": "Contains the query. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>This will find all documents with in a given radius around the coordinate (<em>latitude</em>, <em>longitude</em>). The returned list is sorted by distance. <br><br>In order to use the <em>within</em> operator, a geo index must be defined for the collection. This index also defines which attribute holds the coordinates for the document. If you have more then one geo-spatial index, you can use the <em>geo</em> field to select a particular index. <br><br>The call expects a JSON hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>latitude</em>: The latitude of the coordinate.<br><br>- <em>longitude</em>: The longitude of the coordinate.<br><br>- <em>radius</em>: The maximal radius (in meters).<br><br>- <em>distance</em>: If given, the result attribute key used to store the<br> distance values (optional). If specified, distances are returned in meters. <br><br>- <em>skip</em>: The documents to skip in the query. (optional)<br><br>- <em>limit</em>: The maximal amount of documents to return. (optional)<br><br>- <em>geo</em>: If given, the identifier of the geo-index to use. (optional)<br><br>Returns a cursor containing the result, see @ref HttpCursor for details. <br><br>",
|
||||
"summary": "executes simple query WITHIN",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "Without distance: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/near\n{ \"collection\": \"products\", \"latitude\" : 0, \"longitude\" : 0, \"skip\" : 1, \"limit\" : 2, \"radius\" : 500 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/27490830\", \n \"_rev\" : \"27490830\", \n \"_key\" : \"27490830\", \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/27228686\", \n \"_rev\" : \"27228686\", \n \"_key\" : \"27228686\", \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>With distance: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/near\n{ \"collection\": \"products\", \"latitude\" : 0, \"longitude\" : 0, \"skip\" : 1, \"limit\" : 3, \"distance\" : \"distance\", \"radius\" : 300 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/107051534\", \n \"_rev\" : \"107051534\", \n \"_key\" : \"107051534\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/107313678\", \n \"_rev\" : \"107313678\", \n \"_key\" : \"107313678\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/106920462\", \n \"_rev\" : \"106920462\", \n \"_key\" : \"106920462\", \n \"distance\" : 444.779706578235, \n \"name\" : \"Name/-0.004/\", \n \"loc\" : [ \n -0.004, \n 0 \n ] \n } \n ], \n \"hasMore\" : false, \n \"count\" : 3, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "executesSimpleQueryWithin"
|
||||
}
|
||||
],
|
||||
"path": "/_api/simple/within"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the return set contains at least one document and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "query",
|
||||
"description": "Contains the query. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>This will find all documents from the collection that match the fulltext query specified in <em>query</em>. <br><br>In order to use the <em>fulltext</em> operator, a fulltext index must be defined for the collection and the specified attribute. <br><br>The call expects a JSON hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>attribute</em>: The attribute that contains the texts.<br><br>- <em>query</em>: The fulltext query.<br><br>- <em>skip</em>: The documents to skip in the query. (optional)<br><br>- <em>limit</em>: The maximal amount of documents to return. (optional)<br><br>- <em>index</em>: If given, the identifier of the fulltext-index to use. (optional)<br><br>Returns a cursor containing the result, see @ref HttpCursor for details. <br><br>",
|
||||
"summary": "executes simple query FULLTEXT",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/fulltext\n{ \"collection\": \"products\", \"attribute\" : \"text\", \"query\" : \"word\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/138770958\", \n \"_rev\" : \"138770958\", \n \"_key\" : \"138770958\", \n \"text\" : \"this text also has a word\" \n }, \n { \n \"_id\" : \"products/138639886\", \n \"_rev\" : \"138639886\", \n \"_key\" : \"138639886\", \n \"text\" : \"this text contains word\" \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "executesSimpleQueryFulltext"
|
||||
}
|
||||
],
|
||||
"path": "/_api/simple/fulltext"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the return set contains at least one document and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "query",
|
||||
"description": "Contains the query. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>This will find all documents matching a given example. <br><br>The call expects a JSON hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>example</em>: The example.<br><br>- <em>skip</em>: The documents to skip in the query. (optional)<br><br>- <em>limit</em>: The maximal amount of documents to return. (optional)<br><br>Returns a cursor containing the result, see @ref HttpCursor for details. <br><br>",
|
||||
"summary": "executes simple query by-example",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "Matching an attribute: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/by-example\n{ \"collection\": \"products\", \"example\" : { \"i\" : 1 } }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/59800078\", \n \"_rev\" : \"59800078\", \n \"_key\" : \"59800078\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/60389902\", \n \"_rev\" : \"60389902\", \n \"_key\" : \"60389902\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 2, \n \"j\" : 2 \n } \n }, \n { \n \"_id\" : \"products/60062222\", \n \"_rev\" : \"60062222\", \n \"_key\" : \"60062222\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/60258830\", \n \"_rev\" : \"60258830\", \n \"_key\" : \"60258830\", \n \"i\" : 1 \n } \n ], \n \"hasMore\" : false, \n \"count\" : 4, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Matching an attribute which is a sub-document: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/by-example\n{ \"collection\": \"products\", \"example\" : { \"a.j\" : 1 } }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/117602830\", \n \"_rev\" : \"117602830\", \n \"_key\" : \"117602830\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/117340686\", \n \"_rev\" : \"117340686\", \n \"_key\" : \"117340686\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>Matching an attribute within a sub-document: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } } }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/115374606\", \n \"_rev\" : \"115374606\", \n \"_key\" : \"115374606\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n } \n ], \n \"hasMore\" : false, \n \"count\" : 1, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "executesSimpleQueryBy-example"
|
||||
}
|
||||
],
|
||||
"path": "/_api/simple/by-example"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the return set contains at least one document and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [],
|
||||
"notes": "<br><br>This will return the first document matching a given example. <br><br>The call expects a JSON hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>example</em>: The example.<br><br>Returns a result containing the document or <em>HTTP 404</em> if no document matched the example. <br><br>",
|
||||
"summary": "executes simple query first-example",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "If a matching document was found: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/first-example\n{ \"collection\": \"products\", \"example\" : { \"i\" : 1 } }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"document\" : { \n \"_id\" : \"products/136739342\", \n \"_rev\" : \"136739342\", \n \"_key\" : \"136739342\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>If no document was found: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/first-example\n{ \"collection\": \"products\", \"example\" : { \"l\" : 1 } }\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 404, \n \"errorMessage\" : \"no match\" \n}\n\n</code></pre><br>",
|
||||
"nickname": "executesSimpleQueryFirst-example"
|
||||
}
|
||||
],
|
||||
"path": "/_api/simple/first-example"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if there are at least one document in the return range and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [],
|
||||
"notes": "<br><br>This will find all documents within a given range. You must declare a skip-list index on the attribute in order to be able to use a range query. <br><br>The call expects a JSON hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>attribute</em>: The attribute path to check.<br><br>- <em>left</em>: The lower bound.<br><br>- <em>right</em>: The upper bound.<br><br>- <em>closed</em>: If true, use interval including <em>left</em> and <em>right</em>,<br> otherwise exclude <em>right</em>, but include <em>left</em>. <br><br>- <em>skip</em>: The documents to skip in the query. (optional)<br><br>- <em>limit</em>: The maximal amount of documents to return. (optional)<br><br>Returns a cursor containing the result, see @ref HttpCursor for details. <br><br>",
|
||||
"summary": "executes simple range query",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/range\n{ \"collection\": \"products\", \"attribute\" : \"i\", \"left\" : 2, \"right\" : 4 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/31357454\", \n \"_rev\" : \"31357454\", \n \"_key\" : \"31357454\", \n \"i\" : 2 \n }, \n { \n \"_id\" : \"products/31488526\", \n \"_rev\" : \"31488526\", \n \"_key\" : \"31488526\", \n \"i\" : 3 \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
"nickname": "executesSimpleRangeQuery"
|
||||
}
|
||||
],
|
||||
"path": "/_api/simple/range"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if there where removed at least one document and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [],
|
||||
"notes": "<br><br>This will find all documents in the collection that match the specified example object. <br><br>The call expects a JSON hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to remove from.<br><br>- <em>example</em>: An example object that all collection objects are compared<br> against. <br><br>- <em>waitForSync</em>: if set to true, then all removal operations will <br> instantly be synchronised to disk. If this is not specified, then the collection's default sync behavior will be applied. <br><br>- <em>limit</em>: an optional value that determines how many documents to <br> delete at most. If <em>limit</em> is specified but is less than the number of documents in the collection, it is undefined which of the documents will be deleted. <br><br>Returns the number of documents that were deleted <br><br>",
|
||||
"summary": "removes documents by example",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/remove-by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } } }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "removesDocumentsByExample"
|
||||
}
|
||||
],
|
||||
"path": "/_api/simple/remove-by-example"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the documents in the collection where replaced successfully and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [],
|
||||
"notes": "<br><br>This will find all documents in the collection that match the specified example object, and replace the entire document body with the new value specified. Note that document meta-attributes such as <em>_id</em>, <em>_key</em>, <em>_from</em>, <em>_to</em> etc. cannot be replaced. <br><br>The call expects a JSON hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to replace within.<br><br>- <em>example</em>: An example object that all collection objects are compared<br> against. <br><br>- <em>newValue</em>: The replacement document that will get inserted in place<br> of the \"old\" documents. <br><br>- <em>waitForSync</em>: if set to true, then all removal operations will <br> instantly be synchronised to disk. If this is not specified, then the collection's default sync behavior will be applied. <br><br>- <em>limit</em>: an optional value that determines how many documents to <br> replace at most. If <em>limit</em> is specified but is less than the number of documents in the collection, it is undefined which of the documents will be replaced. <br><br>Returns the number of documents that were replaced <br><br>",
|
||||
"summary": "replaces documents by example",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/replace-by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } }, \"newValue\" : {\"foo\" : \"bar\"}, \"limit\" : 3 }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"replaced\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "replacesDocumentsByExample"
|
||||
}
|
||||
],
|
||||
"path": "/_api/simple/replace-by-example"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "is returned if the collection was updated successfully and <em>waitForSync</em> was <em>true</em>. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "is returned if the collection specified by <em>collection</em> is unknown. The response body contains an error document in this case. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [],
|
||||
"notes": "<br><br>This will find all documents in the collection that match the specified example object, and partially update the document body with the new value specified. Note that document meta-attributes such as <em>_id</em>, <em>_key</em>, <em>_from</em>, <em>_to</em> etc. cannot be replaced. <br><br>The call expects a JSON hash array as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to update within.<br><br>- <em>example</em>: An example object that all collection objects are compared<br> against. <br><br>- <em>newValue</em>: The update value that will get inserted in place<br> of the \"old\" version of the found documents. <br><br>- <em>keepNull</em>: This parameter can be used to modify the behavior when<br> handling <em>null</em> values. Normally, <em>null</em> values are stored in the database. By setting the <em>keepNull</em> parameter to <em>false</em>, this behavior can be changed so that all attributes in <em>data</em> with <em>null</em> values will be removed from the updated document. <br><br>- <em>waitForSync</em>: if set to true, then all removal operations will <br> instantly be synchronised to disk. If this is not specified, then the collection's default sync behavior will be applied. <br><br>- <em>limit</em>: an optional value that determines how many documents to <br> update at most. If <em>limit</em> is specified but is less than the number of documents in the collection, it is undefined which of the documents will be updated. <br><br>Returns the number of documents that were updated <br><br>",
|
||||
"summary": "updates documents by example",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/update-by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } }, \"newValue\" : { \"a\" : { \"j\" : 22 } }, \"limit\" : 3 }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"updated\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
"nickname": "updatesDocumentsByExample"
|
||||
}
|
||||
],
|
||||
"path": "/_api/simple/update-by-example"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"basePath": "/",
|
||||
"swaggerVersion": "1.1",
|
||||
"apiVersion": "0.1",
|
||||
"apis": [
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
"required": "True",
|
||||
"name": "collection",
|
||||
"description": "Creates a new document in the collection <em>collection</em>. "
|
||||
},
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "structure",
|
||||
"description": "The structure definition. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Creates a new document in the collection identified by the <em>collection-identifier</em>. A JSON representation of the document must be passed as the body of the POST request. The document must fullfill the requirements of the structure definition, see @ref ArangoStructures. <br><br>In all other respects the function is identical to the @ref triagens::arango::RestDocumentHandler::createDocument \"POST /_api/structure\". ",
|
||||
"summary": "creates a structured document",
|
||||
"httpMethod": "POST",
|
||||
"examples": "",
|
||||
"nickname": "createsAStructuredDocument"
|
||||
}
|
||||
],
|
||||
"path": "/_api/structure"
|
||||
}
|
||||
]
|
||||
}
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"basePath": "/",
|
||||
"swaggerVersion": "1.1",
|
||||
"apiVersion": "0.1",
|
||||
"apis": [
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "If the transaction is fully executed and committed on the server, <em>HTTP 200</em> will be returned. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "If the transaction specification is either missing or malformed, the server will respond with <em>HTTP 400</em>. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "Exceptions thrown by users will make the server respond with a return code of <em>HTTP 500</em> ",
|
||||
"code": "500"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "body",
|
||||
"description": "Contains the <em>collections</em> and <em>action</em>. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>The transaction description must be passed in the body of the POST request. <br><br>The following attributes must be specified inside the JSON object: <br><br>- <em>collections</em>: contains the list of collections to be used in the<br> transaction (mandatory). <em>collections</em> must be a JSON array that can have the optional sub-attributes <em>read</em> and <em>write</em>. <em>read</em> and <em>write</em> must each be either lists of collections names or strings with a single collection name. <br><br>- <em>action</em>: the actual transaction operations to be executed, in the<br> form of stringified Javascript code. The code will be executed on server side, with late binding. It is thus critical that the code specified in <em>action</em> properly sets up all the variables it needs. If the code specified in <em>action</em> ends with a return statement, the value returned will also be returned by the REST API in the <em>result</em> attribute if the transaction committed successfully. <br><br>The following optional attributes may also be specified in the request: <br><br>- <em>waitForSync</em>: an optional boolean flag that, if set, will force the <br> transaction to write all data to disk before returning. <br><br>- <em>lockTimeout</em>: an optional numeric value that can be used to set a<br> timeout for waiting on collection locks. If not specified, a default value will be used. Setting <em>lockTimeout</em> to <em>0</em> will make ArangoDB not time out waiting for a lock. <br><br>- <em>params</em>: optional arguments passed to <em>action</em>.<br><br>If the transaction is fully executed and committed on the server, <em>HTTP 200</em> will be returned. Additionally, the return value of the code defined in <em>action</em> will be returned in the <em>result</em> attribute. <br><br>For successfully committed transactions, the returned JSON object has the following properties: <br><br>- <em>error</em>: boolean flag to indicate if an error occurred (<em>false</em><br> in this case) <br><br>- <em>code</em>: the HTTP status code<br><br>- <em>result</em>: the return value of the transaction<br><br>If the transaction specification is either missing or malformed, the server will respond with <em>HTTP 400</em>. <br><br>The body of the response will then contain a JSON object with additional error details. The object has the following attributes: <br><br>- <em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case)<br><br>- <em>code</em>: the HTTP status code<br><br>- <em>errorNum</em>: the server error number<br><br>- <em>errorMessage</em>: a descriptive error message<br><br>If a transaction fails to commit, either by an exception thrown in the <em>action</em> code, or by an internal error, the server will respond with an error. Any other errors will be returned with any of the return codes <em>HTTP 400</em>, <em>HTTP 409</em>, or <em>HTTP 500</em>. <br><br>",
|
||||
"summary": "executes a transaction",
|
||||
"httpMethod": "POST",
|
||||
"examples": "Executing a transaction on a single collection: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/transaction\n{ \"collections\": { \"write\" : \"products\" }, \"action\" : \"function () { var db = require(\\\"internal\\\").db;db.products.save({});return db.products.count(); }\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Executing a transaction using multiple collections: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/transaction\n{ \"collections\": { \"write\" : [\"products\", \"materials\" ] }, \"action\" : \"function () { var db = require(\\\"internal\\\").db;db.products.save({});db.materials.save({});return \\\"worked!\\\"; }\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : \"worked!\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Aborting a transaction due to an internal error: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/transaction\n{ \"collections\": { \"write\" : \"products\" }, \"action\" : \"function () { var db = require(\\\"internal\\\").db;db.products.save({_key: \\\"abc\\\"});db.products.save({_key: \\\"abc\\\"});\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 400, \n \"errorMessage\" : \"bad parameter\" \n}\n\n</code></pre><br>Aborting a transaction by throwing an exception: <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/transaction\n{ \"collections\": { \"read\" : \"products\" }, \"action\" : \"function () { throw \\\"doh!\\\"; }\" }\n\nHTTP/1.1 500 Internal Error\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 500, \n \"errorNum\" : 500, \n \"errorMessage\" : \"doh!\" \n}\n\n</code></pre><br>",
|
||||
"nickname": "executesATransaction"
|
||||
}
|
||||
],
|
||||
"path": "/_api/transaction"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"basePath": "/",
|
||||
"swaggerVersion": "1.1",
|
||||
"apiVersion": "0.1",
|
||||
"apis": [
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "body",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "TODO ",
|
||||
"summary": "executes a traversal",
|
||||
"httpMethod": "POST",
|
||||
"examples": "",
|
||||
"nickname": "executesATraversal"
|
||||
}
|
||||
],
|
||||
"path": "/_api/traversal"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,158 @@
|
|||
{
|
||||
"basePath": "/",
|
||||
"swaggerVersion": "1.1",
|
||||
"apiVersion": "0.1",
|
||||
"apis": [
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "The user was found. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "The user with <em>username</em> does not exist. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "username",
|
||||
"description": "The username of the user. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Fetches data about the specified user. <br><br>The call will return a JSON document with at least the following attributes on success: <br><br>- <em>username</em>: The name of the user as a string.<br><br>- <em>active</em>: an optional flag that specifies whether the user is active.<br><br>- <em>extra</em>: an optional JSON object with arbitrary extra data about the<br> user. <br><br>",
|
||||
"summary": "fetches a user",
|
||||
"httpMethod": "GET",
|
||||
"examples": "",
|
||||
"nickname": "fetchesAUser"
|
||||
}
|
||||
],
|
||||
"path": "/_api/user/{username}"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "returned if the user can be added by the server. ",
|
||||
"code": "201"
|
||||
},
|
||||
{
|
||||
"reason": "If the JSON representation is malformed or mandatory data is missing from the request. ",
|
||||
"code": "400"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "user",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>The following data need to be passed in a JSON representation in the body of the POST request: <br><br>- <em>username</em>: The name of the user as a string. This is mandatory.<br><br>- <em>passwd</em>: The user password as a string. If no password is specified,<br> the empty string will be used. <br><br>- <em>active</em>: an optional flag that specifies whether the user is active.<br> If not specified, this will default to <em>true</em>. <br><br>- <em>extra</em>: an optional JSON object with arbitrary extra data about the<br> user. <br><br>If the user can be added by the server, the server will respond with <em>HTTP 201</em>. <br><br>In case of success, the returned JSON object has the following properties: <br><br>- <em>error</em>: boolean flag to indicate that an error occurred (<em>false</em><br> in this case) <br><br>- <em>code</em>: the HTTP status code<br><br>If the JSON representation is malformed or mandatory data is missing from the request, the server will respond with <em>HTTP 400</em>. <br><br>The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br>- <em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case)<br><br>- <em>code</em>: the HTTP status code<br><br>- <em>errorNum</em>: the server error number<br><br>- <em>errorMessage</em>: a descriptive error message<br><br>",
|
||||
"summary": "creates user",
|
||||
"httpMethod": "POST",
|
||||
"examples": "",
|
||||
"nickname": "createsUser"
|
||||
}
|
||||
],
|
||||
"path": "/_api/user"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "Is returned if the user data can be replaced by the server. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "The JSON representation is malformed or mandatory data is missing from the request. ",
|
||||
"code": "400"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "user",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Replaces the data of an existing user. The name of an existing user must be specified in <em>username</em>. <br><br>The following data can to be passed in a JSON representation in the body of the POST request: <br><br>- <em>passwd</em>: The user password as a string. Specifying a password is<br> mandatory, but the empty string is allowed for passwords. <br><br>- <em>active</em>: an optional flag that specifies whether the user is active.<br> If not specified, this will default to <em>true</em>. <br><br>- <em>extra</em>: an optional JSON object with arbitrary extra data about the<br> user. <br><br>If the user can be replaced by the server, the server will respond with <em>HTTP 200</em>. <br><br>In case of success, the returned JSON object has the following properties: <br><br>- <em>error</em>: boolean flag to indicate that an error occurred (<em>false</em><br> in this case) <br><br>- <em>code</em>: the HTTP status code<br><br>If the JSON representation is malformed or mandatory data is missing from the request, the server will respond with <em>HTTP 400</em>. If the specified user does not exist, the server will respond with <em>HTTP 404</em>. <br><br>The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br>- <em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case)<br><br>- <em>code</em>: the HTTP status code<br><br>- <em>errorNum</em>: the server error number<br><br>- <em>errorMessage</em>: a descriptive error message<br><br>",
|
||||
"summary": "replaces user",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "",
|
||||
"nickname": "replacesUser"
|
||||
}
|
||||
],
|
||||
"path": "/_api/user/{username}"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "Is returned if the user data can be replaced by the server. ",
|
||||
"code": "200"
|
||||
},
|
||||
{
|
||||
"reason": "The JSON representation is malformed or mandatory data is missing from the request. ",
|
||||
"code": "400"
|
||||
},
|
||||
{
|
||||
"reason": "The specified user does not exist. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"dataType": "Json",
|
||||
"paramType": "body",
|
||||
"required": "true",
|
||||
"name": "userdata",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>Partially updates the data of an existing user. The name of an existing user must be specified in <em>username</em>. <br><br>The following data can be passed in a JSON representation in the body of the POST request: <br><br>- <em>passwd</em>: The user password as a string. Specifying a password is<br> optional. If not specified, the previously existing value will not be modified. <br><br>- <em>active</em>: an optional flag that specifies whether the user is active.<br> If not specified, the previously existing value will not be modified. <br><br>- <em>extra</em>: an optional JSON object with arbitrary extra data about the<br> user. If not specified, the previously existing value will not be modified. <br><br>If the user can be updated by the server, the server will respond with <em>HTTP 200</em>. <br><br>In case of success, the returned JSON object has the following properties: <br><br>- <em>error</em>: boolean flag to indicate that an error occurred (<em>false</em><br> in this case) <br><br>- <em>code</em>: the HTTP status code<br><br>If the JSON representation is malformed or mandatory data is missing from the request, the server will respond with <em>HTTP 400</em>. If the specified user does not exist, the server will respond with <em>HTTP 404</em>. <br><br>The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br>- <em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case)<br><br>- <em>code</em>: the HTTP status code<br><br>- <em>errorNum</em>: the server error number<br><br>- <em>errorMessage</em>: a descriptive error message<br><br>",
|
||||
"summary": "updates user",
|
||||
"httpMethod": "PATCH",
|
||||
"examples": "",
|
||||
"nickname": "updatesUser"
|
||||
}
|
||||
],
|
||||
"path": "/_api/user/{username}"
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"errorResponses": [
|
||||
{
|
||||
"reason": "Is returned if the user was removed by the server. ",
|
||||
"code": "202"
|
||||
},
|
||||
{
|
||||
"reason": "The specified user does not exist. ",
|
||||
"code": "404"
|
||||
}
|
||||
],
|
||||
"parameters": [],
|
||||
"notes": "<br><br>Removes an existing user, identified by <em>username</em>. <br><br>If the user can be removed by the server, the server will respond with <em>HTTP 202</em>. <br><br>In case of success, the returned JSON object has the following properties: <br><br>- <em>error</em>: boolean flag to indicate that an error occurred (<em>false</em><br> in this case) <br><br>- <em>code</em>: the HTTP status code<br><br>If the specified user does not exist, the server will respond with <em>HTTP 404</em>. <br><br>The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br>- <em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case)<br><br>- <em>code</em>: the HTTP status code<br><br>- <em>errorNum</em>: the server error number<br><br>- <em>errorMessage</em>: a descriptive error message<br><br>",
|
||||
"summary": "removes a user",
|
||||
"httpMethod": "DELETE",
|
||||
"examples": "",
|
||||
"nickname": "removesAUser"
|
||||
}
|
||||
],
|
||||
"path": "/_api/user/{username}"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue