It's all about the answers!

Ask a question

How get list of Global Stream present under project area using API


Rajat Krishnan (721223) | asked Feb 02 '23, 2:07 a.m.
Hello Team,
I am trying to get below 2 things using API
  • List of Global Streams present under project area
  • List of RM Streams present under Global Stream
Could you please help me here

Thank you

Accepted answer


permanent link
David Honey (1.8k17) | answered Feb 03 '23, 5:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Feb 03 '23, 5:47 a.m.

The RDF representation of a stream is described in .the OSLC Configuration Management specification. See https://docs.oasis-open-projects.org/oslc-op/config/v1.0/ps01/config-resources.html#StreamShape.

Consider the following GC hierarchy:

    GC A
        GC B
            RM Stream1
The RDF representation of GC A will include a contribution from GC B . You will not see any reference to RM Stream 1 there because it is not a direct contribution. So you have to GET the RDF of GC B , and there you will see a contribution from RM Stream 1 .

If you want to get the recursive contributions of a GC, you cannot do that with an OSLC query - it doesn't have a syntax for recursive nested properties. You can do a sequenc of GETs, walking down the hierarchy.

Alternatively, you can use a non-OSLC GC SDK REST API for this - see https://jazz.net/gc/doc/scenario?id=GetFlatListOfContributionsForGcHiearchy.

Note that in either case, you cannot determine which configurations might be from RM. Configuration URIs are opaque and even with DOORS Next, a user might have chosen a context root that was non-standard. For example, instead of "rm" a user could have used "req" so that the context root was, for example, https://localhost:9443/req. You should avoid hard coding assumptions about context roots. If you know the context root of a specific RM server, you could identify which configurations matched that.

Another option is to execute a SPARQL query on a Lifecycle Query Engine SPARQL endpoint where that query uses a recursive SPARQL property path.

Rajat Krishnan selected this answer as the correct answer

Comments
Rajat Krishnan commented Feb 03 '23, 6:23 a.m.

With this actually i can get a hierarchy view but problem is i need stream title/name as well but any GC API gives only uri not title


David Honey commented Feb 03 '23, 6:29 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
There are only 2 ways of doing that:
  1. Walk down the hierarchy to the leaves, performing an HTTP GET on each configuration.
  2. Use SPARQL on a Lifecycle Query Engine endpoint.
GCM does not know anything about configurations contributed from other servers, such as RM, or QM. All it knows is the URI of the configuration and its corresponding component URI.

Rajat Krishnan commented Feb 03 '23, 6:42 a.m.
Walk down the hierarchy to the leaves, performing an HTTP GET on each configuration : lets say i have configuration URI as https://dngserver.public.name:port/rm/cm/stream/_XYZ,but now the problem is do we have any oslc available to get name out of configuration uri?


Rajat Krishnan commented Feb 03 '23, 7:12 a.m.
I have tried below api to get name from configuration uri

But problem is above api is private api and my focus is only to stick to public api from IBM

David Honey commented Feb 03 '23, 7:59 a.m. | edited Feb 03 '23, 8:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Just do a GET on the URI of the configuration with an Accept header with a supported RDF media type. Look at dcterms:title of the RDF returned in the response. As I mentioned previously, the RDF representation of a stream is described in .the OSLC Configuration Management specification. See https://docs.oasis-open-projects.org/oslc-op/config/v1.0/ps01/config-resources.html#StreamShape. You might also want to look at the OSLC Primer at https://open-services.net/resources/oslc-primer/.


Rajat Krishnan commented Feb 06 '23, 1:31 a.m.
@David Honey,
Thank you very much for your time and support, Just whatever i understood by jazz docs and your support, here is what i am concluding maybe any suggestion(if any) here would be appreciated

  • List of Global Streams present under project area
https://localhost/gc/oslc-query/configurations/_7jjZkDMMEeywZ_Gkmfhjbg?oslc.where=rdf%3Atype%3Doslc_config_ext%3ASharedStream&oslc.select=dcterms:title
  • List of RM Streams present under Global Stream
  1. First Get the flat hierarchy List (inorder to get RM Stream URI) : https://localhost/gc/gcsdk-api/flatListOfContributionsForGcHierarchy?configurationUri=localhost/gc/configuration/154
  2. Then hit GET along with Accept header( inorder to get title of RM Stream) : https://localhost/rm/cm/stream/_xlWYhhE1EeyR0LNIOUaIuA

showing 5 of 6 show 1 more comments

2 other answers



permanent link
David Honey (1.8k17) | answered Feb 02 '23, 5:13 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Comments
Rajat Krishnan commented Feb 02 '23, 11:38 p.m.

@David Honey, yes i did went through this wiki docs but was not helpful in my case or maybe i am unable to crack the API formation for my usecase:)


Rajat Krishnan commented Feb 03 '23, 1:57 a.m.
Plus i tried this query

My intention here is to get only shared stream list in response but i am getting all the things like staging baseline stream, shared stream, personal stream,...

permanent link
David Honey (1.8k17) | answered Feb 03 '23, 3:55 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

oslc.select specifies what data about each member is returned in the query. If you want to specify a query expression, use oslc.where . For example, if you want a query to return only shared streams you might use a query expression such as rdf:type=oslc_config_ext:SharedStream . Remember that parameter values need to be URL encoded, so the URI would include ?oslc.where=rdf%3Atype%3Doslc_config_ext%3ASharedStream . See https://docs.oasis-open-projects.org/oslc-op/query/v3.0/os/oslc-query.html and https://jazz.net/gc/doc/scenario?id=QueryConfigurations for more details.


Comments
Rajat Krishnan commented Feb 03 '23, 5:05 a.m. | edited Feb 03 '23, 5:13 a.m.
@David Honey, thanks for info but i am able to crack API to get list of Global Stream but still i am finding difficult to find list of RM Stream present under Global Stream
Please refer the image, now my exceptation is to get below output
Stream3

A

B
C
D
E
F
G
H

but it gives only limited information in response for e.g. it does not include information about hierarchy orderĀ  tags(RM,CCM)...

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.