char *cmd_json = nullptr;
char *tag = nullptr;
+ char *inbuf_ptr = nullptr;
+ Py_ssize_t inbuf_len = 0;
+ bufferlist inbuf = {};
+
PyObject *completion = nullptr;
- if (!PyArg_ParseTuple(args, "Ossss:ceph_send_command",
- &completion, &type, &name, &cmd_json, &tag)) {
+ if (!PyArg_ParseTuple(args, "Ossssz#:ceph_send_command",
+ &completion, &type, &name, &cmd_json, &tag, &inbuf_ptr, &inbuf_len)) {
return nullptr;
}
+ if (inbuf_ptr) {
+ inbuf.append(inbuf_ptr, (unsigned)inbuf_len);
+ }
+
auto set_fn = PyObject_GetAttrString(completion, "complete");
if (set_fn == nullptr) {
ceph_abort(); // TODO raise python exception instead
self->py_modules->get_monc().start_mon_command(
name,
{cmd_json},
- {},
+ inbuf,
&command_c->outbl,
&command_c->outs,
new C_OnFinisher(c, &self->py_modules->cmd_finisher));
self->py_modules->get_objecter().osd_command(
osd_id,
{cmd_json},
- {},
+ inbuf,
&tid,
&command_c->outbl,
&command_c->outs,
int r = self->py_modules->get_client().mds_command(
name,
{cmd_json},
- {},
+ inbuf,
&command_c->outbl,
&command_c->outs,
new C_OnFinisher(command_c, &self->py_modules->cmd_finisher));
self->py_modules->get_objecter().pg_command(
pgid,
{cmd_json},
- {},
+ inbuf,
&tid,
&command_c->outbl,
&command_c->outs,
self->py_modules->set_health_checks(self->this_module->get_name(),
std::move(out_checks));
PyEval_RestoreThread(tstate);
-
+
Py_RETURN_NONE;
}
def _ceph_get_latest_counter(self, svc_type, svc_name, path):...
def _ceph_get_metadata(self, svc_type, svc_id):...
def _ceph_get_daemon_status(self, svc_type, svc_id):...
- def _ceph_send_command(self, *args, **kwargs):...
+ def _ceph_send_command(self, result, svc_type, svc_id, command, tag, inbuf):...
def _ceph_set_health_checks(self, checks):...
def _ceph_get_mgr_id(self):...
def _ceph_get_option(self, key):...