<?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>topic Need Get-FibreChannelInterface, Rest API makes easy to roll your own. in Array Setup and Networking</title>
    <link>https://community.hpe.com/t5/array-setup-and-networking/need-get-fibrechannelinterface-rest-api-makes-easy-to-roll-your/m-p/6984296#M1222</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I found that a few operational commands just dont exist in the toolkit yet. An example would be a powershell command to return the World Wide Port Names of the Target Ports on my controllers.&lt;/P&gt;&lt;P&gt;Thanks Julian as he has shown me the way to quickly get this information. In this case I know that the data exists, I just dont know where to get it. So I used Julians API.zip file and ran the Get-Array PowerShell command and just looked at what API call it was going to use, and hijacking that call to get what I want instead I simply replaced the ":5392/v1/arrays/details" with ":5392/v1/fibre_channel_configs/detail" and the data that it gave me. Note: You can get the list of all valid API calls from the REST API guide. Since it returns the object, we can issue the command and explore the entire dataset that it returns by using the following syntax; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;PS:&amp;gt; .\get-fcinterfaces.ps1 | fc *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="explorer.jpg" class="jive-image image-1" height="468" src="https://community.hpe.com/legacyfs/online/2774_explorer.jpg" style="height: 468px; width: 468px;" width="468" /&gt;&lt;/P&gt;&lt;P&gt;Notice how I can find the information I want, its down the tree a little, but I can reformat the script to pull it forward and present me my data is a more readable way.&lt;/P&gt;&lt;P&gt;I can then choose to have my command walk through each Array in my array group, and then each controller in my individual arrays and expose these WWPNs. Also note the controller and arrayname did not exist at the same level as the data I want, so to make it more readable, I add both of these back into the lower object so that I have the view I want.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;foreach($MyArray in $result.data.array_list) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach($inter in (($MyArray).ctrlr_a_fc_config).fc_interface_list) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $outer = add-member -inputobject $inter -membertype NoteProperty -name ArrayName -value $MyArray.array_name&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $outer = add-member -inputobject $inter -membertype NoteProperty -name Controller -value "ctrlr_a_fc_config"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $outer&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach($inter in (($MyArray).ctrlr_b_fc_config).fc_interface_list) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $outer = add-member -inputobject $inter -membertype NoteProperty -name ArrayName -value $MyArray.array_name&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $outer = add-member -inputobject $inter -membertype NoteProperty -name Controller -value "ctrlr_b_fc_config"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $outer&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;With this output I can now get my WWPNs in a list. Note that this is a true object that is returned, so I dont need to write any text parsers, I can select and sort based on the data itself.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Get-FCInterface.jpg" class="jive-image image-2" height="534" src="https://community.hpe.com/legacyfs/online/2775_Get-FCInterface.jpg" style="height: 533.637px; width: 685px;" width="685" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jun 2016 00:35:24 GMT</pubDate>
    <dc:creator>Chris_Lionetti</dc:creator>
    <dc:date>2016-06-07T00:35:24Z</dc:date>
    <item>
      <title>Need Get-FibreChannelInterface, Rest API makes easy to roll your own.</title>
      <link>https://community.hpe.com/t5/array-setup-and-networking/need-get-fibrechannelinterface-rest-api-makes-easy-to-roll-your/m-p/6984296#M1222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I found that a few operational commands just dont exist in the toolkit yet. An example would be a powershell command to return the World Wide Port Names of the Target Ports on my controllers.&lt;/P&gt;&lt;P&gt;Thanks Julian as he has shown me the way to quickly get this information. In this case I know that the data exists, I just dont know where to get it. So I used Julians API.zip file and ran the Get-Array PowerShell command and just looked at what API call it was going to use, and hijacking that call to get what I want instead I simply replaced the ":5392/v1/arrays/details" with ":5392/v1/fibre_channel_configs/detail" and the data that it gave me. Note: You can get the list of all valid API calls from the REST API guide. Since it returns the object, we can issue the command and explore the entire dataset that it returns by using the following syntax; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;PS:&amp;gt; .\get-fcinterfaces.ps1 | fc *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="explorer.jpg" class="jive-image image-1" height="468" src="https://community.hpe.com/legacyfs/online/2774_explorer.jpg" style="height: 468px; width: 468px;" width="468" /&gt;&lt;/P&gt;&lt;P&gt;Notice how I can find the information I want, its down the tree a little, but I can reformat the script to pull it forward and present me my data is a more readable way.&lt;/P&gt;&lt;P&gt;I can then choose to have my command walk through each Array in my array group, and then each controller in my individual arrays and expose these WWPNs. Also note the controller and arrayname did not exist at the same level as the data I want, so to make it more readable, I add both of these back into the lower object so that I have the view I want.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;foreach($MyArray in $result.data.array_list) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach($inter in (($MyArray).ctrlr_a_fc_config).fc_interface_list) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $outer = add-member -inputobject $inter -membertype NoteProperty -name ArrayName -value $MyArray.array_name&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $outer = add-member -inputobject $inter -membertype NoteProperty -name Controller -value "ctrlr_a_fc_config"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $outer&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach($inter in (($MyArray).ctrlr_b_fc_config).fc_interface_list) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $outer = add-member -inputobject $inter -membertype NoteProperty -name ArrayName -value $MyArray.array_name&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $outer = add-member -inputobject $inter -membertype NoteProperty -name Controller -value "ctrlr_b_fc_config"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $outer&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;With this output I can now get my WWPNs in a list. Note that this is a true object that is returned, so I dont need to write any text parsers, I can select and sort based on the data itself.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Get-FCInterface.jpg" class="jive-image image-2" height="534" src="https://community.hpe.com/legacyfs/online/2775_Get-FCInterface.jpg" style="height: 533.637px; width: 685px;" width="685" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2016 00:35:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/array-setup-and-networking/need-get-fibrechannelinterface-rest-api-makes-easy-to-roll-your/m-p/6984296#M1222</guid>
      <dc:creator>Chris_Lionetti</dc:creator>
      <dc:date>2016-06-07T00:35:24Z</dc:date>
    </item>
  </channel>
</rss>

