]>
git.proxmox.com Git - ceph.git/blob - ceph/src/mgr/MgrContext.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2016 John Spray <john.spray@redhat.com>
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
14 #ifndef MGR_CONTEXT_H_
15 #define MGR_CONTEXT_H_
19 #include "common/ceph_json.h"
20 #include "common/Cond.h"
21 #include "mon/MonClient.h"
28 ceph::buffer::list outbl
;
32 void run(MonClient
*monc
, const std::string
&command
)
34 monc
->start_mon_command({command
}, {},
35 &outbl
, &outs
, &cond
);
38 void run(MonClient
*monc
, const std::string
&command
, const ceph::buffer::list
&inbl
)
40 monc
->start_mon_command({command
}, inbl
,
41 &outbl
, &outs
, &cond
);
53 class JSONCommand
: public Command
56 json_spirit::mValue json_result
;
63 bool read_ok
= json_spirit::read(
64 outbl
.to_str(), json_result
);