diff options
author | Rajesh Amaravathi <rajesh@redhat.com> | 2011-12-07 20:51:03 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-01-12 01:58:26 -0800 |
commit | 169c73f28dae61236de54889edcaa8236d91da59 (patch) | |
tree | a4d74fc14c9198cbc78633a844480ab6c4ffdda3 /cli/src/cli.h | |
parent | 4e40a7e48757feedc959c7982acf05c73f739a15 (diff) |
cli: volume status enhancement
* Support "gluster volume status (all)" option to display all
volumes' status.
* On option "detail" appended to "gluster volume status *",
amount of storage free, total storage, and backend filesystem
details like inode size, inode count, free inodes, fs type,
device name of each brick is displayed.
* One can also obtain [detailed]status of only one brick.
* Format of the enhanced volume status command is:
"gluster volume status [all|<vol>] [<brick>] [detail]"
* Some generic functions have been added to common-utils:
skipword
get_nth_word
These functions enable parsing and fetching
of words in a sentence.
glusterd_get_brick_root (in glusterd)
These are self explanatory.
Change-Id: I6f40c1e19810f8504cd3b1786207364053d82e28
BUG: 765464
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.com/777
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
Diffstat (limited to 'cli/src/cli.h')
-rw-r--r-- | cli/src/cli.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/cli/src/cli.h b/cli/src/cli.h index 1d2e069735a..e091e7004a8 100644 --- a/cli/src/cli.h +++ b/cli/src/cli.h @@ -37,7 +37,7 @@ #define DEFAULT_CLI_LOG_FILE_DIRECTORY DATADIR "/log/glusterfs" #define CLI_VOL_STATUS_BRICK_LEN 55 #define CLI_TAB_LENGTH 8 -#define CLI_BRICK_STATUS_LINE_LEN 75 +#define CLI_BRICK_STATUS_LINE_LEN 78 enum argp_option_keys { ARGP_DEBUG_KEY = 133, @@ -124,6 +124,24 @@ struct cli_local { dict_t *dict; }; +struct cli_volume_status { + int port; + int online; + uint64_t block_size; + uint64_t total_inodes; + uint64_t free_inodes; + char *brick; + char *pid_str; + char *fs_name; + char *free; + char *total; + char *mount_options; + char *device; + char *inode_size; +}; + +typedef struct cli_volume_status cli_volume_status_t; + typedef struct cli_local cli_local_t; typedef ssize_t (*cli_serialize_t) (struct iovec outmsg, void *args); @@ -236,7 +254,13 @@ cli_cmd_volume_status_parse (const char **words, int wordcount, dict_t **options); int -cli_print_brick_status (char *brick, int port, int online, char *pid); +cli_print_brick_status (cli_volume_status_t *status); + +void +cli_print_detailed_status (cli_volume_status_t *status); + +int +cli_get_detail_status (dict_t *dict, int i, cli_volume_status_t *status); void cli_print_line (int len); |