diff --git a/api/config.cc b/api/config.cc index d7a1a25198..c4e5cc25c3 100644 --- a/api/config.cc +++ b/api/config.cc @@ -10,6 +10,7 @@ #include "api/config.hh" #include "api/api-doc/config.json.hh" #include "api/api-doc/storage_proxy.json.hh" +#include "api/api-doc/storage_service.json.hh" #include "replica/database.hh" #include "db/config.hh" #include @@ -19,6 +20,7 @@ namespace api { using namespace seastar::httpd; namespace sp = httpd::storage_proxy_json; +namespace ss = httpd::storage_service_json; template json::json_return_type get_json_return_type(const T& val) { @@ -183,6 +185,14 @@ void set_config(std::shared_ptr < api_registry_builder20 > rb, http_context& ctx return make_ready_future(seastar::json::json_void()); }); + ss::get_all_data_file_locations.set(r, [&cfg](const_req req) { + return container_to_vec(cfg.data_file_directories()); + }); + + ss::get_saved_caches_location.set(r, [&cfg](const_req req) { + return cfg.saved_caches_directory(); + }); + } void unset_config(http_context& ctx, routes& r) { @@ -201,6 +211,8 @@ void unset_config(http_context& ctx, routes& r) { sp::set_range_rpc_timeout.unset(r); sp::get_truncate_rpc_timeout.unset(r); sp::set_truncate_rpc_timeout.unset(r); + ss::get_all_data_file_locations.unset(r); + ss::get_saved_caches_location.unset(r); } } diff --git a/api/storage_service.cc b/api/storage_service.cc index 47dd9a4f24..979fd0530b 100644 --- a/api/storage_service.cc +++ b/api/storage_service.cc @@ -610,14 +610,6 @@ void set_storage_service(http_context& ctx, routes& r, sharded req) -> future { auto keyspace = validate_keyspace(ctx, req); auto table = req->get_query_param("cf"); @@ -1559,8 +1551,6 @@ void unset_storage_service(http_context& ctx, routes& r) { ss::get_release_version.unset(r); ss::get_scylla_release_version.unset(r); ss::get_schema_version.unset(r); - ss::get_all_data_file_locations.unset(r); - ss::get_saved_caches_location.unset(r); ss::get_range_to_endpoint_map.unset(r); ss::get_pending_range_to_endpoint_map.unset(r); ss::describe_ring.unset(r);