diff options
| author | Venky Shankar <vshankar@redhat.com> | 2013-08-12 22:09:45 +0530 | 
|---|---|---|
| committer | Anand Avati <avati@redhat.com> | 2013-09-04 19:50:49 -0700 | 
| commit | fe98c2902fd13dac93e5add60d1f10b2cef8ae37 (patch) | |
| tree | 5f92444e7bf86b7a56f00e3e7266a54fa4c06d03 /cli/src/cli-cmd-parser.c | |
| parent | 603119c57c5055e17693d47b9965216954f45247 (diff) | |
glusterd/cli: Geo-Replication "status detail" cmd
Provides detailed status info in the following format
                    MASTER <master-vol>  SLAVE <slave-vol>
NODE   HEALTH   UPTIME  FILES SYNCD  FILES PENDING  BYTES PENDING  DELETES PENDING
-----------------------------------------------------------------------------------
This patch introdues "status detail" command to show crawl related
information in CLI. These values are "pulled" from gsyncd when
"status detail" is executed.
Change-Id: I1fdaf7180eacce054a864d34971dc160bd7301e1
BUG: 990420
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/5590
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Tested-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-parser.c')
| -rw-r--r-- | cli/src/cli-cmd-parser.c | 19 | 
1 files changed, 17 insertions, 2 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 26ac6f384eb..547f1d90f01 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -1763,7 +1763,7 @@ cli_cmd_gsync_set_parse (const char **words, int wordcount, dict_t **options)          unsigned           cmdi    = 0;          char               *opwords[] = { "create", "status", "start", "stop",                                            "config", "force", "delete", -                                          "push-pem", NULL }; +                                          "push-pem", "detail", NULL };          char               *w = NULL;          GF_ASSERT (words); @@ -1776,7 +1776,7 @@ cli_cmd_gsync_set_parse (const char **words, int wordcount, dict_t **options)          /* new syntax:           *           * volume geo-replication $m $s create [push-pem] [force] -         * volume geo-replication [$m [$s]] status +         * volume geo-replication [$m [$s]] status [detail]           * volume geo-replication [$m] $s config [[!]$opt [$val]]           * volume geo-replication $m $s start|stop [force]           * volume geo-replication $m $s delete @@ -1873,6 +1873,21 @@ cli_cmd_gsync_set_parse (const char **words, int wordcount, dict_t **options)          if (ret)                  goto out; +        if (!strcmp ((char *)words[wordcount-1], "detail")) { +                if (strcmp ((char *)words[wordcount-2], "status")) { +                        ret = -1; +                        goto out; +                } +                if (!slavei || !masteri) { +                        ret = -1; +                        goto out; +                } +                ret = dict_set_uint32 (dict, "status-detail", _gf_true); +                if (ret) +                        goto out; +                cmdi++; +        } +          if (type != GF_GSYNC_OPTION_TYPE_CONFIG &&              (cmdi < wordcount - 1 || glob))                  goto out;  | 
