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

Creating labresources using the REST API via the POST

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?

0 votes



6 answers

Permanent link
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?

0 votes


Permanent link
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?

0 votes


Permanent link
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?

0 votes


Permanent link
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?

0 votes


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

0 votes


Permanent link
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"}

0 votes

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

Question asked: Mar 30 '10, 10:28 p.m.

Question was seen: 6,942 times

Last updated: Mar 30 '10, 10:28 p.m.

Confirmation Cancel Confirm