It's all about the answers!

Ask a question

Adding Artifacts to a module with OSLC and the ModuleApi


Andy Dennis (118) | asked Nov 06 '20, 11:14 a.m.

 I'm almost there with this, however I'm getting a 404 response with the PUT to update the module structure and I don't understand why


I use a Get the resource
            client.Headers.Add("DoorsRP-Request-Type", "public 2.0");
            client.Headers.Add("Accept", "application/rdf+xml"); 
GET https://<server>/rm/resources/_qsUS4R98Eeu9Cbv8kQ-y-Q/structure

I take the etag header and add it to the PUT's If-Match header then put back to the same URL

            client.Headers.Add("DoorsRP-Request-Type", "Public 2.0");
            client.Headers.Add("Accept", "application/rdf+xml");
            client.Headers.Add("Content-Type", "application/rdf+xml");
            client.Headers.Add("If-Match", etag);


PUT https://<server>/rm/resources/_qsUS4R98Eeu9Cbv8kQ-y-Q/structure

Result is a 404 Not Found

I don't understand why this is the case.  I assume I use the /structure suffix to post it back?

Anyone have any thoughts?

Thanks,
Andy.



Comments
Ian Barnard commented Nov 09 '20, 10:52 a.m. | edited Nov 09 '20, 11:22 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Yes you PUT back to the exact same URL you did the GET from - NOTE You need to specify the configuration on both the GET and PUT of the module structure (but not on the GET of the module artifact to find the structure URL) - are you doing this?


Andy Dennis commented Nov 11 '20, 11:43 a.m.

  Hi Ian, 

Thanks for your response.
No I'm not, but I don't have config management enabled on these projects at the moment. Should that make a difference?

Andy


Ian Barnard commented Nov 11 '20, 12:41 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

No that shouldn't matter. I haven't tried PUT for opt-out.


I just noticed your header: "DoorsRP-Request-Type", "Public 2.0"

The overview https://jazz.net/wiki/bin/view/Main/DNGModuleApiOverview shows using "public 2.0" which is what I always use - can you try that?

If that fails, have you tried to do GET then PUT in a browser base REST client like (for Firefox) RESTCLIENT? I suggest you get that to work (200 response) just initially putting back the same structure. Then get it to work with a small change you can check in the module.


Andy Dennis commented Nov 11 '20, 1:22 p.m.

Thanks.  I've tried both cases and it seems to not matter.  I'll see what i can do with a REST client


Andy Dennis commented Nov 12 '20, 6:20 a.m.

 Made some progress, kind of.

I now get a successful put on the structure but I get this message back when I poll the tracker.
The config I present in the binding is the same as that for the artifact.  It's also the same for the module itself - I don't have config management enabled on the project so I guess this is the default.

If I leave it out, it fails, so not sure what I need to put in here..


      <oslc:Error>

        <oslc:statusCode>400</oslc:statusCode>

        <oslc:message>Propagated exception; original message [BadRequestException: The configuration could not be found.  It could have been delivered or discarded.]</oslc:message>

      </oslc:Error>

Be the first one to answer this question!


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