tools/scylla-nodetool: implement the decommission command

This commit is contained in:
Botond Dénes
2023-12-08 06:02:50 -05:00
parent 9c0f05efa1
commit ea62f7c848
2 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
#
# Copyright 2023-present ScyllaDB
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#
from rest_api_mock import expected_request
def test_decommission(nodetool):
nodetool("decommission", expected_requests=[
expected_request("POST", "/storage_service/decommission")])

View File

@@ -347,6 +347,11 @@ void compactionhistory_operation(scylla_rest_client& client, const bpo::variable
}
}
void decommission_operation(scylla_rest_client& client, const bpo::variables_map& vm) {
client.post("/storage_service/decommission");
}
void disableautocompaction_operation(scylla_rest_client& client, const bpo::variables_map& vm) {
if (!vm.count("keyspace")) {
for (const auto& keyspace : get_keyspaces(client)) {
@@ -773,6 +778,16 @@ Fore more information, see: https://opensource.docs.scylladb.com/stable/operatin
},
compactionhistory_operation
},
{
{
"decommission",
"Deactivate a selected node by streaming its data to the next node in the ring",
R"(
Fore more information, see: https://opensource.docs.scylladb.com/stable/operating-scylla/nodetool-commands/decommission.html
)",
},
decommission_operation
},
{
{
"disableautocompaction",