Pattern Designer - Looping through table entries

Alex228
Tera Contributor

I am using pattern designer for Linux server discovery and need to configure a HTTP step to loop over multiple table entries

 

There is one field 'resources' that needs to be dynamic so that I can take each row of the table entry and pass it into this field.

 

I have tried playing around multiple times with EVAL script but with no luck. The closest I have come is having the HTTP call execute the correct number of times (the number of rows in $VMs, but the value is always the first value in the table. 

 

Is there a scripting format that I missing here, any advice would be appreciated.

 

Thanks

http.PNGvmID.PNG

 

2 REPLIES 2

Niks1
Tera Contributor

Hi Alex,

Did you get the resolution for the issue ?
If yes then could you please share the approach that resolved this issue for you ?

Regards,
Niks

Churchie
Tera Guru

I think you are going to need a script to loop through the VMs.

create a Set Parameter Value step operation and then in the EVAL(javascript), recreate the variables there and make the HTTP calls.
You will need to output the call responses to a new ArrayList() table where the rows are set with a HashMap() of name value pairs.
There are lots of examples of how this is done with the cloud patterns like AWS.
And for the http calls, look at the custom operations page for RHV HTTP Get Call (see attached).