<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Discovery Pattern Looping in ITOM forum</title>
    <link>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042821#M101703</link>
    <description>&lt;P&gt;You would put all the zones in a table and then Transform the table and call that API using EVAL() on each row putting the shares into a new column in each row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for example in the EVAL() you could put this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;var rtrn = '';
&amp;nbsp;
var command =&amp;nbsp;&amp;nbsp;"show lb vserver " + ${vserversTable[].vsvrName};
var rule_def = CTX.getCommandManager().shellCommand(command, false, null, null, CTX);
rtrn = rule_def;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Which would run the command for each vsvrName in the vserversTable and store the output into whichever column name the Transform table operation was set to hold that output in.&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 27 Sep 2018 20:27:48 GMT</pubDate>
    <dc:creator>johnnyjava</dc:creator>
    <dc:date>2018-09-27T20:27:48Z</dc:date>
    <item>
      <title>Discovery Pattern Looping</title>
      <link>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042820#M101702</link>
      <description>&lt;P&gt;Is it possible to perform a loop within a pattern?&amp;nbsp; We have a EMC Isilon Storage device that has multiple zones.&amp;nbsp; File shares can be assigned to any of those zones.&amp;nbsp; 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.&amp;nbsp; Is that possible or is there another way to handle it?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 20:01:55 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042820#M101702</guid>
      <dc:creator>garylfry</dc:creator>
      <dc:date>2018-09-27T20:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Discovery Pattern Looping</title>
      <link>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042821#M101703</link>
      <description>&lt;P&gt;You would put all the zones in a table and then Transform the table and call that API using EVAL() on each row putting the shares into a new column in each row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for example in the EVAL() you could put this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;var rtrn = '';
&amp;nbsp;
var command =&amp;nbsp;&amp;nbsp;"show lb vserver " + ${vserversTable[].vsvrName};
var rule_def = CTX.getCommandManager().shellCommand(command, false, null, null, CTX);
rtrn = rule_def;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Which would run the command for each vsvrName in the vserversTable and store the output into whichever column name the Transform table operation was set to hold that output in.&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Sep 2018 20:27:48 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042821#M101703</guid>
      <dc:creator>johnnyjava</dc:creator>
      <dc:date>2018-09-27T20:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Discovery Pattern Looping</title>
      <link>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042822#M101704</link>
      <description>&lt;P&gt;Excellent advice, thanks I appreciate the quick reply&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 20:31:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042822#M101704</guid>
      <dc:creator>garylfry</dc:creator>
      <dc:date>2018-09-27T20:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Discovery Pattern Looping</title>
      <link>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042823#M101705</link>
      <description>&lt;P&gt;Surely - so, with table variables, the "tableName[].column" means this particular row being processed. the "tableName[*].column" means all the values for the columns at once. Be careful to notice that the autocomplete will usually put the * in there.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 20:33:07 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042823#M101705</guid>
      <dc:creator>johnnyjava</dc:creator>
      <dc:date>2018-09-27T20:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Discovery Pattern Looping</title>
      <link>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042824#M101706</link>
      <description>&lt;P&gt;excellent advice from john, just wanted to point out Isilon discovery was released(if i'm not mistaken) in the October content shipping package available in the ITOM store. have you tried it out? it might fit your devices configuration.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is the official documentation:&lt;/P&gt;
&lt;P&gt;https://docs.servicenow.com/bundle/store-it-operations-management/page/product/itom/concept/emc-isilon-discovery.html&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 00:04:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042824#M101706</guid>
      <dc:creator>daniel_badyan</dc:creator>
      <dc:date>2018-09-28T00:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: Discovery Pattern Looping</title>
      <link>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042825#M101707</link>
      <description>&lt;P&gt;Thanks, yes I have been testing with it.&amp;nbsp; There is an issue with it at the moment.&amp;nbsp; I have opened a Ticket about it and waiting for a resolution.&amp;nbsp; The issue is with the way it calls the Rest-API to gather the nfs and smb information.&amp;nbsp; The following calls:&lt;/P&gt;
&lt;P&gt;"https://" + $host + ":8080/platform/3/protocols/nfs/exports”&lt;BR /&gt;"https://" + $host + ":8080/platform/3/protocols/smb/shares"&lt;/P&gt;
&lt;P&gt;only retrieve information from the system zone.&amp;nbsp; In order to get the exports and shares from each zone you would need to make the calls to each zone like the following:&lt;/P&gt;
&lt;P&gt;"https://" + $host + ":8080/platform/3/protocols/nfs/exports?zone=ZoneName”&lt;BR /&gt;"https://" + $host + ":8080/platform/3/protocols/smb/shares?zone=ZoneName”&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your reply&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 11:09:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042825#M101707</guid>
      <dc:creator>garylfry</dc:creator>
      <dc:date>2018-09-28T11:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Discovery Pattern Looping</title>
      <link>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042826#M101708</link>
      <description>&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 21:36:38 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042826#M101708</guid>
      <dc:creator>daniel_badyan</dc:creator>
      <dc:date>2018-09-28T21:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Discovery Pattern Looping</title>
      <link>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042827#M101709</link>
      <description>&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 22:41:33 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042827#M101709</guid>
      <dc:creator>johnnyjava</dc:creator>
      <dc:date>2018-09-28T22:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Discovery Pattern Looping</title>
      <link>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042828#M101710</link>
      <description>&lt;P&gt;Yes they are Rest.&amp;nbsp; Can you make RestAPI calls using EVAL()?&lt;/P&gt;
&lt;P&gt;Thanks for your advice, I appreciate it&lt;/P&gt;</description>
      <pubDate>Sat, 29 Sep 2018 01:29:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042828#M101710</guid>
      <dc:creator>garylfry</dc:creator>
      <dc:date>2018-09-29T01:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Discovery Pattern Looping</title>
      <link>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042829#M101711</link>
      <description>&lt;P&gt;yes, you can. here is a similiar iterative rest call from the F5 Rest pattern:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;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;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 29 Sep 2018 12:33:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042829#M101711</guid>
      <dc:creator>daniel_badyan</dc:creator>
      <dc:date>2018-09-29T12:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Discovery Pattern Looping</title>
      <link>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042830#M101712</link>
      <description>&lt;P&gt;Sorry didnt see this earlier the INT # is&amp;nbsp;INT3886573.&amp;nbsp; Let me know if you need any additional information.&amp;nbsp; I appreciate your help&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 12:38:39 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/discovery-pattern-looping/m-p/1042830#M101712</guid>
      <dc:creator>garylfry</dc:creator>
      <dc:date>2018-10-02T12:38:39Z</dc:date>
    </item>
  </channel>
</rss>

