summaryrefslogtreecommitdiffstats
path: root/cli/src
diff options
context:
space:
mode:
authorMilind Changire <mchangir@redhat.com>2016-09-05 21:51:19 +0530
committerDan Lambright <dlambrig@redhat.com>2016-09-08 05:32:20 -0700
commitcd23242b8953040b231f402c334f16520ac8029f (patch)
tree38c2c11f64765dabfaaeccd332f8859feb39d44c /cli/src
parent6f182733d943aff5212175c58dd59b2da64b9d8b (diff)
cluster/tier: add tiering events
Add events for: * tier attach and detach * tier pause and resume * tier rising and dropping hi and lo watermarks Update eventskeygen.py with tiering events. Update cli help with: * attach: add optional force argument * detach: make force available as non-optional argument on its own Change-Id: I43990d3a8742151a4a7889bafa19cb572fe661bd BUG: 1368336 Signed-off-by: Milind Changire <mchangir@redhat.com> Reviewed-on: http://review.gluster.org/15232 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'cli/src')
-rw-r--r--cli/src/cli-cmd-volume.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 003c95395ef..6d0fdf765b4 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -1117,6 +1117,7 @@ cli_cmd_volume_tier_cbk (struct cli_state *state,
rpc_clnt_procedure_t *proc = NULL;
cli_local_t *local = NULL;
int i = 0;
+ eventtypes_t event = EVENT_LAST;
if (wordcount < 4) {
cli_usage_out (word->pattern);
@@ -1135,6 +1136,15 @@ cli_cmd_volume_tier_cbk (struct cli_state *state,
ret = do_cli_cmd_volume_detach_tier (state, word,
words, wordcount-1);
+ if (!strcmp (words[wordcount-2], "commit")) {
+ event = EVENT_TIER_DETACH_COMMIT;
+ } else if (!strcmp (words[wordcount-2], "start")) {
+ event = EVENT_TIER_DETACH_START;
+ } else if (!strcmp (words[wordcount-2], "stop")) {
+ event = EVENT_TIER_DETACH_STOP;
+ } else if (!strcmp (words[wordcount-2], "force")) {
+ event = EVENT_TIER_DETACH_FORCE;
+ }
goto out;
} else if (!strcmp(words[1], "attach-tier")) {
@@ -1147,6 +1157,11 @@ cli_cmd_volume_tier_cbk (struct cli_state *state,
ret = do_cli_cmd_volume_attach_tier (state, word,
words, wordcount-1);
+ if (!strcmp (words[wordcount-2], "force")) {
+ event = EVENT_TIER_ATTACH_FORCE;
+ } else {
+ event = EVENT_TIER_ATTACH;
+ }
goto out;
}
@@ -1171,6 +1186,10 @@ cli_cmd_volume_tier_cbk (struct cli_state *state,
out:
if (ret) {
cli_out ("Tier command failed");
+ } else {
+ if (event != EVENT_LAST) {
+ gf_event (event, "vol=%s", words[2]);
+ }
}
if (options)
dict_unref (options);
@@ -2941,8 +2960,8 @@ struct cli_cmd volume_cmds[] = {
#if !defined(__NetBSD__)
{ "volume tier <VOLNAME> status\n"
"volume tier <VOLNAME> start [force]\n"
- "volume tier <VOLNAME> attach [<replica COUNT>] <NEW-BRICK>...\n"
- "volume tier <VOLNAME> detach <start|stop|status|commit|[force]>\n",
+ "volume tier <VOLNAME> attach [<replica COUNT>] <NEW-BRICK>... [force]\n"
+ "volume tier <VOLNAME> detach <start|stop|status|commit|force>\n",
cli_cmd_volume_tier_cbk,
"Tier translator specific operations."},