How can I create via API in DNG a delivery session?
Accepted answer
This is the API landing page for all applications: https://jazz.net/wiki/bin/view/Deployment/CLMProductAPILanding
8 other answers
Dear Ralph,
thank you very much for the links. I am really a beginner and tried hard but landing always in the Response 405 Method not allowed.
OSLC-Core-Version: 2.0
Accept: application/rdf+xml
Content-Type: application/rdf+xml
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:oslc_config="http://open-services.net/ns/config#"
xmlns:oslc_cm="http://open-services.net/ns/cm#"
xmlns:dng_config="https://jazz.net/ns/rm/dng/config#"
<oslc:service>
<oslc:Service>
<oslc:creationFactory>
<oslc:CreationFactory>
</oslc:resourceShape>
</oslc:deliverySession>
</oslc:CreationFactory>
</oslc:creationFactory>
</slc:Service>
</oslc:service>
</rdf:RDF>
Could you please give me a short feedback, if I am completely on the wrong way or what my mistakes are?
Thank you very much in advance.
Antje
Comments
I can now create and deliver a new delivery session. This works, if the original change set is on the stream created, on which it has to be delivered. My request looks like this:
OSLC-Core-Version: 2.0
Accept: application/rdf+xml
Content-Type: application/rdf+xml
Configuration-Context: [change-Set-Uri]
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
<j.0:DngCmDeliverySession>
<oslc:serviceProvider rdf:resource="[path]/rm/oslc_rm/[project_uri]/services.xml"/>
<dcterms:title rdf:parseType="Literal">Composite Delivery per API</dcterms:title>
<j.0:source rdf:resource="[change-Set-Uri]"/>
<j.0:target rdf:resource="[stream-Uri-of-target-stream]"/>
<j.0:DngCmDeliveryPolicy>
<j.0:dominantSourceAttribute rdf:resource="[attribute-uri-of-target-stream]"/>
</j.0:DngCmDeliveryPolicy>
</j.0:DngCmDeliverySession>
</rdf:RDF>
But if I want to deliver the same change Set to another stream, it does not work. Is there anybody you can help me by solving this?
Thank you in advance
I think I have got one more information: I can create a new delivery session on a different stream (use for the target the streamUri of the different stream). But only if the change set was not delivered before on the origin stream. But on the UI I can deliver the change set more than one time and to different streams.
If I try to create a new delivery session on a different stream and set as target the streamUri of the different stream - on the UI the changeset is created on the same stream as the changeset was created...
So I have two questions:
can I deliver change sets via the API more than one time?
how can I create change sets on another stream if the target does not work?
Comments
POST https://nowhere.nix/
OSLC-Core-Version: 2.0
Accept: application/rdf+xml
Content-Type: application/rdf+xml
Configuration-Context: [change-Set-Uri]
My last trials:
###
POST [https://URL]
Accept: application/rdf+xml
OSLC-Core-Version: 2.0
Content-type: application/rdf+xml
Configuration-Context: [some change-set-URL]
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:oslc_config="http://open-services.net/ns/config#"
xmlns:acc="http://open-services.net/ns/core/acc#"
<oslc_config:Stream rdf:about="[some change-set-URL]">
<oslc:serviceProvider rdf:resource="[service-provider-URL]"/>
<dcterms:title rdf:parseType="Literal">Change Set created from API</dcterms:title>
<process:projectArea rdf:resource="[project-area-URL]"/>
<oslc_config:component rdf:resource="[component-URL]"/>
<oslc_config:stream rdf:resource="[stream-URL]"/>
<oslc_config:overrides rdf:resource="[stream-URL]"/>
<oslc_config:derivedFrom="[the origin change-set-URL"/>
</oslc_config:Stream>
</rdf:RDF>
I receive the answer: "HTTP/1.1 200 OK" and "Content-Length: 0": but with no change-set-URI in it? And no change set on the stream is created.
Can you please give me a hint, what I have to change?
Thank you in advance
My last trials:
###
POST [https://URL]
Accept: application/rdf+xml
OSLC-Core-Version: 2.0
Content-type: application/rdf+xml
Configuration-Context: [some change-set-URL]
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:oslc_config="http://open-services.net/ns/config#"
xmlns:acc="http://open-services.net/ns/core/acc#"
<oslc_config:Stream rdf:about="[some change-set-URL]">
<oslc:serviceProvider rdf:resource="[service-provider-URL]"/>
<dcterms:title rdf:parseType="Literal">Change Set created from API</dcterms:title>
<process:projectArea rdf:resource="[project-area-URL]"/>
<oslc_config:component rdf:resource="[component-URL]"/>
<oslc_config:stream rdf:resource="[stream-URL]"/>
<oslc_config:overrides rdf:resource="[stream-URL]"/>
<oslc_config:derivedFrom="[the origin change-set-URL"/>
</oslc_config:Stream>
</rdf:RDF>
I receive the answer: "HTTP/1.1 200 OK" and "Content-Length: 0": but with no change-set-URI in it? And no change set on the stream is created.
Can you please give me a hint, what I have to change?
Thank you in advance
See https://jazz.net/library/article/92596 how to get the code.
Look at the constructor of ChangeSet, you need a fake URI for the change set, the target configuration, and a title.
Also look into the createChangeSet method. Please note, that you do not get a change set URI back with the POST. You need to use a task tracker to monitor the creation status. Once the creation is finished, you get the change set URI back.
The task tracker API is documented with the DNG server APIs
The task tracker API is documented with the DNG server APIs
See the method trackCreation.
Comments
POST [URI]
Accept: application/rdf+xml
OSLC-Core-Version: 2.0
Content-type: application/rdf+xml
Configuration-Context: [stream-URI / change-set-URI: I've tried both, I can see no difference in the response]
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc="http://open-services.net/ns/core#"
xmlns:j.0="http://open-services.net/ns/config#"
<dcterms:title rdf:parseType="Literal">Change Set created from API</dcterms:title>
<j.0:stream rdf:resource="[streamUri]"/>
<j.0:component rdf:resource="[componentUri]"/>
</j.0:Configuration>
</rdf:RDF>