Discovery Pattern Looping

garylfry
Tera Contributor

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?

10 REPLIES 10

Thanks, yes I have been testing with it.  There is an issue with it at the moment.  I have opened a Ticket about it and waiting for a resolution.  The issue is with the way it calls the Rest-API to gather the nfs and smb information.  The following calls:

"https://" + $host + ":8080/platform/3/protocols/nfs/exports”
"https://" + $host + ":8080/platform/3/protocols/smb/shares"

only retrieve information from the system zone.  In order to get the exports and shares from each zone you would need to make the calls to each zone like the following:

"https://" + $host + ":8080/platform/3/protocols/nfs/exports?zone=ZoneName”
"https://" + $host + ":8080/platform/3/protocols/smb/shares?zone=ZoneName”

I am confident ServiceNow will fix it but I asked the question because I was curious on how you can handle that type of discovery.

 

Thanks for your reply

Gary, if you don't mind could you post or send me the INT number so i could take a look? i'm from the patttern dev team so this could be in my area.

Sorry didnt see this earlier the INT # is INT3886573.  Let me know if you need any additional information.  I appreciate your help

well, what type of calls are these? REST? We could probably work out a short term solution if you cannot wait for a fix from SN.

Yes they are Rest.  Can you make RestAPI calls using EVAL()?

Thanks for your advice, I appreciate it