{ "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 _system database. ", "code": "403" } ], "parameters": [], "notes": "Retrieves the list of all existing databases

Note: retrieving the list of databases is only possible from within the _system database.

", "summary": "retrieves a list of all existing databases", "httpMethod": "GET", "examples": "

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

", "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.

", "summary": "retrieves a list of all databases the current user can access", "httpMethod": "GET", "examples": "

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

", "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

The response is a JSON object with the following attributes:

- name: the name of the current database

- id: the id of the current database

- path: the filesystem path of the current database

- isSystem: whether or not the current database is the _system database

", "summary": "retrieves information about the current database", "httpMethod": "GET", "examples": "

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.28625/databases/database-82343\", \n    \"isSystem\" : true \n  }, \n  \"error\" : false, \n  \"code\" : 200 \n}\n\n

", "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 _system 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

The request body must be a JSON object with the attribute name. name must contain a valid the manual \"database name\".

The request body can optionally contain an attribute users, which then must be a list of user objects to initially create for the new database. Each user object can contain the following attributes:

- username: the user name as a string. This attribute is mandatory.

- passwd: the user password as a string. If not specified, then it defaults to the empty string.

- active: a boolean flag indicating whether the user accout should be actived or not. The default value is true.

- extra: an optional JSON object with extra user information. The data contained in extra will be stored for the user but not be interpreted further by ArangoDB.

If users is not specified or does not contain any users, a default user root will be created with an empty string password. This ensures that the new database will be accessible after it is created.

The response is a JSON object with the attribute result set to true.

Note: creating a new database is only possible from within the _system database.

", "summary": "creates a new database", "httpMethod": "POST", "examples": "Creating a database named example.

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

Creating a database named mydb with two users.

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

", "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 _system 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.

Note: dropping a database is only possible from within the _system database. The _system database itself cannot be dropped.

", "summary": "drops an existing database", "httpMethod": "DELETE", "examples": "

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

", "nickname": "dropsAnExistingDatabase" } ], "path": "/_api/database/{database-name}" } ] }