summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorhari gowtham <hgowtham@redhat.com>2015-10-05 16:17:02 +0530
committerDan Lambright <dlambrig@redhat.com>2015-10-08 10:01:14 -0700
commit81d4aa18b3a1cdad0e0e8df43fe4c8c141c06618 (patch)
tree56d2ade489ff33802d82483848ff744e9ac3666a /cli
parentd0edb6d555d687f76837515207b9408be0bdd55e (diff)
gluster v status --xml for a replicated hot tier volume
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <cliOutput> <opRet>0</opRet> <opErrno>0</opErrno> <opErrstr/> <volStatus> <volumes> <volume> <volName>tiervol</volName> <nodeCount>11</nodeCount> <hotBricks> <node> <hostname>10.70.42.203</hostname> <path>/data/gluster/tier/b5_2</path> <peerid>149ac603-8078-41c5-8f71-7373f2a3016f</peerid> <status>1</status> <port>49164</port> <ports> <tcp>49164</tcp> <rdma>N/A</rdma> </ports> <pid>8684</pid> </node> <node> <hostname>10.70.42.203</hostname> <path>/data/gluster/tier/b5_1</path> <peerid>149ac603-8078-41c5-8f71-7373f2a3016f</peerid> <status>1</status> <port>49163</port> <ports> <tcp>49163</tcp> <rdma>N/A</rdma> </ports> <pid>8687</pid> </node> <node> <hostname>10.70.42.203</hostname> <path>/data/gluster/tier/b4_2</path> <peerid>149ac603-8078-41c5-8f71-7373f2a3016f</peerid> <status>1</status> <port>49162</port> <ports> <tcp>49162</tcp> <rdma>N/A</rdma> </ports> <pid>8699</pid> </node> <node> <hostname>10.70.42.203</hostname> <path>/data/gluster/tier/b4_1</path> <peerid>149ac603-8078-41c5-8f71-7373f2a3016f</peerid> <status>1</status> <port>49161</port> <ports> <tcp>49161</tcp> <rdma>N/A</rdma> </ports> <pid>8708</pid> </node> </hotBricks> <coldBricks> <node> <hostname>10.70.42.203</hostname> <path>/data/gluster/tier/b1_1</path> <peerid>149ac603-8078-41c5-8f71-7373f2a3016f</peerid> <status>1</status> <port>49155</port> <ports> <tcp>49155</tcp> <rdma>N/A</rdma> </ports> <pid>8716</pid> </node> <node> <hostname>10.70.42.203</hostname> <path>/data/gluster/tier/b1_2</path> <peerid>149ac603-8078-41c5-8f71-7373f2a3016f</peerid> <status>1</status> <port>49156</port> <ports> <tcp>49156</tcp> <rdma>N/A</rdma> </ports> <pid>8724</pid> </node> <node> <hostname>NFS Server</hostname> <path>localhost</path> <peerid>149ac603-8078-41c5-8f71-7373f2a3016f</peerid> <status>1</status> <port>2049</port> <ports> <tcp>2049</tcp> <rdma>N/A</rdma> </ports> <pid>8678</pid> </node> </coldBricks> <tasks> <task> <type>Tier migration</type> <id>975bfcfa-077c-4edb-beba-409c2013f637</id> <status>1</status> <statusStr>in progress</statusStr> </task> </tasks> </volume> </volumes> </volStatus> </cliOutput> Change-Id: I69252a36b6e6b2f3cbe5db06e9a716f504a1dba4 BUG: 1268810 Signed-off-by: hari gowtham <hgowtham@redhat.com> Reviewed-on: http://review.gluster.org/12302 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Nekkunti <anekkunt@redhat.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-xml-output.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c
index 87bd0589bb9..9fa13c8279b 100644
--- a/cli/src/cli-xml-output.c
+++ b/cli/src/cli-xml-output.c
@@ -1668,15 +1668,19 @@ cli_xml_output_vol_status (cli_local_t *local, dict_t *dict)
goto out;
ret = xmlTextWriterStartElement
- (local->writer, (xmlChar *)"hotBrick");
+ (local->writer, (xmlChar *)"hotBricks");
XML_RET_CHECK_AND_GOTO (ret, out);
}
for (i = 0; i <= index_max; i++) {
- if (type == GF_CLUSTER_TYPE_TIER && i >= hot_brick_count) {
+ if (type == GF_CLUSTER_TYPE_TIER && i == hot_brick_count) {
+
+ /* </hotBricks>*/
+ ret = xmlTextWriterEndElement (local->writer);
+ XML_RET_CHECK_AND_GOTO (ret, out);
ret = xmlTextWriterStartElement (local->writer,
- (xmlChar *)"coldBrick");
+ (xmlChar *)"coldBricks");
XML_RET_CHECK_AND_GOTO (ret, out);
}
ret = cli_xml_output_vol_status_common (local->writer, dict, i,
@@ -1749,16 +1753,13 @@ cli_xml_output_vol_status (cli_local_t *local, dict_t *dict)
ret = xmlTextWriterEndElement (local->writer);
XML_RET_CHECK_AND_GOTO (ret, out);
- if (type == GF_CLUSTER_TYPE_TIER && i < hot_brick_count) {
- ret = xmlTextWriterEndElement (local->writer);
- XML_RET_CHECK_AND_GOTO (ret, out);
- }
- if (type == GF_CLUSTER_TYPE_TIER && i >= hot_brick_count) {
- ret = xmlTextWriterEndElement (local->writer);
- XML_RET_CHECK_AND_GOTO (ret, out);
- }
}
+ /* </coldBricks>*/
+ if (type == GF_CLUSTER_TYPE_TIER && i >= hot_brick_count) {
+ ret = xmlTextWriterEndElement (local->writer);
+ XML_RET_CHECK_AND_GOTO (ret, out);
+ }
/* Tasks are only present when a normal volume status call is done on a
* single volume or on all volumes