-------------
Use the command ``ceph mgr module ls`` to see which modules are
-available, and which are currently enabled. Use ``ceph mgr module ls detail``
+available, and which are currently enabled. Use ``ceph mgr module ls --format=json-pretty``
to view detailed metadata about disabled modules. Enable or disable modules
using the commands ``ceph mgr module enable <module>`` and
``ceph mgr module disable <module>`` respectively.
#include "HealthMonitor.h"
#include "common/TextTable.h"
-#include "common/cmdparse.h"
#include "include/stringify.h"
#include "MgrMonitor.h"
string prefix;
cmd_getval(cmdmap, "prefix", prefix);
-
int r = 0;
if (prefix == "mgr stat") {
}
f->flush(rdata);
} else if (prefix == "mgr module ls") {
- string detail;
- cmd_getval(cmdmap, "detail", detail);
- if (f || (detail == "detail")) {
- if (!f) {
- f.reset(Formatter::create(format, "json-pretty", "json-pretty"));
- }
+ if (f) {
f->open_object_section("modules");
{
f->open_array_section("always_on_modules");
for (auto& p : map.available_modules) {
if (map.modules.count(p.name) == 0 &&
map.get_always_on_modules().count(p.name) == 0) {
- if (detail == "detail") {
- // For disabled modules, we show the full info if the detail
- // parameter is enabled, to give a hint about whether enabling it will work
- p.dump(f.get());
- } else {
- // Otherwise, we give a shortened summary by default
- f->dump_string("module", p.name);
- }
+ // For disabled modules, we show the full info if the detail
+ // parameter is enabled, to give a hint about whether enabling it will work
+ p.dump(f.get());
}
}
f->close_section();
"mgr", "r")
COMMAND("mgr fail name=who,type=CephString,req=false",
"treat the named manager daemon as failed", "mgr", "rw")
-COMMAND("mgr module ls name=detail,type=CephChoices,strings=detail,req=false",
+COMMAND("mgr module ls",
"list active mgr modules", "mgr", "r")
COMMAND("mgr services",
"list service endpoints provided by mgr modules",