It's all about the answers!

Ask a question

RDNG Publish API and unrelaiable behaviour when accessing modules


Bartosz Chrabski (3.4k22949) | asked Mar 07 '17, 3:02 p.m.
edited Mar 07 '17, 3:03 p.m.

When using RDNG Publish API I figured out really weird behaviour when I am accessing modules in a specific project. For some projects all modules are returned and for some only small subset.


Below two examples:

result: 
<ds:dataSource appId="RRC" rrm:totalCount="4" vMajor="60" vMinor="02">
This is working fine - 4 modules in project and 4 modules returned using publishing API



result:
<ds:dataSource appId="RRC" href="https://server2:9443/rm/publish/modules?scoped=true&size=100&projectURI=_cnAsUCsgEeWKUsdTFNz7Cg&token=_H68S8ANvEeexwe7ftoMOEw&page=1" rel="next" rrm:totalCount="3" vMajor="60" vMinor="02">

Second example is not working at all, 49 modules in the project and only 3 returned.

Can anybody explain how to make it more reliable and how to get all the results ?


Comments
Donald Nong commented Mar 08 '17, 11:34 p.m.

I doubt that anybody can help you here unless someone happens to have seen the exact same issue before. How do we know that there are indeed 49 modules in the second project? I suggest you contact Support if the issue really bugs you.


Bartosz Chrabski commented Mar 09 '17, 3:44 a.m.

 We know exact number from RDNG UI


Rosa Naranjo commented Mar 12 '18, 3:56 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

Hello Bartosz
What do you get when you request the URI that is in the href? https://server2:9443/rm/publish/modules?scoped=true&size=100&projectURI=_cnAsUCsgEeWKUsdTFNz7Cg&token=_H68S8ANvEeexwe7ftoMOEw&page=1%22

do you get 46 which is 49-3?


Bartosz Chrabski commented Mar 12 '18, 5:02 p.m.

 Rosa, I need to find this example on one of my VMs. As you see publish date is March 7th 2017 (a year ago). I can say my focused change a bit since than :).


Rosa Naranjo commented Mar 12 '18, 5:29 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

Bartosz
There is no need to go through that trouble for me. If it comes up again, then we can revisit.


Bartosz Chrabski commented Mar 12 '18, 5:40 p.m.

Thx! 

showing 5 of 6 show 1 more comments

Accepted answer


permanent link
Petru Acsinte (1311) | answered Mar 12 '18, 1:37 p.m.
JAZZ DEVELOPER

Hi,

Both examples are working as expected, with example 2 TBD by consuming all the pages. The behavior is the following:
- totalCount = no of artifacts (i.e. ds:artifact) present in the server response; if the server response is paged, then totalCount = no of artifacts present in the currently returned response page

The response is automatically paged by the server when no size is specified. Even if a size parameter is specified, it is up to the server to page. This follows the REST Reporting Services API specification from https://open-services.net/pub/Main/ReportingHome/Reportable_Rest_Services_Interfaces-OSLC_Submission.pdf.

Here is the extracted pertinent information:

A reportable REST service may support returning data across multiple pages. The REST service
determines the size of each page based on its internal implementation capabilities and performance
issues. When there are additional pages, attributes are added to the root XML element describing
how to get the next page of data.

If the REST service determines that the data requested by a URL needs to be broken up into multiple pages, it will set the attributes of the root XML element (in this case href is present in your second example).
Any element with a sequence of zero or more child elements in the document may be split into multiple pages. Callers check the root element for the paging attributes and continue to HTTP GET the next page
until there is no href attribute returned. The content returned across all pages is defined to
be the union of all elements in each page.

In your case, complete response total count += rrm:totalCount(each page)

Note that there is no requirement about the number of pages, the number of records per page, data
volume of each page, or the relative size of one page compared to the other. Whether or not data
is returned in multiple pages and what logic determine what is on each page is completely up to
the implementation of the REST service.

Bartosz Chrabski selected this answer as the correct answer

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.