From 0143a2ef653d0f7a337c8220f127655dadbca942 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Thu, 18 Aug 2011 23:19:22 +0530 Subject: mgmt/glusterd, cli: Introduce gluster volume status Change-Id: Iea835b9e448e736016da2e44e3c9bfff93f2fa78 BUG: 3439 Reviewed-on: http://review.gluster.com/259 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- cli/src/cli-cmd-parser.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'cli/src/cli-cmd-parser.c') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index a442b3aee..9f35cc47e 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -1646,3 +1646,37 @@ out: dict_destroy (dict); return ret; } + +int32_t +cli_cmd_volume_status_parse (const char **words, int wordcount, + dict_t **options) +{ + dict_t *dict = NULL; + int ret = -1; + + GF_ASSERT (words); + GF_ASSERT (options); + + + GF_ASSERT ((strncmp(words[0], "volume", 6) == 0)); + GF_ASSERT ((strncmp(words[1], "status", 5) == 0)); + + + dict = dict_new (); + if (!dict) + goto out; + + GF_ASSERT(words[2]); + + ret = dict_set_str (dict, "volname", (char *)words[2]); + if (ret) + goto out; + + *options = dict; + + out: + if (ret && dict) + dict_destroy (dict); + + return ret; +} -- cgit