It's all about the answers!

Ask a question

Creating labresources using the REST API via the POST


Phil Rumble (6196) | asked Mar 30 '10, 10:28 p.m.
Ok,
I am attempting to create labresources using the REST API via the POST operation.

Call me stupid but I am unable to do so.

Here is what I am trying

host=https://tcbdb.tivlab.raleigh.ibm.com:9443

java -jar RQMUrlUtility.jar -command PUT -user $user -password $passwd -filepath /home/prumble/Projects/RQM/LabResources/solaris75.xml \
-url $host/jazz/secure/service/com.ibm.rqm.integration.service.IIntegrationService/resources/ITCAM%20for%20Transactions/labresource/solaris75.xml

and solaris75.xml is

<labresource><title>solaris75test</title><description>Solaris</description></labresource>

I have tried popuplating more data in the xml but I kept getting 413 errors.


My big question is what url should I use for the POST operation?
I do not want to specify an internal id ie urn:com.ibm.rqm:labresource:1 as I want to create a new labresource.

This link was helpful but not quite http://jazz.net/forums/viewtopic.php?t=6803&highlight=post+urn


Any Ideas?

6 answers



permanent link
John Nason (2.4k1012) | answered Mar 31 '10, 11:12 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Hi Phil,
It looks like you just need to chop "solaris75.xml" from the URL that you are POSTing to:
$host/jazz/secure/service/com.ibm.rqm.integration.service.IIntegrationService/resources/ITCAM%20for%20Transactions/labresource/solaris75.xml

That portion of the URL past /labresource/ would be where you would put the id for a PUT operation.

Let me know how it goes.

Regards,
John Nason

Ok,
I am attempting to create labresources using the REST API via the POST operation.

Call me stupid but I am unable to do so.

Here is what I am trying

host=https://tcbdb.tivlab.raleigh.ibm.com:9443

java -jar RQMUrlUtility.jar -command PUT -user $user -password $passwd -filepath /home/prumble/Projects/RQM/LabResources/solaris75.xml \
-url $host/jazz/secure/service/com.ibm.rqm.integration.service.IIntegrationService/resources/ITCAM%20for%20Transactions/labresource/solaris75.xml

and solaris75.xml is

<labresource><title>solaris75test</title><description>Solaris</description></labresource>

I have tried popuplating more data in the xml but I kept getting 413 errors.


My big question is what url should I use for the POST operation?
I do not want to specify an internal id ie urn:com.ibm.rqm:labresource:1 as I want to create a new labresource.

This link was helpful but not quite http://jazz.net/forums/viewtopic.php?t=6803&highlight=post+urn


Any Ideas?

permanent link
Phil Rumble (6196) | answered Mar 31 '10, 8:31 p.m.
No good,
Using the urls.
$host/jazz/secure/service/com.ibm.rqm.integration.service.IIntegrationService/resources/ITCAM%20for%20Transactions/labresource/
$host/jazz/secure/service/com.ibm.rqm.integration.service.IIntegrationService/resources/ITCAM%20for%20Transactions/labresource

Both give the same error.

Next?


RQMUrlUtility: Connected to blah:9443 using project "ITCAM+for+Transactions"
01/04/2010 8:29:09 AM org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
INFO: Redirect requested but followRedirects is disabled
RQMUrlUtility: Calling method to upload ATTACHMENT to Attachment Feed
RQMUrlUtility: Server Response code: 400



Hi Phil,
It looks like you just need to chop "solaris75.xml" from the URL that you are POSTing to:
$host/jazz/secure/service/com.ibm.rqm.integration.service.IIntegrationService/resources/ITCAM%20for%20Transactions/labresource/solaris75.xml

That portion of the URL past /labresource/ would be where you would put the id for a PUT operation.

Let me know how it goes.

Regards,
John Nason

Ok,
I am attempting to create labresources using the REST API via the POST operation.

Call me stupid but I am unable to do so.

Here is what I am trying

host=https://tcbdb.tivlab.raleigh.ibm.com:9443

java -jar RQMUrlUtility.jar -command PUT -user $user -password $passwd -filepath /home/prumble/Projects/RQM/LabResources/solaris75.xml \
-url $host/jazz/secure/service/com.ibm.rqm.integration.service.IIntegrationService/resources/ITCAM%20for%20Transactions/labresource/solaris75.xml

