1
0
Fork 0
arangodb/js/apps/system/aardvark/api-docs/index.json

360 lines
27 KiB
JSON

{
"basePath": "/",
"swaggerVersion": "1.1",
"apiVersion": "0.1",
"apis": [
{
"operations": [
{
"errorResponses": [],
"parameters": [
{
"dataType": "String",
"paramType": "query",
"required": "true",
"name": "collection",
"description": "The collection name. <br><br>"
}
],
"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": " Read all indexes of a collection",
"httpMethod": "GET",
"examples": "<br><br> Return information about all indexes: <br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --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 \"_key\" \n ] \n } \n ], \n \"identifiers\" : { \n \"products/0\" : { \n \"id\" : \"products/0\", \n \"type\" : \"primary\", \n \"unique\" : true, \n \"fields\" : [ \n \"_key\" \n ] \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br>",
"nickname": "ReadAllIndexesOfACollection"
}
],
"path": "/_api/index"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the index exists, then a <em>HTTP 200</em> is returned. <br><br>",
"code": "200"
},
{
"reason": "If the index does not exist, then a <em>HTTP 404</em> is returned. <br><br>",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "index-handle",
"description": "The index-handle. <br><br>"
}
],
"notes": "<br><br> The result is an objects describing the index. It has at least the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>id</em>: The identifier of the index. </ul> All other attributes are type-dependent. <br><br>",
"summary": "Read index",
"httpMethod": "GET",
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --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 \"_key\" \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br>",
"nickname": "ReadIndex"
}
],
"path": "/_api/index/{index-handle}"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the index already exists, then an <em>HTTP 200</em> is returned. <br><br>",
"code": "200"
},
{
"reason": "If the index does not already exist and could be created, then an <em>HTTP 201</em> is returned. <br><br>",
"code": "201"
},
{
"reason": "If either <em>size</em> or <em>byteSize</em> contain invalid values, then an <em>HTTP 400</em> is returned. <br><br>",
"code": "400"
},
{
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. <br><br>",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "query",
"required": "true",
"name": "collection",
"description": "The collection name. <br><br>"
},
{
"dataType": "Json",
"paramType": "body",
"required": "true",
"name": "cap-constraint",
"description": "<br><br>"
}
],
"notes": "<br><br> Creates a cap constraint for the collection <em>collection-name</em>, if it does not already exist. Expects an object containing the index details. <br><br> <ul class=\"swagger-list\"><li><em>type</em>: must be equal to <em>\"cap\"</em>. <li><em>size</em>: The maximal number of documents for the collection. If specified, the value must be greater than zero. <li><em>byteSize</em>: The maximal size of the active document data in the collection (in bytes). If specified, the value must be at least 16384. </ul> <em>Note</em>: 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> It is allowed to specify either <em>size</em> or <em>byteSize</em>, or both at the same time. If both are specified, then the automatic document removal will be triggered by the first non-met constraint. <br><br>",
"summary": " Create cap constraint",
"httpMethod": "POST",
"examples": "<br><br> Creating a cap constraint <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --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/1138490536\", \n \"type\" : \"cap\", \n \"unique\" : false, \n \"size\" : 10, \n \"byteSize\" : 0, \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br>",
"nickname": "CreateCapConstraint"
}
],
"path": "/_api/index"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the index already exists, then a <em>HTTP 200</em> is returned. <br><br>",
"code": "200"
},
{
"reason": "If the index does not already exist and could be created, then a <em>HTTP 201</em> is returned. <br><br>",
"code": "201"
},
{
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. <br><br>",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "query",
"required": "true",
"name": "collection",
"description": "The collection name. <br><br>"
},
{
"dataType": "Json",
"paramType": "body",
"required": "true",
"name": "index-details",
"description": "<br><br>"
}
],
"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> <ul class=\"swagger-list\"><li><em>type</em>: must be equal to <em>\"geo\"</em>. <li><em>fields</em>: A list with one or two attribute paths. 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. 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. <li><em>geoJson</em>: If a geo-spatial index on a <em>location</em> is constructed 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 <li><em>constraint</em>: If <em>constraint</em> is <em>true</em>, then a geo-spatial constraint is created. The constraint is a non-unique variant of the index. <em>Note</em>: It is also possible to set the <em>unique</em> attribute instead of the <em>constraint</em> attribute. <li><em>ignoreNull</em>: If a geo-spatial constraint is created and <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. </ul> <em>Note</em>: Unique indexes on non-shard keys are not supported in a cluster. <br><br>",
"summary": " Create geo-spatial index",
"httpMethod": "POST",
"examples": "<br><br> Creating a geo index with a location attribute: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --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/1139014824\", \n \"type\" : \"geo1\", \n \"unique\" : false, \n \"geoJson\" : false, \n \"constraint\" : false, \n \"ignoreNull\" : false, \n \"fields\" : [ \n \"b\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br> Creating a geo index with latitude and longitude attributes: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --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/1139539112\", \n \"type\" : \"geo2\", \n \"unique\" : false, \n \"constraint\" : false, \n \"ignoreNull\" : false, \n \"fields\" : [ \n \"e\", \n \"f\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br>",
"nickname": "CreateGeo-spatialIndex"
}
],
"path": "/_api/index"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the index already exists, then a <em>HTTP 200</em> is returned. <br><br>",
"code": "200"
},
{
"reason": "If the index does not already exist and could be created, then a <em>HTTP 201</em> is returned. <br><br>",
"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. <br><br>",
"code": "400"
},
{
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. <br><br>",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "query",
"required": "true",
"name": "collection-name",
"description": "The collection name. <br><br>"
},
{
"dataType": "Json",
"paramType": "body",
"required": "true",
"name": "index-details",
"description": "<br><br>"
}
],
"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> <ul class=\"swagger-list\"><li><em>type</em>: must be equal to <em>\"hash\"</em>. <li><em>fields</em>: A list of attribute paths. <li><em>unique</em>: If <em>true</em>, then create a unique index. </ul> <em>Note</em>: unique indexes on non-shard keys are not supported in a cluster. <br><br>",
"summary": " Create hash index",
"httpMethod": "POST",
"examples": "<br><br> Creating an unique constraint: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --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/1140063400\", \n \"type\" : \"hash\", \n \"unique\" : true, \n \"fields\" : [ \n \"a\", \n \"b\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br> Creating a hash index: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --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/1140587688\", \n \"type\" : \"hash\", \n \"unique\" : false, \n \"fields\" : [ \n \"a\", \n \"b\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br>",
"nickname": "CreateHashIndex"
}
],
"path": "/_api/index"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the index already exists, then a <em>HTTP 200</em> is returned. <br><br>",
"code": "200"
},
{
"reason": "If the index does not already exist and could be created, then a <em>HTTP 201</em> is returned. <br><br>",
"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. <br><br>",
"code": "400"
},
{
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. <br><br>",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "query",
"required": "true",
"name": "collection-name",
"description": "The collection name. <br><br>"
},
{
"dataType": "Json",
"paramType": "body",
"required": "true",
"name": "index-details",
"description": "<br><br>"
}
],
"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> <ul class=\"swagger-list\"><li><em>type</em>: must be equal to <em>\"skiplist\"</em>. <li><em>fields</em>: A list of attribute paths. <li><em>unique</em>: If <em>true</em>, then create a unique index. </ul> <em>Note</em>: unique indexes on non-shard keys are not supported in a cluster. <br><br>",
"summary": " Create skip list",
"httpMethod": "POST",
"examples": "<br><br> Creating a skiplist: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --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/1141111976\", \n \"type\" : \"skiplist\", \n \"unique\" : false, \n \"fields\" : [ \n \"a\", \n \"b\" \n ], \n \"isNewlyCreated\" : true, \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br>",
"nickname": "CreateSkipList"
}
],
"path": "/_api/index"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the index already exists, then a <em>HTTP 200</em> is returned. <br><br>",
"code": "200"
},
{
"reason": "If the index does not already exist and could be created, then a <em>HTTP 201</em> is returned. <br><br>",
"code": "201"
},
{
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. <br><br>",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "query",
"required": "true",
"name": "collection-name",
"description": "The collection name. <br><br>"
},
{
"dataType": "Json",
"paramType": "body",
"required": "true",
"name": "index-details",
"description": "<br><br>"
}
],
"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> <ul class=\"swagger-list\"><li><em>type</em>: must be equal to <em>\"fulltext\"</em>. <li><em>fields</em>: A list of attribute names. Currently, the list is limited to exactly one attribute, so the value of <em>fields</em> should look like this for example: <em>[ \"text\" ]</em>. <li><em>minLength</em>: Minimum character length of words to index. Will default to a server-defined value if unspecified. It is thus recommended to set this value explicitly when creating the index.",
"summary": " Create fulltext index",
"httpMethod": "POST",
"examples": "<br><br> Creating a fulltext index: <br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --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/1141570728\", \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</code></pre><br><br><br>",
"nickname": "CreateFulltextIndex"
}
],
"path": "/_api/index"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the index already exists, then an <em>HTTP 200</em> is returned. <br><br>",
"code": "200"
},
{
"reason": "If the index does not already exist and could be created, then an <em>HTTP 201</em> is returned. <br><br>",
"code": "201"
},
{
"reason": "If an invalid index description is posted or attributes are used that the target index will not support, then an <em>HTTP 400</em> is returned. <br><br>",
"code": "400"
},
{
"reason": "If <em>collection</em> is unknown, then an <em>HTTP 404</em> is returned. <br><br>",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "query",
"required": "true",
"name": "collection",
"description": "The collection name. <br><br>"
},
{
"dataType": "Json",
"paramType": "body",
"required": "true",
"name": "index-details",
"description": "<br><br>"
}
],
"notes": "<br><br> Creates a new index in the collection <em>collection</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> 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> Indexing system attributes such as <em>_id</em>, <em>_key</em>, <em>_from</em>, and <em>_to</em> is not supported by any index type. Manually creating an index that relies on any of these attributes is unsupported. <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> <em>Note</em>: The following index types do not support uniqueness, and using the <em>unique</em> attribute with these types may lead to an error: <ul class=\"swagger-list\"><li>cap constraints <li>fulltext indexes </ul> <em>Note</em>: Unique indexes on non-shard keys are not supported in a cluster. <br><br>",
"summary": " Create index",
"httpMethod": "POST",
"examples": "",
"nickname": "CreateIndex"
}
],
"path": "/_api/index"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the index could be deleted, then an <em>HTTP 200</em> is returned. <br><br>",
"code": "200"
},
{
"reason": "If the <em>index-handle</em> is unknown, then an <em>HTTP 404</em> is returned.",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "query",
"required": "true",
"name": "index-handle",
"description": "The index handle. <br><br>"
}
],
"notes": "<br><br> Deletes an index with <em>index-handle</em>. <br><br>",
"summary": " Delete index",
"httpMethod": "DELETE",
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/index/products/1142095016\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/1142095016\", \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br>",
"nickname": "DeleteIndex"
}
],
"path": "/_api/index/{index-handle}"
}
]
}