Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

[RM] Creation of Baseline in Non-GC RM Project using OSLC

 Hello,

 
 I am looking for some examples to create baseline for non-GC projects of DNG PA.

Tried for Baseline : Response is 202 Accepted.
But Baseline was not created. Any leads here ?

0 votes



7 answers

Permanent link

POST to what URI? You cannot POST to the stream.
You can only create a baseline by POSTing to the baseline's LDPC of the stream.

See https://docs.oasis-open-projects.org/oslc-op/config/v1.0/psd01/config-resources.html#shape-stream.

So the sequence would be:
  1. GET the stream
  2. Extract the URI of the baselines LDPC.
  3. Take the RDF from the GET, replace the title and description, remove any rdf:type of oslc_config:Stream , add rdf:type of oslc_config:Baseline . You may also need to add prov:wasDerivedFrom to reference the stream URI. The important point here is that you have to POST RDF content that is a valid baseline, including any mandatory properties.POSTing just a title and description may be insufficient.
  4. POST that RDF to the baselines LDPC URI from step 2.
  5. For a 202 response, look at the Location header to get the URI of a oslc_config:Activity .
  6. Poll that activity with GETs until it is completed. Then look at the information in the completed activity.


1 vote

Comments

 URI https://xxx/rm/cm/stream/_ovO15tKLEeuaG5VmJAdw1w/baselines

          
Body
         
  <oslc_config:Baseline>
    <dcterms:description>Description</dcterms:description>
    <dcterms:title rdf:parseType="Literal">Power BI - example Initial Stream</dcterms:title>
  </oslc_config:Baseline>

Even though Response is 202 and GET on location header
Response os Not found on activity.

What headers are you including in the POST?
The body shown doesn't look like valid RDF/XML
You can use the RDF validator at http://rdfvalidator.mybluemix.net/ to check that your POST body is valid RDF.

If you want people to help you with REST APIs, as Ralph commented, show the full details of the request (URI, headers and body), and of the response (headers and body).

The GCM application uses POST requests to stream's baselines LDPC for both DOORS Next and ETM, and this works fine.


Permanent link

 If you have API questions, provide the details of what you have done. Request, URI, headers. Do not expect the forum users to assume stuff from references to other posts. If you are not willing to spend the time creating a useful question, do not hope for a useful answer.

0 votes

Comments

Sorry Ralph. Please find the details below 


Permanent link

 URI : https://xxx/rm/cm/stream/_ovO15tKLEeuaG5VmJAdw1w/baselines


Headers : 
 Accept : application/rdf+xml
 OSLC-Core-Version : 2.0
 Content-Type : application/rdf+xml
  X-Jazz-CSRF-Prevent : JSessionID

Body

  <oslc_config:Baseline>
   <dcterms:title rdf:parseType="Literal">Create Via OSLC</dcterms:title>
        <dcterms:description rdf:parseType="Literal">Test description</dcterms:description>
  </oslc_config:Baseline>
</rdf:RDF>

0 votes


Permanent link

202 Accepted is the expected response since it is a long running operation.
See https://docs.oasis-open-projects.org/oslc-op/config/v1.0/psd01/config-resources.html#longoperations for further information.

0 votes

Comments

I tried to doing a get on content location for an activity.  

Exception is 
    <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Create Child Configuration Task</dcterms:title>
    <dcterms:references>
      <oslc:Error>
        <oslc:statusCode>0</oslc:statusCode>
        <oslc:message>Unexpected exception while executing task</oslc:message>
      </oslc:Error>
    </dcterms:references>
  </oslc_config:Activity>


Permanent link

Your POST body is very sparse. Try doing a GET on the stream you want to create a baseline from, and using the RDF from that with changes to the RDF types, title, description and POST that modified content.

0 votes

Comments

Did the get and performed the POST Operation. Its stating method not allowed 405


       <dcterms:description>Description</dcterms:description>
      <dcterms:title rdf:parseType="Literal">Power BI - example Initial Stream</dcterms:title>
  </oslc_config:Baseline>
</rdf:RDF> 

Still not successful


Body
  <oslc_config:Baseline>
    <dcterms:description>Description</dcterms:description>
    <dcterms:title rdf:parseType="Literal">Power BI - example Initial Stream</dcterms:title>
  </oslc_config:Baseline>

</rdf:RDF> 


Performing GET on location header leads to "Not Found"


Permanent link

@Chandan I'm not going to respond to any more posts on this topic until you include the following information:

  • The request URI
  • The request headers
  • The request body
  • The response headers
  • The response body
As per my previous comment, your POST body isn't valid RDF.
But until you provide the above details, it's unlikely anyone is going to help you further.

0 votes


Permanent link

POST 

URI https://xxx/rm/cm/stream/_ovO15tKLEeuaG5VmJAdw1w/baselines

Headers : Accept : application/rdf+xml
                OSLC-Core-Version : 2.0
                Content-Type : application/rdf+xml
                 X-Jazz-CSRF-Prevent : JSessionID

Body
  <oslc_config:Baseline>
    <dcterms:description>Description</dcterms:description>
    <dcterms:title rdf:parseType="Literal">Power BI - example Initial Stream</dcterms:title>
    <prov:wasDerivedFrom rdf:resource="https://xxx/rm/cm/stream/_ovO15tKLEeuaG5VmJAdw1w" />
  </oslc_config:Baseline>
</rdf:RDF>

Response :
Status Code : 202 Accepted

GET 
Headers : Accept : application/rdf+xml
                OSLC-Core-Version : 2.0

Response
  <rdf:Description>
    <err:errorMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Not found</err:errorMessage>
  </rdf:Description>
</rdf:RDF>

0 votes

Comments

Most likely the POST request body contains incorrect data.   

Note that some objects need to have a about URI that is NOT NULL. E.g. about="https://nowhere.net/". It might not matter what the URI is, it just has to be a URI and can not be empty. 

In Turtle, the POST request is:

@prefix acc:   <http://open-services.net/ns/core/acc#> .
@prefix process: <http://jazz.net/ns/process#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix ldp:   <http://www.w3.org/ns/ldp#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix oslc_config: <http://open-services.net/ns/config#> .
@prefix prov:  <http://www.w3.org/ns/prov#> .
@prefix oslc:  <http://open-services.net/ns/core#> .

[ a oslc_config:Baseline ; dcterms:description "Description" ; dcterms:title "Power BI - example Initial Stream"^^rdf:XMLLiteral ; prov:wasDerivedFrom <https://xxx/rm/cm/stream/_ovO15tKLEeuaG5VmJAdw1w> ] .

In essence, the subject is a blank node. As Ralph suggests, try a proper URI for the suibject.

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,937

Question asked: Jul 20 '22, 7:54 a.m.

Question was seen: 1,798 times

Last updated: Jul 21 '22, 10:20 a.m.

Confirmation Cancel Confirm