mirror of https://gitee.com/bigwinds/arangodb
/_admin/shutdown will now need a DELETE request
This commit is contained in:
parent
0ffed98bd3
commit
496454df3f
|
@ -718,6 +718,10 @@ API:
|
|||
- `/_api/structure`: an older unfinished and unpromoted API for data format and type
|
||||
checks, superseded by Foxx applications.
|
||||
|
||||
!SUBSECTION Administration APIs
|
||||
|
||||
- `/_admin/shutdown` now needs to be called with the DELETE method
|
||||
|
||||
!SUBSECTION Handling of CORS requests
|
||||
|
||||
It can now be controlled in detail for which origin hosts CORS (Cross-origin resource
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
@startDocuBlock JSF_get_api_initiate
|
||||
@brief initiates the shutdown sequence
|
||||
|
||||
@RESTHEADER{GET /_admin/shutdown, Initiate shutdown sequence}
|
||||
@RESTHEADER{DELETE /_admin/shutdown, Initiate shutdown sequence}
|
||||
|
||||
@RESTDESCRIPTION
|
||||
This call initiates a clean shutdown sequence.
|
||||
|
|
|
@ -42,6 +42,11 @@ bool RestShutdownHandler::isDirect() const { return true; }
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
HttpHandler::status_t RestShutdownHandler::execute() {
|
||||
if (_request->requestType() != GeneralRequest::RequestType::DELETE_REQ) {
|
||||
generateError(GeneralResponse::ResponseCode::METHOD_NOT_ALLOWED, 405);
|
||||
return HttpHandler::status_t(HANDLER_DONE);
|
||||
}
|
||||
|
||||
ApplicationServer::server->beginShutdown();
|
||||
|
||||
try {
|
||||
|
|
|
@ -2333,7 +2333,7 @@
|
|||
}
|
||||
},
|
||||
"/_admin/shutdown": {
|
||||
"get": {
|
||||
"delete": {
|
||||
"description": "\n\nThis call initiates a clean shutdown sequence.\n\n",
|
||||
"parameters": [],
|
||||
"responses": {
|
||||
|
|
|
@ -1146,9 +1146,11 @@ function shutdownArangod(arangod, options) {
|
|||
}
|
||||
if (arangod.exitStatus === undefined ||
|
||||
arangod.exitStatus.status === "RUNNING") {
|
||||
const requestOptions = makeAuthorizationHeaders(options);
|
||||
requestOptions.method = "DELETE";
|
||||
|
||||
print(arangod.url + "/_admin/shutdown");
|
||||
download(arangod.url + "/_admin/shutdown", "",
|
||||
makeAuthorizationHeaders(options));
|
||||
download(arangod.url + "/_admin/shutdown", "", requestOptions);
|
||||
} else {
|
||||
print("Server already dead, doing nothing.");
|
||||
}
|
||||
|
|
|
@ -193,7 +193,7 @@ function main(argv) {
|
|||
|
||||
if (startServer) {
|
||||
if (typeof(instanceInfo.exitStatus) === 'undefined') {
|
||||
download(instanceInfo.url + "/_admin/shutdown", "");
|
||||
download(instanceInfo.url + "/_admin/shutdown", "", {method: "DELETE"});
|
||||
|
||||
print("Waiting for server shut down");
|
||||
count = 0;
|
||||
|
|
Loading…
Reference in New Issue