and solaris75.xml is

<labresource><title>solaris75test</title><description>Solaris</description></labresource>

I have tried popuplating more data in the xml but I kept getting 413 errors.


My big question is what url should I use for the POST operation?
I do not want to specify an internal id ie urn:com.ibm.rqm:labresource:1 as I want to create a new labresource.

This link was helpful but not quite http://jazz.net/forums/viewtopic.php?t=6803&highlight=post+urn


Any Ideas?

permanent link
John Nason (2.4k1012) | answered Apr 01 '10, 11:50 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Hmmm - looks like we might have a problem POSTing lab resources.
You can create new resources with PUT by specifying an id that does not exist. That's pretty easy to do by generating a random number to use with the PUT operation.
That will at least get you going while problems with POST are sorted out.

Regards,
John Nason

Ok,
I am attempting to create labresources using the REST API via the POST operation.

Call me stupid but I am unable to do so.

Here is what I am trying

host=https://tcbdb.tivlab.raleigh.ibm.com:9443

java -jar RQMUrlUtility.jar -command PUT -user $user -password $passwd -filepath /home/prumble/Projects/RQM/LabResources/solaris75.xml \
-url $host/jazz/secure/service/com.ibm.rqm.integration.service.IIntegrationService/resources/ITCAM%20for%20Transactions/labresource/solaris75.xml

and solaris75.xml is

<labresource><title>solaris75test</title><description>Solaris</description></labresource>

I have tried popuplating more data in the xml but I kept getting 413 errors.


My big question is what url should I use for the POST operation?
I do not want to specify an internal id ie urn:com.ibm.rqm:labresource:1 as I want to create a new labresource.

This link was helpful but not quite http://jazz.net/forums/viewtopic.php?t=6803&highlight=post+urn


Any Ideas?

permanent link
Phil Rumble (6196) | answered Apr 05 '10, 9:24 p.m.
I have tried creating a new resource with PUT by specifying an id that does not exist with success. Server returns error 201 though .

Any Ideas?

thanks

Hmmm - looks like we might have a problem POSTing lab resources.
You can create new resources with PUT by specifying an id that does not exist. That's pretty easy to do by generating a random number to use with the PUT operation.
That will at least get you going while problems with POST are sorted out.

Regards,
John Nason

Ok,
I am attempting to create labresources using the REST API via the POST operation.

Call me stupid but I am unable to do so.

Here is what I am trying

host=https://tcbdb.tivlab.raleigh.ibm.com:9443

java -jar RQMUrlUtility.jar -command PUT -user $user -password $passwd -filepath /home/prumble/Projects/RQM/LabResources/solaris75.xml \
-url $host/jazz/secure/service/com.ibm.rqm.integration.service.IIntegrationService/resources/ITCAM%20for%20Transactions/labresource/solaris75.xml

and solaris75.xml is

<labresource><title>solaris75test</title><description>Solaris</description></labresource>

I have tried popuplating more data in the xml but I kept getting 413 errors.


My big question is what url should I use for the POST operation?
I do not want to specify an internal id ie urn:com.ibm.rqm:labresource:1 as I want to create a new labresource.

This link was helpful but not quite http://jazz.net/forums/viewtopic.php?t=6803&highlight=post+urn


Any Ideas?

permanent link
Michael Triantafelow (4513) | answered Apr 07 '10, 3:34 p.m.
The HTTP response code 201 is not an error, it means "created" and indicates that your artifact was successfully created in the RQM database.

permanent link
Phil Rumble (6196) | answered May 26 '10, 8:24 p.m.
On Wed, 07 Apr 2010 19:37:14 +0000, MTriantafelow wrote:

The HTTP response code 201 is not an error, it means "created" and
indicates that your artifact was successfully created in the RQM
database.

I cannot see the entries in RQM even though the put was successful.

RQMUrlUtility: Calling method to upload XML from a specified
file to URL
RQMUrlUtility: Server Response code: 200
RQMUrlUtility: XML string from file : "./
labresourceLabMachine1_LR.xml" written to URL : "https://***/labresource/
labresourceLabMachine1_LR "

If I try to access that url I get this response

{"errorTraceMarshall":
,"errorCode":400,"errorTrace":
,"errorClass":"java.lang.IllegalArgumentException","errorMessage":"Item
Handle must not be null"}

Your answer


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.