It's all about the answers!

Ask a question

How to get the URL of the global configuration stream using its Nam via API?


sri K (157) | asked Jul 11 '23, 4:03 a.m.

 Hi Team, 


I am trying to get the configuration URL using its name via API, But I can't figure it out, Could you share me a example of how to achieve it.

I am able to get the Local stream URL using the following steps:
1. get Rootservices - using server name
2. get oslc catalog - using oslc_config_component_url
3. get project url - using oslc_config_component_url and project_name
4. get component url - using project_url & component_name
5. get component stream url - using component_url and stream name. But this doesn't show the global configuration. Please share your thoughts

Accepted answer


permanent link
David Honey (1.8k17) | answered Jul 11 '23, 5:19 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Multiple global configurations can have the same name if they are for different project areas or belong to different components. All the global configurations that belong to a specific component will have unique names. Global components must have unique names within a project area.


In general, if you know the name of the GC project area, the name of the global component, and the name of the global configuration, you might do the following:
  1. Discover the OSLC Service Provider Catalog from the GCM application root services document. See https://jazz.net/gc/doc/scenario?id=Discovery
  2. Discover the OSLC service provider for the project area you are interested in.
  3. Discover the OSLC Query capability for components.
  4. Use that query capability to query for components with a specified component name and get the component URI - see https://jazz.net/gc/doc/scenario?id=QueryComponents
  5. Discover the OSLC Query capability for configurations
  6. Use that query capability to query for components with a specified configuration name  and component URI, and get the configuration URI - see https://jazz.net/gc/doc/scenario?id=QueryConfigurations
An alternative to querying separately for component then configuration would be to query for configurations using nested properties. For example, an unencoded oslc.where of oslc_config:component{dcterms:title="Systems Global Configuration"} and dcterms:title="SGC Production stream" finds a global configuration named "SGC Production stream" belonging to a component named "Systems Global Configuration". Remember that HTTP parameter values must be URL encoded, so in the URI request this would be encoded as ?oslc.where=oslc_config%3Acomponent%7Bdcterms%3Atitle%3D%22Systems%20Global%20Configuration%22%7D%20and%20dcterms%3Atitle%3D%22SGC%20Production%20stream%22 .

See https://docs.oasis-open-projects.org/oslc-op/query/v3.0/os/oslc-query.html#oslc.where for the syntax of oslc.where .
sri K selected this answer as the correct answer

Comments
sri K commented Jul 11 '23, 5:59 a.m. | edited Jul 11 '23, 6:04 a.m.

Thanks, @Davidhoney, The references are really useful.


I tried the following url: https://<server>/gc/oslc-query/configurations?oslc.where=dcterms:title="<configuration>" 
It is working!


sri K commented Jul 11 '23, 6:04 a.m. | edited Jul 11 '23, 6:04 a.m.

 @Davidhoney, Could you please share references for ETM (Quality Management) as well?


David Honey commented Jul 11 '23, 6:06 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

You can find all the public REST APIs from https://jazz.net/wiki/bin/view/Deployment/CLMProductAPILanding. It's worth bookmarking that for future reference.


1
David Honey commented Jul 11 '23, 6:08 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If you query for configuration name only, then you might get multiple results. There could be multiple global configurations of some name belonging to different components. If you want to be sure of only a maximum of one result, you need to include a conditon of the component as well.


sri K commented Jul 11 '23, 6:09 a.m.

 Sure, Thanks for the info!

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.