- Community Home
- >
- Storage
- >
- HPE Nimble Storage
- >
- Array Setup and Networking
- >
- Need Get-FibreChannelInterface, Rest API makes eas...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2016 05:35 PM
06-06-2016 05:35 PM
Need Get-FibreChannelInterface, Rest API makes easy to roll your own.
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.
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;
PS:> .\get-fcinterfaces.ps1 | fc *
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.
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.
foreach($MyArray in $result.data.array_list) {
foreach($inter in (($MyArray).ctrlr_a_fc_config).fc_interface_list) {
$outer = add-member -inputobject $inter -membertype NoteProperty -name ArrayName -value $MyArray.array_name
$outer = add-member -inputobject $inter -membertype NoteProperty -name Controller -value "ctrlr_a_fc_config"
$outer
}
foreach($inter in (($MyArray).ctrlr_b_fc_config).fc_interface_list) {
$outer = add-member -inputobject $inter -membertype NoteProperty -name ArrayName -value $MyArray.array_name
$outer = add-member -inputobject $inter -membertype NoteProperty -name Controller -value "ctrlr_b_fc_config"
$outer
}
}
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.