It's all about the answers!

Ask a question

How to get the list of module using an artifact (REST API)?


Pierre Bentkowski (131517) | asked Sep 17 '15, 1:02 p.m.
Hi

I want to get the list of all the module that make use a specific artifact.
I have access via the REST API to the artifact information in the context of the module and the core.
       https://<server>:<port>/rm/publish/resources?resourceURI=<GUID>

When looking at the results for the artifact in the context of a module, I can get the information about the current module (moduleContext), but not the other modules (was expected)
.
When looking at the core artifact I don't see any information relative to modules.

I do not want to query every module in the database to find the specified artifact.

Is there a flag to add in the query to get the information?

Regards


One answer



permanent link
Donald Nong (14.5k614) | answered Sep 29 '15, 1:45 a.m.
Sadly, if you use reportable REST API, you have to query every single module in order to find all the modules in which a particular artifact is used. Reportable REST API provides filtering capability, which is not the same as search/query capability. When using the filtering capability, you will potentially put a heavy load on the server.

You can use the OSLC query capability to do the following search.
1. Search by Id, and the result should contain one base/core artifact and zero to many module artifacts.
2. Use the oslc_rm:uses condition to search for modules based on the result returned at the previous step.

References:
https://jazz.net/library/article/1197
https://jazz.net/forum/questions/206109/rdng-601m1-returns-2-requirement-when-search-by-id-why

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.