It's all about the answers!

Ask a question

Get more elements than 100 through DNGReportableRestAPI


TGS Thales (1514) | asked Mar 27 '17, 1:00 p.m.

Hello,

We try to retrieve all resources of a project with a provided stream, through the "DNGReportableRestAPI".
And it seems that we retrieve only 100 elements.

In this documentation, DNGReportableRestAPI, the note about the "get All' request type, talks about "using a default page size of 100 artifacts".

But, we cannot retrieve more than 100 artifacts.

It is something that we miss ? 


Accepted answer


permanent link
Donald Nong (14.5k614) | answered Mar 31 '17, 12:42 a.m.
edited Mar 31 '17, 12:44 a.m.

I thought it was quite straightforward, but it seems not. The API returns the results in pages, and by default 100 per page.

When you get a page, regardless the page size, you should have the first line similar to this:
<ds:dataSource xmlns:ds="http://jazz.net/xmlns/alm/rm/datasource/v0.1" xmlns:rrm="http://www.ibm.com/xmlns/rrm/1.0/" xmlns:attribute="http://jazz.net/xmlns/alm/rm/attribute/v0.1" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:history="http://jazz.net/xmlns/alm/rm/history/v0.1" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" appId="RRC" href="https://clm603.example.com:9443/rm/publish/resources/*?scoped=false&size=100&projectURI=_DHfKwAjwEeePre_VWPaB3A&token=_oEahkBXKEee-A9dLR8klSA&page=1" rel="next" rrm:totalCount="100" vMajor="60" vMinor="03">

The link in the "href" tag is for the next page. Just follow the link to get the next page and you will get a new link. Follow it, new page, new link, and so on, till the end.

TGS Thales selected this answer as the correct answer

Comments
TGS Thales commented Apr 04 '17, 12:50 p.m.

Thanks for your answer ! It works.

2 other answers



permanent link
Kenji Sarai (96039) | answered Mar 29 '17, 4:22 a.m.

Hi,
I have retrieved all before, and it worked as expected. But it seriously impacted the DNG server performance (as there are tens of thousands of artifacts), so it is not really recommended. If you would like to get more than 100, then try to add ?size= such as https://server:port/rm/publish/[artifact_format]/*?size=500
 


permanent link
TGS Thales (1514) | answered Mar 29 '17, 4:55 a.m.

Hi Kenji.

First of all, thank you for your answer.

In fact, my real need is to re-create the DNG project.
So I need to retrieve all artifacts, but like you say, there is a seriously impact of performances.

I try to get the folders, and for each 'user' request, get modules and for each module, get resources (so the list of artifacts will be filtered) but it seems that it is not possible to retrieve folders.I already post in the forum (https://jazz.net/forum/questions/237370/retrieve-folders-from-rest-api).
And also, I can not get modules when i provide a streamID.

So i though that the only way to rebuild  a DNG project, is to get all artifacts and exploit the 'parentURL' to recreate a tree. But with only 100 artifacts, I have some node which have no 'known' parent.

Maybe someone has an idea ?

Thanks for your help.


Comments
Philipp Waldinger commented Mar 29 '17, 9:53 a.m. | edited Mar 29 '17, 10:00 a.m.

I dont know your requirements for the recreated project area, but if you only want to create a "copy" of an existing projectarea, maybe Projectarea Templates (not Process Templates) are a sufficient way?


You can find them in the "Tab" "Templates" of the projectarea properties.
In such a template, you can include or exclude all data for which there is a checkbox in the dialogue:

Create Template

You can even download such a template and upload it to another server.

Of course this is no solution if you want to perform the copy programmatically in another application.


TGS Thales commented Mar 29 '17, 9:59 a.m.

Thank Philip.
But my goal is to extract the informations of all artifacts in a project and inject in an other tool.

Your answer


Register or to post 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.