How to get the URL of the global configuration stream using its Nam via API?
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
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.
The GCM public REST APIs are documented at https://jazz.net/gc/doc/scenarios and https://jazz.net/wiki/bin/view/Deployment/CLMProductAPILanding.
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:
- Discover the OSLC Service Provider Catalog from the GCM application root services document. See https://jazz.net/gc/doc/scenario?id=Discovery
- Discover the OSLC service provider for the project area you are interested in.
- Discover the OSLC Query capability for components.
- 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
- Discover the OSLC Query capability for configurations
- 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
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
.
Comments
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!
@Davidhoney, Could you please share references for ETM (Quality Management) as well?
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.
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.
1 vote
Sure, Thanks for the info!