diff options
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r-- | cli/src/cli-cmd-volume.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index 521e3eb84f7..9c7a43b9f85 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -1653,6 +1653,33 @@ out: return ret; } +int +cli_cmd_volume_list_cbk (struct cli_state *state, struct cli_cmd_word *word, + const char **words, int wordcount) +{ + int ret = -1; + call_frame_t *frame = NULL; + rpc_clnt_procedure_t *proc = NULL; + int sent = 0; + + frame = create_frame (THIS, THIS->ctx->pool); + if (!frame) + goto out; + + proc = &cli_rpc_prog->proctable[GLUSTER_CLI_LIST_VOLUME]; + if (proc->fn) { + ret = proc->fn (frame, THIS, NULL); + } + +out: + if (ret) { + cli_cmd_sent_status_get (&sent); + if (sent == 0) + cli_out ("Volume list failed"); + } + + return ret; +} struct cli_cmd volume_cmds[] = { { "volume info [all|<VOLNAME>]", @@ -1754,6 +1781,10 @@ struct cli_cmd volume_cmds[] = { cli_cmd_volume_statedump_cbk, "perform statedump on bricks"}, + {"volume list", + cli_cmd_volume_list_cbk, + "list all volumes in cluster"}, + { NULL, NULL, NULL } }; |