10BC0 Removed redirects for some cluster rest handler by maierlars · Pull Request #14425 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

10BC0 Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
devel
-----

* Removed redirects from /_admin/cluster* to /_admin/cluster/*. Adjusted
internal requests to use the new url.

* Fix display of running and slow queries in web UI when there are multiple
coordinators. Previously, the display order of queries was undefined, which
could lead to queries from one coordinator being display on top once and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@startDocuBlock get_cluster_statistics
@brief allows to query the statistics of a DB-Server in the cluster

@RESTHEADER{GET /_admin/clusterStatistics, Queries statistics of a DB-Server}
@RESTHEADER{GET /_admin/cluster/statistics, Queries statistics of a DB-Server}

@RESTQUERYPARAMETERS

Expand All @@ -13,10 +13,12 @@ Queries the statistics of the given DB-Server

@RESTRETURNCODES

@RESTRETURNCODE{200} is returned when everything went well.
@RESTRETURNCODE{200}
is returned when everything went well.

@RESTRETURNCODE{400} the parameter DBserver was not given or is not the
ID of a DB-Server
@RESTRETURNCODE{400}
the parameter DBserver was not given or is not the ID of a DB-Server

@RESTRETURNCODE{403} server is not a Coordinator.
@RESTRETURNCODE{403}
server is not a DB-Server.
@endDocuBlock
1 change: 0 additions & 1 deletion arangod/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,6 @@ set(LIB_ARANGOSERVER_SOURCES
RestHandler/RestPleaseUpgradeHandler.cpp
RestHandler/RestQueryCacheHandler.cpp
RestHandler/RestQueryHandler.cpp
RestHandler/RestRedirectHandler.cpp
RestHandler/RestShutdownHandler.cpp
RestHandler/RestSimpleHandler.cpp
RestHandler/RestSimpleQueryHandler.cpp
Expand Down
17 changes: 0 additions & 17 deletions arangod/GeneralServer/GeneralServerFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
#include "RestHandler/RestPregelHandler.h"
#include "RestHandler/RestQueryCacheHandler.h"
#include "RestHandler/RestQueryHandler.h"
#include "RestHandler/RestRedirectHandler.h"
#include "RestHandler/RestShutdownHandler.h"
#include "RestHandler/RestSimpleHandler.h"
#include "RestHandler/RestSimpleQueryHandler.h"
Expand Down Expand Up @@ -631,22 +630,6 @@ void GeneralServerFeature::defineHandlers() {

_handlerFactory->addPrefixHandler("/", RestHandlerCreator<RestActionHandler>::createNoData);

// ...........................................................................
// redirects
// ...........................................................................

// UGLY HACK INCOMING!

#define ADD_REDIRECT(from, to) do{_handlerFactory->addPrefixHandler(from, \
RestHandlerCreator<RestRedirectHandler>::createData<const char*>, \
(void*) to);}while(0)

ADD_REDIRECT("/_admin/clusterNodeVersion", "/_admin/cluster/nodeVersion");
ADD_REDIRECT("/_admin/clusterNodeEngine", "/_admin/cluster/nodeEngine");
ADD_REDIRECT("/_admin/clusterNodeStats", "/_admin/cluster/nodeStatistics");
ADD_REDIRECT("/_admin/clusterStatistics", "/_admin/cluster/statistics");


// engine specific handlers
StorageEngine& engine = server().getFeature<EngineSelectorFeature>().engine();
engine.addRestHandlers(*_handlerFactory);
Expand Down
44 changes: 0 additions & 44 deletions arangod/RestHandler/RestRedirectHandler.cpp

This file was deleted.

47 changes: 0 additions & 47 deletions arangod/RestHandler/RestRedirectHandler.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
var stat = new window.Statistics({name: dbserver.id});
stat.url = coord.get('protocol') + '://' +
coord.get('address') +
'/_admin/clusterStatistics?DBserver=' +
'/_admin/cluster/statistics?DBserver=' +
dbserver.get('name');
self.statCollectDBS.add(stat);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@

stat.url = coord.get('protocol') + '://' +
coord.get('address') +
'/_admin/clusterStatistics?DBserver=' +
'/_admin/cluster/statistics?DBserver=' +
dbserver.get('name');

statCollect.add(stat);
Expand Down
18 changes: 3 additions & 15 deletions tests/js/client/authentication/admin-cluster-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,31 +51,19 @@ function AuthSuite() {
};

let checkClusterNodeVersion = function() {
// this will just redirect to a new endpoint
let result = arango.GET('/_admin/clusterNodeVersion?ServerID=' + servers[0]);
assertEqual(308, result.code);

result = arango.GET('/_admin/cluster/nodeVersion?ServerID=' + servers[0]);
let result = arango.GET('/_admin/cluster/nodeVersion?ServerID=' + servers[0]);
assertTrue(result.hasOwnProperty('server'), result);
assertTrue(result.hasOwnProperty('license'), result);
assertTrue(result.hasOwnProperty('version'), result);
};

let checkClusterNodeEngine = function() {
// this will just redirect to a new endpoint
let result = arango.GET('/_admin/clusterNodeEngine?ServerID=' + servers[0]);
assertEqual(308, result.code);

result = arango.GET('/_admin/cluster/nodeEngine?ServerID=' + servers[0]);
let result = arango.GET('/_admin/cluster/nodeEngine?ServerID=' + servers[0]);
assertTrue(result.hasOwnProperty('name'), result);
};

let checkClusterNodeStats = function() {
// this will just redirect to a new endpoint
let result = arango.GET('/_admin/clusterNodeStats?ServerID=' + servers[0]);
assertEqual(308, result.code);

result = arango.GET('/_admin/cluster/nodeStatistics?ServerID=' + servers[0]);
let result = arango.GET('/_admin/cluster/nodeStatistics?ServerID=' + servers[0]);
assertTrue(result.hasOwnProperty('time'), result);
assertTrue(result.hasOwnProperty('system'), result);
};
Expand Down
17 changes: 4 additions & 13 deletions tests/js/server/shell/shell-readonly-mode-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,7 @@ describe('Readonly mode api', function() {
}

let server = setReadOnlyAndGetDBServer();
let resp = download(endpoint + '/_admin/clusterNodeVersion?ServerID=' + server);
expect(resp.code).to.equal(308);

resp = download(endpoint + '/_admin/cluster/nodeVersion?ServerID=' + server);
let resp = download(endpoint + '/_admin/cluster/nodeVersion?ServerID=' + server);
expect(resp.code).to.equal(200);
});

Expand All @@ -166,23 +163,17 @@ describe('Readonly mode api', function() {
}

let server = setReadOnlyAndGetDBServer();
let resp = download(endpoint + '/_admin/clusterNodeEngine?ServerID=' + server);
expect(resp.code).to.equal(308);

resp = download(endpoint + '/_admin/cluster/nodeEngine?ServerID=' + server);
let resp = download(endpoint + '/_admin/cluster/nodeEngine?ServerID=' + server);
expect(resp.code).to.equal(200);
});

it('can still access cluster/nodeStats API when readonly', function() {
it('can still access cluster/nodeStatistics API when readonly', function() {
if (!isCluster) {
return;
}

let server = setReadOnlyAndGetDBServer();
let resp = download(endpoint + '/_admin/clusterNodeStats?ServerID=' + server);
expect(resp.code).to.equal(308);

resp = download(endpoint + '/_admin/cluster/nodeStatistics?ServerID=' + server);
let resp = download(endpoint + '/_admin/cluster/nodeStatistics?ServerID=' + server);
expect(resp.code).to.equal(200);
});

Expand Down
0