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
|
||||
|
||||
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
|
||||
|
||||
|
|
|
@ -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 };
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue