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-10 11:32:09 -0700
commite3e25e81e53fb8c5fdea315a52bca73e3176ef05 (patch)
tree51e8f667320bb744641ad8e7b2043417797eecc7 /cli
parent489f02879afd940d201d092720dbf13b2922b134 (diff)
gluster v status --xml for a replicated hot tier volume
back port of : http://review.gluster.org/#/c/12302/ <?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> Change-Id: Id354d0969dc7665f082c4d95a423e087878cdb68 BUG: 1269125 Signed-off-by: Hari Gowtham <hgowtham@redhat.com> Reviewed-on: http://review.gluster.org/12322 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> 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 87bd058..9fa13c8 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