summaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--cli/src/cli-cmd-volume.c47
-rw-r--r--events/eventskeygen.py13
2 files changed, 60 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;
}
diff --git a/events/eventskeygen.py b/events/eventskeygen.py
index 02b7bb18015..41f75c2fb7d 100644
--- a/events/eventskeygen.py
+++ b/events/eventskeygen.py
@@ -69,6 +69,7 @@ keys = (
"EVENT_BRICKPATH_RESOLVE_FAILED",
"EVENT_NOTIFY_UNKNOWN_OP",
+
"EVENT_QUORUM_LOST",
"EVENT_QUORUM_REGAINED",
"EVENT_REBALANCE_START_FAILED",
@@ -78,6 +79,18 @@ keys = (
"EVENT_IMPORT_BRICK_FAILED",
"EVENT_COMPARE_FRIEND_VOLUME_FAILED",
"EVENT_NFS_GANESHA_EXPORT_FAILED",
+
+ "EVENT_QUOTA_ENABLE",
+ "EVENT_QUOTA_DISABLE",
+ "EVENT_QUOTA_SET_USAGE_LIMIT",
+ "EVENT_QUOTA_SET_OBJECTS_LIMIT",
+ "EVENT_QUOTA_REMOVE_USAGE_LIMIT",
+ "EVENT_QUOTA_REMOVE_OBJECTS_LIMIT",
+ "EVENT_QUOTA_ALERT_TIME",
+ "EVENT_QUOTA_SOFT_TIMEOUT",
+ "EVENT_QUOTA_HARD_TIMEOUT",
+ "EVENT_QUOTA_DEFAULT_SOFT_LIMIT",
+
)
LAST_EVENT = "EVENT_LAST"