It's all about the answers!

Ask a question

How to query the version of CCM, QM and RM remotely

Jeff Ong (14113846) | asked Mar 26 '16, 3:29 a.m.
edited Mar 27 '16, 4:08 a.m.
We have several instances of CCM, QM and RM and we would like to keep track of their versions.  Is there a way of querying their versions remotely.

Accepted answer

permanent link
Joao Carusi (26314) | answered Mar 27 '16, 8:40 a.m.
You can see the version of RQM using the following URL in REST API:

The XML has the node named jfs:version
Jeff Ong selected this answer as the correct answer

Donald Nong commented Mar 27 '16, 9:07 p.m.

Basically, all Jazz products provide the same URI for the version information.

Jeff Ong commented Mar 28 '16, 4:09 a.m.

Hi Joao/Donald,

Thanks that's what I've been looking for.  Now, I just have to figure out what to use to parse the REST API results.

Are these REST APIs documented somewhere ?  We would now like to find out what iFix is installed.

Donald Nong commented Mar 29 '16, 12:10 a.m.

I'm not aware any documents specifically mentioning about the "application-about" resource. It is revealed in the root services document, which is the very first document you need to get if you want to use OSLC.

But if you are trying to find out the iFix version, unfortunately it does not help, as it is "static". To find the iFix version, you may have to use the internal API. Simply click on the "About this Application" link in the Web GUI and monitor the network traffic (with Firebug or Chrome) and you will find it out.

One other answer

permanent link
Lonnie VanZandt (88217) | answered Jul 13 '16, 5:21 a.m.
 One can also parse the RootServices XML that each Jazz application exposes at URLs like

Therein, you can find snippets like:
	<oslc_rm:rmServiceProviders rdf:resource="" />
If you want to parse the XML you get back in your HTTP GETs, use existing libraries for DOM and XPath. (Please don't write your own from scratch).

In Node.js, you can "npm install xpath;npm install xmldom" and then pick out what you want with Xpath queries. Here's the snippet from xpath.js' site for how to deal with namespaced content.
var xml = "<book xmlns:bookml=''><bookml:title>Harry Potter</bookml:title></book>"
var doc = new dom().parseFromString(xml)
var select = xpath.useNamespaces({"bookml": ""});

console.log(select('//bookml:title/text()', doc)[0].nodeValue);
You can do similar parsing in Java, C++, or etc using the Xerces or Saxon parsers.
You could pluck out the particular element value with a simple regex -- but if you are going to try to find more than one string in the XML reliably, then using a library for XML parsing and XPath querying will pay off in the long run.

Your answer

Register or to post your answer.