How can I gather a list of registered applications from the command line of the JTS server?
In version 6.0.3, is there a good way to get a list of registered applications either using the console of the JTS server (e.g., Bash) or else through an API? I need to automate gathering a list of registered applications across a large number of JTS servers, and I would prefer avoiding the web GUI.
Accepted answer
Option 1: Use the JTS discovery service
First find the discovery URL from the JTS rootservices document
curl -k 'https://YOUR_JTS_HOSTNAME:9443/jts/rootservices'
Then use the discovery URL to list the registered applications
curl -k 'https://YOUR_JTS_HOSTNAME:9443/jts/discovery?type=http://jazz.net/xmlns/prod/jazz/discovery/1.0/Application'
The pages return XML content and neither should require any authentication.
Option 2: Use the repotools listFriends command
Change to the server directory and run
./repotools-jts.sh -listFriends repositoryURL=https://YOUR_JTS_HOSTNAME:9443/jts adminUserId=YOUR_USERID adminPassword=YOUR_PASSWORD
Or create a file credentials.properties containing these two values
adminUserId=YOUR_USERIDand run
adminPassword=YOUR_PASSWORD
./repotools-jts.sh -listFriends repositoryURL=https://YOUR_JTS_HOSTNAME:9443/jts credentialsFile=credentials.properties
This will output a combined list of registered applications and friends in plain text format. The registered applications will have a valid SCR URL value while the friends will list an SCR URL of null.
One other answer
I believe the URL /jts/friends will give you what you need. This is a protected resource so you have to log in with the proper credentials to access it. Using a script, it should be the same process as when you try to access other OSLC resources, and you can find plenty of sample codes on this forum.