| **ceph** **compact**
-| **ceph** **config-key** [ *del* | *exists* | *get* | *list* | *put* ] ...
+| **ceph** **config-key** [ *del* | *exists* | *get* | *list* | *dump* | *put* ] ...
| **ceph** **daemon** *<name>* \| *<path>* *<command>* ...
ceph config-key list
-Subcommand ``put`` puts configuration key and values.
+Subcommand ``dump`` dumps configuration keys and values.
+
+Usage::
+
+ ceph config-key dump
+
+Subcommand ``put`` puts configuration key and value.
Usage::
f.flush(ss);
}
+void ConfigKeyService::store_dump(stringstream &ss)
+{
+ KeyValueDB::Iterator iter =
+ mon->store->get_iterator(STORE_PREFIX);
+
+ JSONFormatter f(true);
+ f.open_object_section("config-key store");
+
+ while (iter->valid()) {
+ f.dump_string(iter->key().c_str(), iter->value().to_str());
+ iter->next();
+ }
+ f.close_section();
+ f.flush(ss);
+}
bool ConfigKeyService::service_dispatch(MonOpRequestRef op)
{
store_list(tmp_ss);
rdata.append(tmp_ss);
ret = 0;
+
+ } else if (prefix == "config-key dump") {
+ stringstream tmp_ss;
+ store_dump(tmp_ss);
+ rdata.append(tmp_ss);
+ ret = 0;
}
out:
void store_put(const string &key, bufferlist &bl, Context *cb = NULL);
void store_delete(const string &key, Context *cb = NULL);
void store_list(stringstream &ss);
+ void store_dump(stringstream &ss);
bool store_exists(const string &key);
static const string STORE_PREFIX;
"name=key,type=CephString", \
"check for <key>'s existence", "config-key", "r", "cli,rest")
COMMAND("config-key list ", "list keys", "config-key", "r", "cli,rest")
+COMMAND("config-key dump", "dump keys and values", "config-key", "r", "cli,rest")
/*
def test_exists(self):
self.check_1_string_arg('config-key', 'exists')
+ def test_dump(self):
+ self.check_no_arg('config-key', 'dump')
+
def test_list(self):
self.check_no_arg('config-key', 'list')
# Local Variables: