What is the gcUri parameter that CLM RM DNG 6.0.3 requests?
HTTP Get requests to the DNG Query Capability now fail with a Response asking for a mandatory gcUri parameter. What value should be supplied and in which Header or URL Parameter should it appear?
3 answers
Hi Lonnie,
Here's the syntax/explanation from the OSLC Configuration Management spec (https://tools.oasis-open.org/version-control/svn/oslc-ccm/trunk/specs/config-mgt/config-resources.html - Configuration Context section):
If you don't specify a context, your link might resolve to the artifact in the default stream.A client requests a specific configuration context in one of two ways:
- When performing a GET on a concept URI, add a
Configuration-Context
header, passing the URI of a configuration resource as the value:Example 1GET /resources/conceptResourceA HTTP/1.1 Configuration-Context: http://example.com/configurations/myConfiguration1</pre> </div> </li> <li> When performing a GET on a concept URI, add a query string <code> oslc_config.context </code> and the encoded configuration URI to the end of the request URI: <div class="example"> <div class="example-title"> <span>Example 2</span> </div> <pre class="example">
GET /resources/conceptResourceA?oslc_config.context=%3Chttp%3A//example.com/configurations/myConfiguration1%3E HTTP/1.1
</pre> </div> </li> </ul> If a request contains both a header and a query string, the server <i class="rfc2119" title="MUST">MUST</i> use the query string. Servers <i class="rfc2119" title="SHOULD">SHOULD</i> reject requests that contain two or more different configuration contexts passed in query strings. <p> Where the Configuration-Context header is used on a request, a server <i class="rfc2119" title="SHOULD">SHOULD</i> include in the response a header <code> Vary=Configuration-Context </code> so that different configuration contexts do not use a previously cached response. </p>
There are more details on how to integrate with config-management-enabled projects at https://jazz.net/wiki/bin/view/Deployment/IntegratingWithConfigurationManagementEnabledCLMApplications.
Hope that helps!
Comments
Kathryn,
- How to perform the more complex oslc.query=true case, not the simpler GET of a single resource. (If well implemented, the tactics should be the same, but we know that they often can differ.)
- How to diagnose the complaint response about the missing "gcUri" which appears whether oslc_config.context appears as a URL parameter, as an Configuration-Context header, or both.
Re: getting at the logs... do you have application admin access on the RM server? If so, you can "manage all projects", go to the Debug page and select Logging from the left-hand menu to get to the logs in case there are more details there.
No, not for this particular repo. It is a jazz.net system and the users there intentionally are not granted the Admin rights.
Kathryn,
Examples with actual expected error responses are also very useful.
The OASIS specification provides the following example GET:
GET /resources/conceptResourceA HTTP/1.1 Configuration-Context: http://example.com/configurations/myConfiguration1
If the sought version of a resource exists within a particular Stream (which may be Local and it could be Global) then is that Configuration Context the URI of the contextual Stream? In DNG--as you may well know--those URIs look like:
https://jazz.net:443/sandbox01-rm/cm/stream/_4uP0cOVgEeazUcKMez0U3gIf not, is the URL supposed to be a URL into the /gc/configurations realm? If so, how are Local Configuration Streams supported? Does the contextual "Component" also need to be specified, somehow?
For example, with the GC app of Jazz.net's CLM 6.0.3 sandbox, the Local Stream of interest, the Stream within which I want to execute the OSLC Query (not a mere GET but an OSLC Query Specification query) has a URL of:
I have done some testing using my jazz.net sandbox RM project (CM-enabled) but not been able to trigger the complaint about gcUri. All my attempts successfully returned the requirements that I wanted. Here are some observations.
1. Start with the queryCapability URI found in the RM project's service document.
2. Add oslc.prefix, oslc.where and/or oslc.select as desired.
3. Add oslc_config.context (preferred) or vvc.configuration to specify a stream (in the local configuration), which looks like https://jazz.net/sandbox01-rm/cm/stream/_rZ1hkPJlEeaL6Oj2reeudg.
4. Optionally, add HTTP header Configuration-context (may work as a URL parameter as well) to specify the GC configuration, which looks like: Configuration-context : https://jazz.net/sandbox01-gc/configuration/1218.
5. When both Configuration-context and oslc_config.context/vvc.configuration are present, Configuration-context takes precedence. This means, if an RM stream/configuration is found in the specified GC configuration, the OSLC query is done in this stream, regardless what oslc_config.context/vvc.configuration specifies. However, if the GC configuration contains no RM stream/configuration, Configuration-context gets ignored, and the stream specified by oslc_config.context/vvc.configuration takes effect. My understanding is that it is not necessary to specify Configuration-context.
I did not do back-to-back comparison with an RM 6.0.2 environment so cannot comment on the difference between the two versions. As of this writing, jazz.net sandbox is at 6.0.3 iFix001.
Comments
Donald,
By the way, one of the differences between 6.0.2 and 6.0.3 is that the published QueryBase in 6.0.2 has hardcoded within it the Jazz-internal vvc.configuration URL Parameter. In 6.0.3, DNG no longer includes that parameter as part of the QueryBase.
Donald,
- Describe your GC/RM setup. For example (a GC Stream, with a Component X, including an RM Local Stream)
- Confirm that Configuration-Context is absolutely never necessary if one provides context in the oslc_config.context parameter.
- Confirm that your OSLC Query result set is actually for only the resources visible within the expected context and that you are not getting a "False Positive" from a query run outside the intended context.
<oslc:queryBase rdf:resource="https://jazz.net/sandbox01-rm/views?oslc.query=true&projectURL=https%3A%2F%2Fjazz.net%2Fsandbox01-rm%2Fprocess%2Fproject-areas%2F_MxnNoeTIEeazUcKMez0U3g"/>
Darn picky server. I found the issue.
Comments
I'm glad that you've finally nailed it. Just to confirm, is it all about the port number, rather than the difference between 6.0.2 and 6.0.3?
Well, I think ultimately the root cause is a horribly misleading error response! ;-)
Comments
Lonnie VanZandt
Feb 13 '17, 8:17 p.m.Attempting to figure out the right set of Headers, URL Parameters, and Encodings for the OSLC Query interface for DNG RM 6.0.3, I encounter the following server Response. Can anyone spot and describe what mistake I made in the provided information or what information I neglected?
Lonnie VanZandt
Feb 12 '17, 11:32 p.m.Lonnie VanZandt
Feb 12 '17, 11:36 p.m.GET /sandbox01-rm/views?oslc.query=true
Lonnie VanZandt
Feb 12 '17, 11:37 p.m.This site won't accept a dump of Markdown for API Blueprint and so some messy comments follow.
Lonnie VanZandt
Feb 12 '17, 11:38 p.m.I don't have access to RM's log and so can't go look at the error messages that may be there.
Lonnie VanZandt
Feb 13 '17, 10:52 p.m.Lonnie VanZandt
Feb 13 '17, 9:36 p.m.Note that the url property shown above, in use, is UTF-8 URL encoded. This website will not allow that the actual strings to be submitted.