summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-rpc-ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli/src/cli-rpc-ops.c')
-rw-r--r--cli/src/cli-rpc-ops.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 20cad3bb3..e881e18fc 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -7806,6 +7806,9 @@ gf_cli_snapshot_cbk (struct rpc_req *req, struct iovec *iov,
int32_t type = 0;
int64_t volcount = -1;
call_frame_t *frame = NULL;
+ uint64_t limit = 0;
+ int32_t config_command = 0;
+ char *volname = NULL;
if (req->rpc_status == -1) {
ret = -1;
@@ -7903,6 +7906,52 @@ gf_cli_snapshot_cbk (struct rpc_req *req, struct iovec *iov,
}
break;
+ case GF_SNAP_OPTION_TYPE_CONFIG:
+ if (rsp.op_ret) {
+ cli_err ("Snapshot Config : failed: %s",
+ rsp.op_errstr ? rsp.op_errstr :
+ "Please check log file for details");
+ ret = rsp.op_ret;
+ goto out;
+ }
+
+ ret = dict_get_int32 (dict, "config-command", &config_command);
+
+ if (ret) {
+ gf_log("", GF_LOG_DEBUG, "Could not fetch config type");
+ ret = -1;
+ goto out;
+ }
+
+ ret = dict_get_str (dict, "volname", &volname);
+ if (ret) {
+ gf_log("", GF_LOG_DEBUG, "Could not fetch "
+ "volname");
+ ret = -1;
+ goto out;
+ }
+
+ if (!strcmp (volname, "all")) {
+ volname = "System";
+ }
+
+ if (config_command == GF_SNAP_CONFIG_DISPLAY) {
+
+ ret = dict_get_uint64 (dict, "limit", &limit);
+ if (ret) {
+ gf_log("", GF_LOG_DEBUG, "Could not fetch "
+ "limit for %s", volname);
+ ret = -1;
+ goto out;
+ }
+ cli_out ("Max snapshot count set for %s is %"PRIu64,
+ volname, limit);
+ } else {
+ cli_out ("Snapshot config max set for %s successfull",
+ volname);
+ }
+ break;
+
default:
cli_err ("Unknown command executed");
ret = -1;