summaryrefslogtreecommitdiffstats
path: root/rpc/rpcl
diff options
context:
space:
mode:
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2018-02-05 15:07:26 +0530
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2018-02-07 16:49:21 +0530
commit540e81676b1011dcf85fbe5cd6739a4f2143b2ab (patch)
tree7eed76faf5483e03bbbe59bb23ede3675ae6ad97 /rpc/rpcl
parentf217c0bf9cf464e21c01fa50643b778f236acedb (diff)
replace: add replace feature
1. create conf in new node 2. delete conf from old node 3. replace portals from nodes hosting other paths (HA) $ gluster-block create sample/block ha 3 192.168.124.57,192.168.124.26,192.168.124.30 1GiB --json-pretty { "IQN":"iqn.2016-12.org.gluster-block:d516bb5c-5f56-4d9c-96a7-385df19c2e2c", "PORTAL(S)":[ "192.168.124.57:3260", "192.168.124.26:3260", "192.168.124.30:3260" ], "RESULT":"SUCCESS" } $ gluster-block help gluster-block (0.3) usage: gluster-block <command> <volname[/blockname]> [<args>] [--json*] commands: [...] replace <volname/blockname> <old-node> <new-node> [force] replace operations. [...] supported JSON formats: --json|--json-plain|--json-spaced|--json-pretty $ gluster-block replace sample/block 192.168.124.26 192.168.124.56 --json-pretty { "NAME":"block", "CREATE SUCCESS":"192.168.124.56", "DELETE SUCCESS":"192.168.124.26", "REPLACE PORTAL SUCCESS ON":[ "192.168.124.57", "192.168.124.30" ], "RESULT":"SUCCESS" } Fixes: #4 Change-Id: I0411d15c407111db0d423052d9a6bc075174bf90 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Diffstat (limited to 'rpc/rpcl')
-rw-r--r--rpc/rpcl/block.x19
1 files changed, 19 insertions, 0 deletions
diff --git a/rpc/rpcl/block.x b/rpc/rpcl/block.x
index 6eeb321..4ad0549 100644
--- a/rpc/rpcl/block.x
+++ b/rpc/rpcl/block.x
@@ -33,6 +33,14 @@ struct blockModify {
bool auth_mode;
};
+struct blockReplace {
+ char volume[255];
+ char block_name[255];
+ char gbid[127];
+ char ipaddr[255];
+ char ripaddr[255];
+};
+
struct blockCreateCli {
char volume[255];
u_quad_t size;
@@ -75,6 +83,15 @@ struct blockModifyCli {
enum JsonResponseFormat json_resp;
};
+struct blockReplaceCli {
+ char volume[255];
+ char block_name[255];
+ char old_node[255];
+ char new_node[255];
+ bool force;
+ enum JsonResponseFormat json_resp;
+};
+
struct blockResponse {
int exit; /* exit code of the command */
string out<>; /* output; TODO: return respective objects */
@@ -88,6 +105,7 @@ program GLUSTER_BLOCK {
blockResponse BLOCK_DELETE(blockDelete) = 2;
blockResponse BLOCK_MODIFY(blockModify) = 3;
blockResponse BLOCK_VERSION() = 4;
+ blockResponse BLOCK_REPLACE(blockReplace) = 5;
} = 1;
} = 21215311; /* B2 L12 O15 C3 K11 */
@@ -98,5 +116,6 @@ program GLUSTER_BLOCK_CLI {
blockResponse BLOCK_INFO_CLI(blockInfoCli) = 3;
blockResponse BLOCK_DELETE_CLI(blockDeleteCli) = 4;
blockResponse BLOCK_MODIFY_CLI(blockModifyCli) = 5;
+ blockResponse BLOCK_REPLACE_CLI(blockReplaceCli) = 6;
} = 1;
} = 212153113; /* B2 L12 O15 C3 K11 C3 */