summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-volume.c
diff options
context:
space:
mode:
authorManikandan Selvaganesh <mselvaga@redhat.com>2016-08-22 12:43:19 +0530
committerAtin Mukherjee <amukherj@redhat.com>2016-08-24 04:31:44 -0700
commit1edea9534dfaf95873921a77e40ae73a0d6e4c39 (patch)
tree74a06dd6bbece417ea0cf7711d33c1f7da69f77a /cli/src/cli-cmd-volume.c
parentd1aa35c3619847922e092b7dbfb201bceea8fa33 (diff)
quota/cli: add user driven quota events
This patch targets to capture all the user driven quota related events which are important to be notified. Change-Id: I90c0af434363465e9dbdf6fca65ac220251d8d3c BUG: 1368931 Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com> Reviewed-on: http://review.gluster.org/15230 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: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r--cli/src/cli-cmd-volume.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index fba928fcae9..98e082f9906 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -1705,6 +1705,53 @@ out:
"logs for more details");
}
+ /* Events for Quota */
+ if (ret == 0) {
+ switch (type) {
+ case GF_QUOTA_OPTION_TYPE_ENABLE:
+ gf_event (EVENT_QUOTA_ENABLE, "volume=%s", volname);
+ break;
+ case GF_QUOTA_OPTION_TYPE_DISABLE:
+ gf_event (EVENT_QUOTA_DISABLE, "volume=%s", volname);
+ break;
+ case GF_QUOTA_OPTION_TYPE_LIMIT_USAGE:
+ gf_event (EVENT_QUOTA_SET_USAGE_LIMIT, "volume=%s;"
+ "path=%s;limit=%s", volname, words[4],
+ words[5]);
+ break;
+ case GF_QUOTA_OPTION_TYPE_LIMIT_OBJECTS:
+ gf_event (EVENT_QUOTA_SET_OBJECTS_LIMIT, "volume=%s;"
+ "path=%s;limit=%s", volname, words[4],
+ words[5]);
+ break;
+ case GF_QUOTA_OPTION_TYPE_REMOVE:
+ gf_event (EVENT_QUOTA_REMOVE_USAGE_LIMIT, "volume=%s;"
+ "path=%s", volname, words[4]);
+ break;
+ case GF_QUOTA_OPTION_TYPE_REMOVE_OBJECTS:
+ gf_event (EVENT_QUOTA_REMOVE_OBJECTS_LIMIT,
+ "volume=%s;" "path=%s", volname, words[4]);
+ break;
+ case GF_QUOTA_OPTION_TYPE_ALERT_TIME:
+ gf_event (EVENT_QUOTA_ALERT_TIME, "volume=%s;time=%s",
+ volname, words[4]);
+ break;
+ case GF_QUOTA_OPTION_TYPE_SOFT_TIMEOUT:
+ gf_event (EVENT_QUOTA_SOFT_TIMEOUT, "volume=%s;"
+ "soft-timeout=%s", volname, words[4]);
+ break;
+ case GF_QUOTA_OPTION_TYPE_HARD_TIMEOUT:
+ gf_event (EVENT_QUOTA_HARD_TIMEOUT, "volume=%s;"
+ "hard-timeout=%s", volname, words[4]);
+ break;
+ case GF_QUOTA_OPTION_TYPE_DEFAULT_SOFT_LIMIT:
+ gf_event (EVENT_QUOTA_DEFAULT_SOFT_LIMIT, "volume=%s;"
+ "default-soft-limit=%s", volname, words[4]);
+ break;
+ }
+ }
+
+
CLI_STACK_DESTROY (frame);
return ret;
}