diff options
author | Samikshan Bairagya <samikshan@gmail.com> | 2017-07-23 22:07:34 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2017-07-25 05:04:47 +0000 |
commit | 8dcf91660e0bd10eb75ef25a29ca02ec51c81be4 (patch) | |
tree | 9d04445166ec8e51472cf8ee7aa73f285266ac01 /cli/src | |
parent | 669868d23eaeba42809fca7be134137c607d64ed (diff) |
glusterd: Add option to get all volume options through get-state CLI
This commit makes the get-state CLI capable to returning the values
for all volume options for all volumes. This is similar to what you
get when you issue a `gluster volume get <volname> all` command.
This is the new usage for the get-state CLI:
# gluster get-state [<daemon>] [[odir </path/to/output/dir/>] \
[file <filename>]] [detail|volumeoptions]
Fixes: #277
Change-Id: Ice52d936a5a389c6fa0ba5ab32416a65cdfde46d
Signed-off-by: Samikshan Bairagya <samikshan@gmail.com>
Reviewed-on: https://review.gluster.org/17858
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Gaurav Yadav <gyadav@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'cli/src')
-rw-r--r-- | cli/src/cli-cmd-global.c | 2 | ||||
-rw-r--r-- | cli/src/cli-cmd-parser.c | 28 |
2 files changed, 21 insertions, 9 deletions
diff --git a/cli/src/cli-cmd-global.c b/cli/src/cli-cmd-global.c index 0f08985318e..9873192686e 100644 --- a/cli/src/cli-cmd-global.c +++ b/cli/src/cli-cmd-global.c @@ -42,7 +42,7 @@ struct cli_cmd global_cmds[] = { "list global commands", }, { "get-state [<daemon>] [[odir </path/to/output/dir/>] " - "[file <filename>]] [detail]", + "[file <filename>]] [detail|volumeoptions]", cli_cmd_get_state_cbk, "Get local state representation of mentioned daemon", }, diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index c3058b673f8..7d6fd3c28d0 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -887,10 +887,16 @@ cli_cmd_get_state_parse (struct cli_state *state, } } else { if (count > 1) { - if (count == wordcount-1 && - !strcmp (words[count], "detail")) { - cmd = GF_CLI_GET_STATE_DETAIL; - continue; + if (count == wordcount-1) { + if (strcmp (words[count], + "detail") == 0) { + cmd = GF_CLI_GET_STATE_DETAIL; + continue; + } else if (strcmp (words[count], + "volumeoptions") == 0) { + cmd = GF_CLI_GET_STATE_VOLOPTS; + continue; + } } else { *op_errstr = gf_strdup ("Problem" " parsing arguments. " @@ -903,10 +909,16 @@ cli_cmd_get_state_parse (struct cli_state *state, if (strcmp (words[count], "glusterd") == 0) { continue; } else { - if (count == wordcount-1 && - !strcmp (words[count], "detail")) { - cmd = GF_CLI_GET_STATE_DETAIL; - continue; + if (count == wordcount-1) { + if (strcmp (words[count], + "detail") == 0) { + cmd = GF_CLI_GET_STATE_DETAIL; + continue; + } else if (strcmp (words[count], + "volumeoptions") == 0) { + cmd = GF_CLI_GET_STATE_VOLOPTS; + continue; + } } *op_errstr = gf_strdup ("glusterd is " |