1
0
Fork 0

Revise /_api/cluster/endpoints API and Documentation.

This commit is contained in:
Max Neunhoeffer 2017-03-16 11:32:07 +01:00
parent 215937a884
commit 4017bfb296
2 changed files with 8 additions and 5 deletions

View File

@ -5,10 +5,11 @@
@RESTDESCRIPTION
Returns an array of objects, which each have
the attribute `endpoint`, whose value is a string with the endpoint
description. There is an entry for each coordinator in the cluster.
This method only works on coordinators in cluster mode.
Returns an object with a single attribute `endpoints`, which contains an
array of objects, which each have the attribute `endpoint`, whose value
is a string with the endpoint description. There is an entry for each
coordinator in the cluster. This method only works on coordinators in
cluster mode.
@RESTRETURNCODES

View File

@ -2077,7 +2077,9 @@ function endpoints() {
try {
let coords = global.ArangoClusterInfo.getCoordinators();
let endpoints = coords.map(c => global.ArangoClusterInfo.getServerEndpoint(c));
return endpoints.map(function(e) { return {"endpoint": e}; });
return { "endpoints": endpoints.map(function(e) {
return {"endpoint": e};
}) };
} catch (err) {
return { error: true, exception: err };
}