How get list of Global Stream present under project area using API
Accepted answer
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
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.
Comments
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
- Walk down the hierarchy to the leaves, performing an HTTP GET on each configuration.
- Use SPARQL on a Lifecycle Query Engine endpoint.
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?
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/.
- 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
- First Get the flat hierarchy List (inorder to get RM Stream URI) : https://localhost/gc/gcsdk-api/flatListOfContributionsForGcHierarchy?configurationUri=localhost/gc/configuration/154
- Then hit GET along with Accept header( inorder to get title of RM Stream) : https://localhost/rm/cm/stream/_xlWYhhE1EeyR0LNIOUaIuA
2 other answers
Have you looked at https://jazz.net/wiki/bin/view/Deployment/CLMProductAPILanding or https://jazz.net/gc/doc/scenarios?
Comments
@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:)
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