mirror of https://gitee.com/bigwinds/arangodb
447 lines
30 KiB
JSON
447 lines
30 KiB
JSON
{
|
|
"basePath": "/",
|
|
"swaggerVersion": "1.1",
|
|
"apiVersion": "0.1",
|
|
"apis": [
|
|
{
|
|
"operations": [
|
|
{
|
|
"errorResponses": [
|
|
{
|
|
"reason": "is returned if the document was found <br><br>",
|
|
"code": "200"
|
|
},
|
|
{
|
|
"reason": "is returned if the document or collection was not found <br><br>",
|
|
"code": "404"
|
|
},
|
|
{
|
|
"reason": "is returned if the \"If-None-Match\" header is given and the document has same version <br><br>",
|
|
"code": "304"
|
|
},
|
|
{
|
|
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the found document has a different version <br><br>",
|
|
"code": "412"
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "path",
|
|
"required": true,
|
|
"name": "document-handle",
|
|
"description": "The Handle of the Document. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"name": "rev",
|
|
"description": "You can conditionally select a document based on a target revision id by using the <em>rev</em> URL parameter. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"name": "lang",
|
|
"description": "Language of the data. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "Boolean",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"name": "format",
|
|
"description": "False for unformated values (default: true). <br><br>"
|
|
},
|
|
{
|
|
"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. <br><br>"
|
|
},
|
|
{
|
|
"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. <br><br>"
|
|
}
|
|
],
|
|
"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": "",
|
|
"nickname": "readsADocument"
|
|
}
|
|
],
|
|
"path": "/_api/structure/{document-handle}"
|
|
},
|
|
{
|
|
"operations": [
|
|
{
|
|
"errorResponses": [
|
|
{
|
|
"reason": "is returned if the document was found <br><br>",
|
|
"code": "200"
|
|
},
|
|
{
|
|
"reason": "is returned if the document or collection was not found <br><br>",
|
|
"code": "404"
|
|
},
|
|
{
|
|
"reason": "is returned if the \"If-None-Match\" header is given and the document has same version <br><br>",
|
|
"code": "304"
|
|
},
|
|
{
|
|
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the found document has a different version <br><br>",
|
|
"code": "412"
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "path",
|
|
"required": true,
|
|
"name": "document-handle",
|
|
"description": "The Handle of the Document. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"name": "rev",
|
|
"description": "You can conditionally select a document based on a target revision id by using the <em>rev</em> URL parameter. <br><br>"
|
|
},
|
|
{
|
|
"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. <br><br>"
|
|
}
|
|
],
|
|
"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": "",
|
|
"nickname": "readsADocumentHeader"
|
|
}
|
|
],
|
|
"path": "/_api/structure/{document-handle}"
|
|
},
|
|
{
|
|
"operations": [
|
|
{
|
|
"errorResponses": [
|
|
{
|
|
"reason": "is returned if the document was deleted successfully and <em>waitForSync</em> was <em>true</em>. <br><br>",
|
|
"code": "200"
|
|
},
|
|
{
|
|
"reason": "is returned if the document was deleted successfully and <em>waitForSync</em> was <em>false</em>. <br><br>",
|
|
"code": "202"
|
|
},
|
|
{
|
|
"reason": "is returned if the collection or the document was not found. The response body contains an error document in this case. <br><br>",
|
|
"code": "404"
|
|
},
|
|
{
|
|
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the current document has a different version <br><br>",
|
|
"code": "412"
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "path",
|
|
"required": true,
|
|
"name": "document-handle",
|
|
"description": "Deletes the document identified by <em>document-handle</em>. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"name": "rev",
|
|
"description": "You can conditionally delete a document based on a target revision id by using the <em>rev</em> URL parameter. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"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). <br><br>"
|
|
},
|
|
{
|
|
"dataType": "Boolean",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"name": "waitForSync",
|
|
"description": "Wait until document has been sync to disk. <br><br>"
|
|
},
|
|
{
|
|
"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. <br><br>"
|
|
}
|
|
],
|
|
"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": "",
|
|
"nickname": "deletesADocument"
|
|
}
|
|
],
|
|
"path": "/_api/structure/{document-handle}"
|
|
},
|
|
{
|
|
"operations": [
|
|
{
|
|
"errorResponses": [
|
|
{
|
|
"reason": "is returned if the document was created successfully and <em>waitForSync</em> was <em>true</em>. <br><br>",
|
|
"code": "201"
|
|
},
|
|
{
|
|
"reason": "is returned if the document was created successfully and <em>waitForSync</em> was <em>false</em>. <br><br>",
|
|
"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. <br><br>",
|
|
"code": "400"
|
|
},
|
|
{
|
|
"reason": "is returned if collection or the document was not found <br><br>",
|
|
"code": "404"
|
|
},
|
|
{
|
|
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the found document has a different version <br><br>",
|
|
"code": "412"
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "path",
|
|
"required": true,
|
|
"name": "document-handle",
|
|
"description": "The Handle of the Document. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "Boolean",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"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>. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "Boolean",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"name": "waitForSync",
|
|
"description": "Wait until document has been sync to disk. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"name": "rev",
|
|
"description": "You can conditionally patch a document based on a target revision id by using the <em>rev</em> URL parameter. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"name": "policy",
|
|
"description": "To control the update behavior in case there is a revision mismatch, you can use the <em>policy</em> parameter. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"name": "lang",
|
|
"description": "Language of the data. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "Boolean",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"name": "format",
|
|
"description": "False for unformated values (default: true). <br><br>"
|
|
},
|
|
{
|
|
"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. <br><br>"
|
|
}
|
|
],
|
|
"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": "",
|
|
"nickname": "patchesADocument"
|
|
}
|
|
],
|
|
"path": "/_api/structure/{document-handle}"
|
|
},
|
|
{
|
|
"operations": [
|
|
{
|
|
"errorResponses": [
|
|
{
|
|
"reason": "is returned if the document was created successfully and <em>waitForSync</em> was <em>true</em>. <br><br>",
|
|
"code": "201"
|
|
},
|
|
{
|
|
"reason": "is returned if the document was created successfully and <em>waitForSync</em> was <em>false</em>. <br><br>",
|
|
"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. <br><br>",
|
|
"code": "400"
|
|
},
|
|
{
|
|
"reason": "is returned if collection or the document was not found <br><br>",
|
|
"code": "404"
|
|
},
|
|
{
|
|
"reason": "is returned if a \"If-Match\" header or <em>rev</em> is given and the found document has a different version <br><br>",
|
|
"code": "412"
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "path",
|
|
"required": true,
|
|
"name": "document-handle",
|
|
"description": "The Handle of the Document. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "Boolean",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"name": "waitForSync",
|
|
"description": "Wait until document has been sync to disk. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"name": "rev",
|
|
"description": "You can conditionally replace a document based on a target revision id by using the <em>rev</em> URL parameter. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"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). <br><br>"
|
|
},
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"name": "lang",
|
|
"description": "Language of the data. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "Boolean",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"name": "format",
|
|
"description": "False for unformated values (default: true). <br><br>"
|
|
},
|
|
{
|
|
"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. <br><br>"
|
|
}
|
|
],
|
|
"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): <ul class=\"swagger-list\"><li>specifying the target revision in the <em>rev</em> URL query parameter <li>specifying the target revision in the <em>if-match</em> HTTP header </ul> 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> <ul class=\"swagger-list\"><li>PUT /_api/document/<em>document-handle</em>?rev=<em>etag</em> </ul> 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> <ul class=\"swagger-list\"><li>PUT /_api/document/<em>document-handle</em>?policy=<em>policy</em> </ul> 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": "",
|
|
"nickname": "replacesADocument"
|
|
}
|
|
],
|
|
"path": "/_api/structure/{document-handle}"
|
|
},
|
|
{
|
|
"operations": [
|
|
{
|
|
"errorResponses": [
|
|
{
|
|
"reason": "is returned if the document was created successfully and <em>waitForSync</em> was <em>true</em>. <br><br>",
|
|
"code": "201"
|
|
},
|
|
{
|
|
"reason": "is returned if the document was created successfully and <em>waitForSync</em> was <em>false</em>. <br><br>",
|
|
"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. <br><br>",
|
|
"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. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "query",
|
|
"required": true,
|
|
"name": "collection",
|
|
"description": "The collection name. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "Boolean",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"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. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "Boolean",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"name": "waitForSync",
|
|
"description": "Wait until document has been sync to disk. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"name": "lang",
|
|
"description": "Language of the send data. <br><br>"
|
|
},
|
|
{
|
|
"dataType": "Boolean",
|
|
"paramType": "query",
|
|
"required": false,
|
|
"name": "format",
|
|
"description": "True, if the document contains formatted values (default: true). <br><br>"
|
|
}
|
|
],
|
|
"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> <ul class=\"swagger-list\"><li><em>_id</em> contains the document handle of the newly created document <li><em>_key</em> contains the document key <li><em>_rev</em> contains the document revision </ul> 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": "",
|
|
"nickname": "createsADocument"
|
|
}
|
|
],
|
|
"path": "/_api/structure"
|
|
}
|
|
]
|
|
}
|