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

163 lines
10 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"
}
],
"parameters": [],
"notes": "Retrieves the 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 list of database was compiled successfully. ",
"code": "200"
},
{
"reason": "is returned if the request is invalid. ",
"code": "400"
}
],
"parameters": [],
"notes": "Retrieves the list of all databases the current user can access without specifying a different username or password. <br><br>",
"summary": "retrieves a list of all databases the current user can access",
"httpMethod": "GET",
"examples": "<br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/database/user\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": "retrievesAListOfAllDatabasesTheCurrentUserCanAccess"
}
],
"path": "/_api/database/user"
},
{
"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.30582/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"
},
{
"reason": "is returned if a database with the specified name already exists. ",
"code": "409"
}
],
"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 \"database name\". <br><br>The request body can optionally contain an attribute <em>users</em>, which then must be a list of user objects to initially create for the new database. Each user object can contain the following attributes: <br><br>- <em>username</em>: the user name as a string. This attribute is mandatory.<br><br>- <em>passwd</em>: the user password as a string. If not specified, then it defaults to the empty string. <br><br>- <em>active</em>: a boolean flag indicating whether the user accout should be actived or not. The default value is <em>true</em>. <br><br>- <em>extra</em>: an optional JSON object with extra user information. The data contained in <em>extra</em> will be stored for the user but not be interpreted further by ArangoDB. <br><br>If <em>users</em> is not specified or does not contain any users, a default user <em>root</em> will be created with an empty string password. This ensures that the new database will be accessible after it is created. <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": "Creating a database named <em>example</em>. <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>Creating a database named <em>mydb</em> with two users. <br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/database\n{\"name\":\"mydb\",\"users\":[{\"username\":\"admin\",\"passwd\":\"secret\",\"active\":true},{\"username\":\"tester\",\"passwd\":\"test001\",\"active\":false}]}\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}"
}
]
}