How do I create a configuration in DNG via OSLC API
Hi,
I am trying to create configurations (streams, baselines, changesets) via the OSLC API.
I successfully can create components.
I implemented it according to:
(or at least I tried, not sure if the problem is on my side)
The steps
I am sending (POST) the following data
<rdf:RDF
to the following URI
this URI is read from the stream properties. A GET on this URI, pulls existing baselines. So it seems to be correct.
The Problem
The POST returns a 202, which I try to handle, by reading the URI in the Location header. This indicates that the configuration could not be created (and it is not).
https://xyz-dng-server/taskTracker/15647728-61ce-46a9-8d1e-4a1391150dc0 <rdf:RDF
Any idea if I am doing something wrong here? Especially I am not sure about the data to be sent.
I used a similar structure as for the component creation, except the oslc_config:Baseline instead of the oslc_config:Component
|
Accepted answer
Ian Barnard (2.3k●7●14)
| answered Mar 07 '22, 9:52 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Mar 08 '22, 4:18 a.m. 202 is the expected response - the Location header in the response is the TaskTracker, you have to poll this until it indicates completion. When it indicates completion, for a success the result is a URL of the new baseline, or for failure there might be some sort of error indication like you have.
When I've tried this the minimal content in the POST was:
<rdf:RDF
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc_config="http://open-services.net/ns/config#">
<oslc_config:Configuration rdf:about="https://jazz.ibm.com:9443/rm/cm/changeset/something">
<dcterms:title rdf:parseType="Literal">Title of the Baseline</dcterms:title>
<dcterms:description rdf:parseType="Literal">Some Description of Baseline</dcterms:description>
<oslc_config:component rdf:resource="https://jazz.ibm.com:9443/rm/cm/component/_4KRMENcKEeqXpuBdEolY7w"/>
</oslc_config:Configuration>
</rdf:RDF>
So maybe try removing the tag and short title, and adding the oslc_config:component. The description is I believe optional as well. Most likely the real problem is the missing oslc_config:component.
HTH
Ian
Arthur Kleer selected this answer as the correct answer
Comments See API Landing page: https://jazz.net/wiki/bin/view/Deployment/CLMProductAPILanding
See https://jazz.net/wiki/bin/view/Main/DNGServerAPI for the task tracker API.
Arthur Kleer
commented Mar 07 '22, 12:27 p.m.
Thanks,
the combination of adding oslc_config:component and the rdf:about in the oslc_config:Configuration (or oslc_config:Baseline, both work) did the trick.
|
One other answer
Ralph Schoon (63.6k●3●36●46)
| answered Mar 07 '22, 2:11 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER I have found https://jazz.net/forum/questions/249582/is-there-a-rest-api-for-dng-to-create-a-local-streamcomponent-and-baseline, maybe that helps. I used https://www.google.com/search?q=dng+create+stream+API+site%3Ajazz.net
I ran into a strange issue when creating change sets with the API, where the POST caused a null pointer exception in the server, unless you sent a valid URI (rdf:about). Consider GETting a configuration and see if there are properties missing.
Comments
Arthur Kleer
commented Mar 07 '22, 12:32 p.m.
without rdf:about, neither Baseline, Stream nor Changeset work for me. the TaskTracker always responds with "Unexpected exception while executing task", same when omitting the oslc_config:component. Cannot tell if that also caused a null pointer on server side.
With about and component, it works perfectly!
|
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.