mirror of https://gitee.com/bigwinds/arangodb
Revise /_api/cluster/endpoints API and Documentation.
This commit is contained in:
parent
215937a884
commit
4017bfb296
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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 };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue