mirror of https://gitee.com/bigwinds/arangodb
140 lines
7.7 KiB
JSON
140 lines
7.7 KiB
JSON
{
|
|
"basePath": "/",
|
|
"swaggerVersion": "1.1",
|
|
"apiVersion": "0.1",
|
|
"apis": [
|
|
{
|
|
"operations": [
|
|
{
|
|
"errorResponses": [
|
|
{
|
|
"reason": "is returned if the list of database was compiled successfully. ",
|
|
"code": "200"
|
|
},
|
|
{
|
|
"reason": "is returned if the request is invalid. ",
|
|
"code": "400"
|
|
},
|
|
{
|
|
"reason": "is returned if the request was not executed in the <em>_system</em> database. ",
|
|
"code": "403"
|
|
},
|
|
{
|
|
"reason": "is returned if the database could not be found. ",
|
|
"code": "404"
|
|
}
|
|
],
|
|
"parameters": [],
|
|
"notes": "Retrieves a list of all existing databases <br><br>Note: retrieving the list of databases is only possible from within the <em>_system</em> database. <br><br>",
|
|
"summary": "retrieves a list of all existing databases",
|
|
"httpMethod": "GET",
|
|
"examples": "<br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/database\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n \"_system\" \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
|
"nickname": "retrievesAListOfAllExistingDatabases"
|
|
}
|
|
],
|
|
"path": "/_api/database"
|
|
},
|
|
{
|
|
"operations": [
|
|
{
|
|
"errorResponses": [
|
|
{
|
|
"reason": "is returned if the information was retrieved successfully. ",
|
|
"code": "200"
|
|
},
|
|
{
|
|
"reason": "is returned if the request is invalid. ",
|
|
"code": "400"
|
|
},
|
|
{
|
|
"reason": "is returned if the database could not be found. ",
|
|
"code": "404"
|
|
}
|
|
],
|
|
"parameters": [],
|
|
"notes": "Retrieves information about the current database <br><br>The response is a JSON object with the following attributes: <br><br>- <em>name</em>: the name of the current database<br><br>- <em>id</em>: the id of the current database<br><br>- <em>path</em>: the filesystem path of the current database<br><br>- <em>isSystem</em>: whether or not the current database is the <em>_system</em> database<br><br>",
|
|
"summary": "retrieves information about the current database",
|
|
"httpMethod": "GET",
|
|
"examples": "<br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/database/current\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"name\" : \"_system\", \n \"id\" : \"82343\", \n \"path\" : \"/tmp/vocdir.6003/databases/database-82343\", \n \"isSystem\" : true \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
|
"nickname": "retrievesInformationAboutTheCurrentDatabase"
|
|
}
|
|
],
|
|
"path": "/_api/database/current"
|
|
},
|
|
{
|
|
"operations": [
|
|
{
|
|
"errorResponses": [
|
|
{
|
|
"reason": "is returned if the database was created successfully. ",
|
|
"code": "200"
|
|
},
|
|
{
|
|
"reason": "is returned if the request parameters are invalid or if a database with the specified name already exists. ",
|
|
"code": "400"
|
|
},
|
|
{
|
|
"reason": "is returned if the request was not executed in the <em>_system</em> database. ",
|
|
"code": "403"
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"dataType": "Json",
|
|
"paramType": "body",
|
|
"required": "true",
|
|
"name": "body",
|
|
"description": "the body with the name of the database. "
|
|
}
|
|
],
|
|
"notes": "Creates a new database <br><br>The request body must be a JSON object with the attribute <em>name</em>. <em>name</em> must contain a valid the manual. <br><br>The response is a JSON object with the attribute <em>result</em> set to <em>true</em>. <br><br>Note: creating a new database is only possible from within the <em>_system</em> database. <br><br>",
|
|
"summary": "creates a new database",
|
|
"httpMethod": "POST",
|
|
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/database\n{\"name\":\"example\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
|
"nickname": "createsANewDatabase"
|
|
}
|
|
],
|
|
"path": "/_api/database"
|
|
},
|
|
{
|
|
"operations": [
|
|
{
|
|
"errorResponses": [
|
|
{
|
|
"reason": "is returned if the database was dropped successfully. ",
|
|
"code": "200"
|
|
},
|
|
{
|
|
"reason": "is returned if the request is malformed. ",
|
|
"code": "400"
|
|
},
|
|
{
|
|
"reason": "is returned if the request was not executed in the <em>_system</em> database. ",
|
|
"code": "403"
|
|
},
|
|
{
|
|
"reason": "is returned if the database could not be found. ",
|
|
"code": "404"
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"dataType": "String",
|
|
"paramType": "path",
|
|
"required": "true",
|
|
"name": "database-name",
|
|
"description": "The name of the database "
|
|
}
|
|
],
|
|
"notes": "Deletes the database along with all data stored in it. <br><br>Note: dropping a database is only possible from within the <em>_system</em> database. The <em>_system</em> database itself cannot be dropped. <br><br>",
|
|
"summary": "drops an existing database",
|
|
"httpMethod": "DELETE",
|
|
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/database/example\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
|
"nickname": "dropsAnExistingDatabase"
|
|
}
|
|
],
|
|
"path": "/_api/database/{database-name}"
|
|
}
|
|
]
|
|
}
|