How to query the version of CCM, QM and RM remotely
Accepted answer
You can see the version of RQM using the following URL in REST API:
https://jazz.net/sandbox02-qm/application-about
The XML has the node named jfs:version
https://jazz.net/sandbox02-qm/application-about
The XML has the node named jfs:version
Comments
One other answer
One can also parse the RootServices XML that each Jazz application exposes at URLs like https://some.jazz.com:9443/rm/rootservices.
Therein, you can find snippets like:
<oslc_rm:rmServiceProviders rdf:resource="https://some.jazz.com:9443/rm/oslc_rm/catalog" /> <oslc_rm:majorVersion>6</oslc_rm:majorVersion> <oslc_rm:version>6.0.1.0</oslc_rm:version> <oslc_rm:buildVersion>6.0.1</oslc_rm:buildVersion>
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='http://example.com/book'><bookml:title>Harry Potter</bookml:title></book>" var doc = new dom().parseFromString(xml)
var select = xpath.useNamespaces({"bookml": "http://example.com/book"});
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.
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.