How to extract a count of the number of Components in the repository
One answer
A quick and dirty way to do this would be with the SCM command line interface:
Capture the output to a file and count the results or pipe it into a program like wc and have it count the lines for you (untested but I don't see why it wouldn't work):
Or if you prefer you can write the output as JSON:
From there it's just a "simple matter of programming" to parse the JSON and count the components.
See http://www.ibm.com/support/knowledgecenter/SSYMRC_6.0.2/com.ibm.team.scm.doc/topics/list_components.html for the CLI scm list components command syntax.
lscm login -r https://clmserver.your.com:9443/ccm -n JU -u jazz_user -c Password (jazz_user @ https://clmserver.your.com:9443/ccm): Logged in to https://clmserver.your.com:9443/ccm lscm list components -r JU --all (1015) "Scrum001 Default Component" (1016) "Scrum002 Default Component" ...
Capture the output to a file and count the results or pipe it into a program like wc and have it count the lines for you (untested but I don't see why it wouldn't work):
lscm list components -r JU --all | wc -l
Or if you prefer you can write the output as JSON:
lscm list components -r JU --all --json { "components": [ { "name": "Scrum001 Default Component", "url": "https:\/\/clmserver.your.com:9443\/ccm\/", "uuid": "_4BSP0AXMEeaNrsV1PND6zw" }, ... }
From there it's just a "simple matter of programming" to parse the JSON and count the components.
See http://www.ibm.com/support/knowledgecenter/SSYMRC_6.0.2/com.ibm.team.scm.doc/topics/list_components.html for the CLI scm list components command syntax.