From 540e81676b1011dcf85fbe5cd6739a4f2143b2ab Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Kalever Date: Mon, 5 Feb 2018 15:07:26 +0530 Subject: 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 [] [--json*] commands: [...] replace [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 --- utils/common.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'utils/common.h') diff --git a/utils/common.h b/utils/common.h index 2d1202a..02940c0 100644 --- a/utils/common.h +++ b/utils/common.h @@ -16,6 +16,13 @@ # include "block.h" +typedef struct blockServerDef { + size_t nhosts; + char **hosts; +} blockServerDef; +typedef blockServerDef *blockServerDefPtr; + + static const char *const JsonResponseFormatLookup[] = { [GB_JSON_NONE] = "", @@ -82,4 +89,8 @@ char* glusterBlockFormatSize(const char *dom, size_t bytes); int convertStringToTrillianParse(const char *opt); +void blockServerDefFree(blockServerDefPtr blkServers); + +bool blockhostIsValid(char *status); + # endif /* _COMMON_H */ -- cgit