]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon: annotate more tell commands
authorKefu Chai <kchai@redhat.com>
Tue, 19 Nov 2019 02:57:38 +0000 (10:57 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 20 Dec 2019 07:56:04 +0000 (15:56 +0800)
currently, the only consumer of the annotated tell commands is
`Monitor::handle_tell_command()`, which check the cap of the client
against the required permission of the command to be executed.

if the command is not annotated, it's assumed that the command requires
"mon rwx".

because the asock commands are registered at runtime using
`AdminSocket::register_command()`, and there are some asock commands are
shared by all ceph applications using asock facility, without a proper
machinary, we cannot annotate all of them and populate this annotated
commands to all these ceph applications. so, at this moment, only
a subset of asock commands are annotated.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/MonCommands.h

index 07740542a874d5945d427364959db6655a64299f..13ed7b16acfef4574fd6a4768aa6326671eaeaae 100644 (file)
@@ -1251,6 +1251,36 @@ COMMAND_WITH_FLAG("smart name=devid,type=CephString,req=false",
 COMMAND_WITH_FLAG("mon_status", "report status of monitors", "mon", "r",
                  FLAG(NOFORWARD)|FLAG(HIDDEN))
 COMMAND_WITH_FLAG("heap "                                              \
-            "name=heapcmd,type=CephChoices,strings=dump|start_profiler|stop_profiler|release|stats", \
+            "name=heapcmd,type=CephChoices,strings=dump|start_profiler|stop_profiler|release|stats "
+            "name=value,type=CephString,req=false",
             "show heap usage info (available only if compiled with tcmalloc)", \
                  "mon", "rw", FLAG(NOFORWARD)|FLAG(HIDDEN))
+COMMAND_WITH_FLAG("sync_force "                                                \
+            "name=validate,type=CephChoices,strings=--yes-i-really-mean-it,req=false",
+            "force sync of and clear monitor store",
+            "mon", "rw", FLAG(NOFORWARD)|FLAG(HIDDEN))
+COMMAND_WITH_FLAG("add_bootstrap_peer_hint "
+            "name=addr,type=CephIPAddr",
+            "add peer address as potential bootstrap "
+            "peer for cluster bringup",
+            "mon", "rw", FLAG(NOFORWARD)|FLAG(HIDDEN))
+COMMAND_WITH_FLAG("add_bootstrap_peer_hintv "
+            "name=addrv,type=CephString",
+            "add peer address vector as potential bootstrap "
+            "peer for cluster bringup",
+            "mon", "rw", FLAG(NOFORWARD)|FLAG(HIDDEN))
+COMMAND_WITH_FLAG("quorum enter ",
+            "force monitor back into quorum",
+            "mon", "rw", FLAG(NOFORWARD)|FLAG(HIDDEN))
+COMMAND_WITH_FLAG("quorum exit",
+            "force monitor out of the quorum",
+            "mon", "rw", FLAG(NOFORWARD)|FLAG(HIDDEN))
+COMMAND_WITH_FLAG("ops",
+            "show the ops currently in flight",
+            "mon", "r", FLAG(NOFORWARD)|FLAG(HIDDEN))
+COMMAND_WITH_FLAG("sessions",
+            "list existing sessions",
+            "mon", "r", FLAG(NOFORWARD)|FLAG(HIDDEN))
+COMMAND_WITH_FLAG("dump_historic_ops",
+            "dump_historic_ops",
+            "mon", "r", FLAG(NOFORWARD)|FLAG(HIDDEN))