Commit Graph

8 Commits

Author SHA1 Message Date
John Mulligan 665611d054 rados: add MonCommandTarget & MonCommandTargetWithInputBuffer functions
These functions wrap rados_mon_command_target and allow the user to send
"command JSON" to specific MONs.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-27 13:38:07 -04:00
John Mulligan 40f80cc846 rados: add OsdCommand & OsdCommandWithInputBuffer functions
These functions wrap rados_osd_command and allow the user to send
"command JSON" to OSDs.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-27 13:38:07 -04:00
John Mulligan 4b24a7849e rados: remove redundant private xxxCommand functions
These private functions with names like monCommand and pgCommand were no
different from the public xxxCommandWithInputBuffer commands. Thus the
redundant private functions are removed to simplify the file. As private
functions these can be added back later w/o fuss if the behavior of
the xxxCommand and xxxCommandWithInputBuffer calls need to differ more
in the future.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-27 13:38:07 -04:00
John Mulligan e2a78eec02 cutil: allow passing free functions to command output type
The *_command functions in librados and libcephfs document the use
of specific free functions for data allocated. These functions are
currently just wrappers around C's free() function. However, to be
more strictly compliant this change adds a free-function callback
to the CommandOutput type and the specific free functions are now
used outside the unit tests.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-12 17:18:08 -04:00
John Mulligan 817b6b68c2 rados: replace copy-n-paste *_command functions argument handling
Replace the argument handling (wrangling?) around *_command functions,
such as MonCommand, with the new command input and output helper types
from the internal/cutil package.
No external change should be visible.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-05-12 17:18:08 -04:00
John Mulligan fb2736dd0a rados: add MgrCommand and MgrCommandWithInputBuffer functions
Add functions for issuing commands to ceph mgrs with
MgrCommand and MgrCommandWithInputBuffer, implemented simliarly
to the other *Command style functions.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-04-27 14:38:16 -04:00
John Mulligan ff805ee1e1 rados: remove named return values in command.go
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-04-27 14:38:16 -04:00
John Mulligan 79dfe8e631 rados: move *Command functions into a separate file
Organize the rados package a bit more by moving functions that wrap
rados_xyz_command functions into a dedicated file. Move related test to
a separate file as well.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2020-04-27 14:38:16 -04:00