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 @RESTDESCRIPTION
Returns an array of objects, which each have Returns an object with a single attribute `endpoints`, which contains an
the attribute `endpoint`, whose value is a string with the endpoint array of objects, which each have the attribute `endpoint`, whose value
description. There is an entry for each coordinator in the cluster. is a string with the endpoint description. There is an entry for each
This method only works on coordinators in cluster mode. coordinator in the cluster. This method only works on coordinators in
cluster mode.
@RESTRETURNCODES @RESTRETURNCODES

View File

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