/* * Copyright (C) 2015-present ScyllaDB */ /* * This file is part of Scylla. * * Scylla is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Scylla is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Scylla. If not, see . */ #pragma once #include #include "api.hh" #include "db/data_listeners.hh" namespace cql_transport { class controller; } class thrift_controller; namespace db { class snapshot_ctl; namespace view { class view_builder; } } namespace netw { class messaging_service; } class repair_service; namespace cdc { class generation_service; } class sstables_loader; namespace gms { class gossiper; } namespace api { // verify that the keyspace parameter is found, otherwise a bad_param_exception exception is thrown // containing the description of the respective keyspace error. sstring validate_keyspace(http_context& ctx, const parameters& param); // splits a request parameter assumed to hold a comma-separated list of table names // verify that the tables are found, otherwise a bad_param_exception exception is thrown // containing the description of the respective no_such_column_family error. std::vector parse_tables(const sstring& ks_name, http_context& ctx, const std::unordered_map& query_params, sstring param_name); void set_storage_service(http_context& ctx, routes& r, sharded& ss, gms::gossiper& g, sharded& cdc_gs); void set_sstables_loader(http_context& ctx, routes& r, sharded& sst_loader); void unset_sstables_loader(http_context& ctx, routes& r); void set_view_builder(http_context& ctx, routes& r, sharded& vb); void unset_view_builder(http_context& ctx, routes& r); void set_repair(http_context& ctx, routes& r, sharded& repair); void unset_repair(http_context& ctx, routes& r); void set_transport_controller(http_context& ctx, routes& r, cql_transport::controller& ctl); void unset_transport_controller(http_context& ctx, routes& r); void set_rpc_controller(http_context& ctx, routes& r, thrift_controller& ctl); void unset_rpc_controller(http_context& ctx, routes& r); void set_snapshot(http_context& ctx, routes& r, sharded& snap_ctl); void unset_snapshot(http_context& ctx, routes& r); seastar::future run_toppartitions_query(db::toppartitions_query& q, http_context &ctx, bool legacy_request = false); }