summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorVijaikumar M <vmallika@redhat.com>2014-03-04 13:02:52 +0530
committerRajesh Joseph <rjoseph@redhat.com>2014-03-06 01:31:23 -0800
commit40497ba922667abbc20dda635cb0ef0abe5f51eb (patch)
tree3755c4d52ff5ed4a6d6f0d1cff0dcd80cef52ba1 /cli
parentfabee8f75c56f18c949b79dcc751c2855b5c7514 (diff)
glusterd/snapshot: Snapshot create and delete changes
With the snap driven approach, While creating the snapshot, We have to mention the snap-name first and then the volumes to be associated with that. Corresponding changes has been made in glusterd. While deleting the snapshot, we have to mention only the snapname. Corresponding changes has been made in glusterd. CLI changes for the same can be found here: http://review.gluster.org/#/c/6947/ Change-Id: I8bd8f471da5b728165da5f331faad3dde3486823 Signed-off-by: Vijaikumar M <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/7123 Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-parser.c32
-rw-r--r--cli/src/cli-cmd-snapshot.c6
-rw-r--r--cli/src/cli-rpc-ops.c6
3 files changed, 22 insertions, 22 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index f14fc702c..5e23d87f8 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -2816,7 +2816,7 @@ out :
-/* snapshot create <snap-name> <vol-name(s)> [description <description>]
+/* snapshot create <snapname> <vol-name(s)> [description <description>]
* [force]
* @arg-0, dict : Request Dictionary to be sent to server side.
* @arg-1, words : Contains individual words of CLI command.
@@ -3023,20 +3023,20 @@ cli_snap_info_parse (dict_t *dict, const char **words, int wordcount,
}
/* If 3rd word is not "volume", then it must
- * be snap-name.
+ * be snapname.
*/
if (strcmp (words[cmdi], "volume") != 0) {
ret = dict_set_str (dict, "snapname",
(char *)words[cmdi]);
if (ret) {
gf_log ("cli", GF_LOG_ERROR, "Unable to save "
- "snap-name %s", words[cmdi]);
+ "snapname %s", words[cmdi]);
goto out;
}
/* Once snap name is parsed, if we encounter any other
* word then fail it. Invalid Syntax.
- * example : snapshot info <snap-name> word
+ * example : snapshot info <snapname> word
*/
if ((cmdi + 1) != wordcount) {
ret = -1;
@@ -3047,7 +3047,7 @@ cli_snap_info_parse (dict_t *dict, const char **words, int wordcount,
ret = 0;
goto out;
/* No need to continue the parsing once we
- * get the snap-name
+ * get the snapname
*/
}
@@ -3266,9 +3266,9 @@ cli_snap_remove_parse (dict_t *dict, const char **words, int wordcount,
}
}
- /* Saving snap-name/cg-name in dict */
+ /* Saving snapname/cg-name in dict */
if (name_opt_loc >= cmdi) {
- /* Decide if it's a cg-name or a snap-name */
+ /* Decide if it's a cg-name or a snapname */
if (is_cg) {
ret = dict_set_str (dict, "cgname",
(char *)words[name_opt_loc + 1]);
@@ -3313,7 +3313,7 @@ out:
}
/* Syntax:
- * snapshot restore (-v <volname> <snap-name> | -c <cg-name> )
+ * snapshot restore (-v <volname> <snapname> | -c <cg-name> )
*/
int
cli_snap_restore_parse (dict_t *dict, const char **words, int wordcount,
@@ -3334,7 +3334,7 @@ cli_snap_restore_parse (dict_t *dict, const char **words, int wordcount,
goto out;
}
if (0 == strcmp (words[cmdi], "-v")) {
- /* snapshot restore -v <volname> <snap-name>
+ /* snapshot restore -v <volname> <snapname>
*
* cmdi points to -v, therefore wordcount should be exactly
* equal to (cmdi + 2) + 1. +1 is added to convert index to
@@ -3437,9 +3437,9 @@ cli_snap_delete_parse (dict_t *dict, const char **words, int wordcount,
goto out;
}
- ret = dict_set_str (dict, "snap-name", (char *)words[cmdi]);
+ ret = dict_set_str (dict, "snapname", (char *)words[cmdi]);
if (ret) {
- gf_log ("cli", GF_LOG_ERROR, "Unable to save snap-name %s",
+ gf_log ("cli", GF_LOG_ERROR, "Unable to save snapname %s",
words[cmdi]);
goto out;
}
@@ -3511,12 +3511,12 @@ cli_cmd_snapshot_parse (const char **words, int wordcount, dict_t **options,
case GF_SNAP_OPTION_TYPE_CREATE:
{
/* Syntax :
- * gluster snapshot create <snap-name> <vol-name(s)>
+ * gluster snapshot create <snapname> <vol-name(s)>
* [description <description>]
* [force]
*/
- /* In cases where the snap-name is not given then
+ /* In cases where the snapname is not given then
* parsing fails & snapname cannot be an opword,
* that check is made here
*/
@@ -3536,7 +3536,7 @@ cli_cmd_snapshot_parse (const char **words, int wordcount, dict_t **options,
case GF_SNAP_OPTION_TYPE_INFO:
{
/* Syntax :
- * gluster snapshot info ([snap-name] | [vol <volname>])
+ * gluster snapshot info ([snapname] | [vol <volname>])
*/
ret = cli_snap_info_parse (dict, words, wordcount,
cmdi);
@@ -3567,7 +3567,7 @@ cli_cmd_snapshot_parse (const char **words, int wordcount, dict_t **options,
case GF_SNAP_OPTION_TYPE_DELETE:
{
/* Syntax :
- * gluster snapshot delete <snap-name>
+ * gluster snapshot delete <snapname>
*/
ret = cli_snap_delete_parse (dict, words, wordcount,
cmdi, state);
@@ -3596,7 +3596,7 @@ cli_cmd_snapshot_parse (const char **words, int wordcount, dict_t **options,
case GF_SNAP_OPTION_TYPE_RESTORE:
{
/* Syntax:
- * snapshot restore (-v <volname> <snap-name> |
+ * snapshot restore (-v <volname> <snapname> |
* -c <cg-name> )
*/
diff --git a/cli/src/cli-cmd-snapshot.c b/cli/src/cli-cmd-snapshot.c
index 93e154eab..a7e39e64c 100644
--- a/cli/src/cli-cmd-snapshot.c
+++ b/cli/src/cli-cmd-snapshot.c
@@ -87,11 +87,11 @@ struct cli_cmd snapshot_cmds[] = {
cli_cmd_snapshot_cbk,
"Snapshot Create."
},
- { "snapshot restore (-v <volname> <snap-name> | -c <cg-name>)",
+ { "snapshot restore (-v <volname> <snapname> | -c <cg-name>)",
cli_cmd_snapshot_cbk,
"Snapshot Restore."
},
- { "snapshot info [(snap-name | volume <volname>)]",
+ { "snapshot info [(snapname | volume <volname>)]",
cli_cmd_snapshot_cbk,
"Snapshot Info."
},
@@ -103,7 +103,7 @@ struct cli_cmd snapshot_cmds[] = {
cli_cmd_snapshot_cbk,
"Snapshot Config."
},
- {"snapshot delete <snap-name>",
+ {"snapshot delete <snapname>",
cli_cmd_snapshot_cbk,
"Snapshot Delete."
},
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index b441e1083..ee26e7d76 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -7844,7 +7844,7 @@ cli_get_each_snap_info (dict_t *dict, char *prefix_str,
if (!snap_driven)
strcat (indent, "\t");
- ret = snprintf (key_buffer, sizeof (key_buffer), "%s.snap-name",
+ ret = snprintf (key_buffer, sizeof (key_buffer), "%s.snapname",
prefix_str);
if (ret < 0 ) {
goto out;
@@ -7852,7 +7852,7 @@ cli_get_each_snap_info (dict_t *dict, char *prefix_str,
ret = dict_get_str (dict, key_buffer, &get_buffer);
if (ret) {
- gf_log ("cli", GF_LOG_ERROR, "Unable to fetch snap-name %s ",
+ gf_log ("cli", GF_LOG_ERROR, "Unable to fetch snapname %s ",
key_buffer);
goto out;
}
@@ -8092,7 +8092,7 @@ gf_cli_snapshot_cbk (struct rpc_req *req, struct iovec *iov,
"group created successfully",
cg_name);
} else {
- if (dict_get_str (dict, "snap-name",
+ if (dict_get_str (dict, "snapname",
&snap_name) != 0)
snap_name = "???";