REST API: Fast or Scalable way to get list of collections in a project?
Currently, I'm getting the list of collections in a project via https://server:port/rm/publish/collections?projectName="MyProject". The problem is that the query returns too much information (i.e. the collections plus all the linked items in the collections, plus basic information about the linked items.) With just 13 collections, it's taking 30 seconds for the query to return. Needless to say, when the number of collections (and the number of requirements in collections) grows, performance is going to suffer.
Using the REST API, does anyone know of a way to list just the collection URIs in a project? I've been fiddling with the reporting API, https://jazz.net/wiki/bin/view/Main/RRCReportableRestAPI, but nothing has worked. |
Accepted answer
Hi,
Using OSLC can help you to get the information, use following example ( adapt to your RRC environment ): https://gradev.ibm.com:9444/rdm/views?oslc.prefix=rdf=<http://www.w3.org/1999/02/22-rdf-syntax-ns%23>&oslc.select=*&oslc.where=rdf:type=<http://open-services.net/ns/rm%23RequirementCollection>&projectURL=https://gradev.ibm.com:9443/jts/process/project-areas/_TLBIUrGKEeGOR66SQRG0Cw Note: the %23 is the encoding of "#". If you need specific fields modify the oslc.select entry so you specify the fields needed in the response. Joseph Reedick selected this answer as the correct answer
Comments That was it. Many thanks! For posterity's sake: Get the Query Base: <oslc:querybase rdf:resource="https://myserver:1234/rm/views?oslc.query=true&projectURL=https%3A%2F%2Frrc.it.att.com%3A9443%2Fjts%2Fprocess%2Fproject-areas%2F_8q0ioCzTEeG6U9u3DDmcLw"/> Final query to return just the requirement collection links: Base query + &oslc.prefix=rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns%23,oslc_rm=http://open-services.net/ns/rm%23&oslc.where=rdf:type=http://open-services.net/ns/rm%23RequirementCollection&oslc.select=oslc_rm:RequirementCollection |
One other answer
Have you tried the RRC OSLC Query Capability Service Provider to obtain project requirements and collections?
You can find samples how to interact with the OSLC interface in the workshop document you find here: https://jazz.net/library/article/635 Comments
Joseph Reedick
commented Jun 12 '12, 5:23 p.m.
Yup, I've tried the query service, read the workshop, read the publishing/report api, etc.. Either I'm missing something obvious, or there simply isn't a lightweight means of getting the list of collections in a project via the REST api. |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.