It's all about the answers!

Ask a question

Set reference to a Lab Resource in a Request programmaticaly


pietro marella (953130) | asked Mar 22 '11, 11:20 a.m.
Hi all -

I'm using the putArtifact method in the RQMRestClient class provided with the RQM REST Client code -
My goal is to do the following steps from my client code:
- create a Request
- fulfill the Request
- reserve a Lab Resource based on the request attributes -

I'm fine with these steps, and they work fine, but I have only a problem I'd like to address and solve.
Once I have identified the Lab Resource to be In the Request, I'm not able to set the reference to the lab resource in the Request.
I have noticed that the reference to the reserved Resource in a Request is in the <configuration> section, as for this example :

<ns2>
<identifier>request/RQ1</identifier>
<ns2>1</ns2>
<ns2>2011-03-16T23:00:00.000Z</ns2>
<ns2>2011-03-16T09:44:34.647Z</ns2>
<ns2>Request 1 </ns2>
-....................
<ns2>
{"Assets":{"AssetInstance":}}}}}]}},"theIdentifier":"_EASt8E-yEeC3cbH1m29F3w"}]}}
</ns2>
<ns2>
........

The Request object exposes a method setConfiguration, that accepts a String as parameter. so my idea is to use this method to set the reference to lab resource, but I don't know how to generate the string the method is expecting, since I do not have any way (at least for my knowledge) to get the "identifier" of the Lab Resource...

Anyone can explain me how to use it??

thanks in advance
*piero

One answer



permanent link
John Nason (2.4k1012) | answered Mar 22 '11, 5:11 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
Hi Piero,
The configuration in a Request describes the desired configuration, not a physical asset.
For instance, I am "requesting a machine with 1GB RAM". This is a description of the machine I am requesting and that is what getConfiguration/setConfiguration represents.
The Lab Resource is a physical machine - i.e. I am reserving myMachine.ibm.com which has 1GB of RAM. I suspect you want to set the lab resource that is reserved as part of the request? If that is the case, that is set via the Reservation and not the Request.
Hope that helps.

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.