| 28 | } |
| 29 | |
| 30 | XResult Client::GetResponse(const httplib::Result &res, Json::Value &response) |
| 31 | { |
| 32 | if (res.error() != httplib::Error::Success || res == nullptr) { |
| 33 | XWARN("failed to get response, error: %s", httplib::to_string(res.error()).c_str()); |
| 34 | return kXSchedErrorBadResponse; |
| 35 | } |
| 36 | |
| 37 | if (res->status != httplib::StatusCode::OK_200) { |
| 38 | XWARN("failed to list XQueues, response code: %d, message: %s", |
| 39 | res->status, res->body.c_str()); |
| 40 | return kXSchedErrorBadResponse; |
| 41 | } |
| 42 | |
| 43 | if (!json_reader_.parse(res->body, response, false)) { |
| 44 | XWARN("failed to parse response, message: %s", res->body.c_str()); |
| 45 | return kXSchedErrorBadResponse; |
| 46 | } |
| 47 | |
| 48 | return kXSchedSuccess; |
| 49 | } |
| 50 | |
| 51 | XResult Client::QueryXQueues(std::vector<sched::XQueueStatus> &xqueue_status, |
| 52 | std::unordered_map<PID, std::string> &cmdlines) |
nothing calls this directly
no outgoing calls
no test coverage detected