How to query DNG for an ID using Web / REST API?
Hi,
Let's assume I have an ID of an requirement (e.g. 692990) and I need its uri to be able to request additional information using the resourceURI:
https://server:port/rm/publish/[artifact_format]?resourceURI=id1
How do I get the from 692990 to something like CA_52d580fa341e42fb9cfd445443543d9d?
I know that I can manually do a quick search in DNG, but I want something similar over the API, is this possible?
I mean if there is a way to get the list of possible URLs I could parse them and extract the resourceURIs.
How do I do that?
Best regards,
Florin
One answer
Hi Florin
One way, possibly the best way, is to use OSLC queries - these would allow you to search for your specific ID or a range of IDs, or even all artifacts in the configuration (although you need to be wary not to overload your server because queries do place a load on the server, so it is advisable to make more smaller queries than to make fewer larger queries, in order to minimise the impact on other users), and return the artifact URIs and possibly attribute values on those artifacts (depending on what you select to be returned).
There is some old but mostly relevant information about getting started with OSLC queries here: https://jazz.net/library/article/1197
What that article doesn't talk about is how to work when your project has configuration management enabled. I added quite some detail to a recent question about how to get to the QueryCapability in a particular configuration (i.e. in a component) here https://jazz.net/forum/questions/266334/dng-oslcfetch-components-from-project-area
HTH
Ian