/*
* Note: parse_cmd() is executed with servers_tbl_rwlock held as shared
*/
-AdminSocket::maybe_parsed_t AdminSocket::parse_cmd(std::string cmd,
- ceph::bufferlist& out)
+AdminSocket::maybe_parsed_t
+AdminSocket::parse_cmd(const std::vector<std::string>& cmd, ceph::bufferlist& out)
{
// preliminaries:
// - create the formatter specified by the cmd parameters
try {
stringstream errss;
// note that cmdmap_from_json() may throw on syntax issues
- if (!cmdmap_from_json({cmd}, &cmdmap, errss)) {
+ if (!cmdmap_from_json(cmd, &cmdmap, errss)) {
logger().error("{}: incoming command error: {}", __func__, errss.str());
out.append("error:"s);
out.append(errss.str());
return seastar::with_shared(servers_tbl_rwlock,
[this, cmdline, &out]() mutable {
ceph::bufferlist err;
- auto parsed = parse_cmd(cmdline, err);
+ auto parsed = parse_cmd({cmdline}, err);
if (!parsed.has_value() ||
!validate_command(*parsed, cmdline, err)) {
return finalize_response(out, std::move(err));
seastar::gate stop_gate;
/**
- * parse the incoming command line into the sequence of words that identifies
+ * parse the incoming command into the sequence of words that identifies
* the API, and into its arguments. Locate the command string in the
* registered blocks.
*/
- maybe_parsed_t parse_cmd(std::string command_text, bufferlist& out);
+ maybe_parsed_t parse_cmd(const std::vector<std::string>& cmd, bufferlist& out);
/**
* The servers table is protected by a rw-lock, to be acquired exclusively