Discovery Pattern Looping

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2018 01:01 PM
Is it possible to perform a loop within a pattern? We have a EMC Isilon Storage device that has multiple zones. File shares can be assigned to any of those zones. I can call a RestAPI to retrieve all zones but need to loop through the results and make another call to the RestAPI call to retrieve the smb and nfs shares within that zone. Is that possible or is there another way to handle it?
Labels:
- Labels:
-
Discovery
10 REPLIES 10

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2018 05:33 AM
yes, you can. here is a similiar iterative rest call from the F5 Rest pattern:
this.httpCall = Packages.com.snc.sw.commands.HttpCallHandler;
var httpClient = new httpCall();
var ciType = CTX.getAttribute('pattern_cit_id');
var vlan = ${vlan_list[].vlans};
var rtn = "";
var url = "https://" + ${computer_system.managementIP} + "/mgmt/tm/net/vlan/"+vlan+"/interfaces";
var response = httpClient.invoke(CTX,url, 'GET',null,null,ciType,"","true");
rtn = response;