diff --git a/test/nodetool/test_nodeops.py b/test/nodetool/test_nodeops.py new file mode 100644 index 0000000000..e4cbdc51c8 --- /dev/null +++ b/test/nodetool/test_nodeops.py @@ -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")]) diff --git a/tools/scylla-nodetool.cc b/tools/scylla-nodetool.cc index 70d639ecab..9ec2953835 100644 --- a/tools/scylla-nodetool.cc +++ b/tools/scylla-nodetool.cc @@ -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",