0

In the documentation I only find information on how to retrieve the list of endpoints, but not how to add a database to the endpoint. How does it work?

3 Answers 3

2

The endpoint is the IP address/port the ArangoDB instance will listen on for incoming requests. The default endpoint for ArangoDB is 127.0.0.1:8529, but often this is changed to another IP address/port combination. Normally you will want to have just one or two endpoints, which you don't want to change while the server is running.

If you have the endpoint for the ArangoDB instance, you can make HTTP requests to it. There is one type of requests that can create a new database within the ArangoDB instance (see manual).

An example HTTP request (using curl) for creating a database is:

curl -X POST --data-binary "{\"name\":\"example\"}" --dump - http://127.0.0.1:8529/_api/database

From the ArangoShell you can also add a database using the db._createDatabase() function.

Sign up to request clarification or add additional context in comments.

Comments

0

The creation of databases was known to me. My concern is that a specific endpoint may be used by only certain databases.

With GET / _api / endpoint can I get the list of endpoints with their databases, but how do I add databases in this list?

1 Comment

You can use the create database api to create new databases which then in term will appear on that list.
0

you can use the create database api to create new databases:

shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/database <<EOF
{ 
  "name" : "example" 
}
EOF

HTTP/1.1 201 Created
content-type: application/json; charset=utf-8

{ 
  "result" : true, 
  "error" : false, 
  "code" : 201 
}

which then in term will appear on that list.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.