We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to get the ILO IP addresses for all servers returned by GetServerHardwareList()
Using:# go version go version go1.15.6 linux/amd64 OneView Client API Version: 2000
GetIloIPAddress() works with GetServerHardwareByName() because it sets the Client member:
serverHardwareList.Members[0].Client = c
GetServerHardwareList() does not set the Client member for each server, leaving it as nil, so GetIloIPAddress() panics:
For example, these will panic in GetIloIPAddress() because the Client member is not set:
filters := []string{""} ServerList, err := ovc.GetServerHardwareList(filters, "", "", "", "") for i := 0; i < ServerList.Total; i++ { iloIpaddress := ServerList.Members[i].GetIloIPAddress() }
OR
filters := []string{""} ServerList, err := ovc.GetServerHardwareList(filters, "", "", "", "") for _, serverName := range ServerList.Members { iloIpaddress := serverName.GetIloIPAddress() }
I can workaround it by setting the Client member before using GetIloIPAddress() but it would be better to have it set in GetServerHardwareList():
This will display all the server ILO IP addresses returned by GetServerHardwareList():
filters := []string{""} ServerList, err := ovc.GetServerHardwareList(filters, "", "", "", "") for i := 0; i < ServerList.Total; i++ { ServerList.Members[i].Client = ovc } for i := 0; i < ServerList.Total; i++ { iloIpaddress := ServerList.Members[i].GetIloIPAddress() }
The text was updated successfully, but these errors were encountered:
@mikeshapp Hi Mike, Thanks for pointing this out, this has been taken care in new PR, and changes will show up in coming release.
Sorry, something went wrong.
Since this enhancement is added to source code, good to close the issue.
I tested it with this code and it works correctly (no longer panics):
filters := []string{""} ServerList, err := ovc.GetServerHardwareList(filters, "", "", "", "") for _, serverName := range ServerList.Members { iloIpaddress := serverName.GetIloIPAddress() fmt.Printf("Server Name: %-30s ILO: %s\n", serverName.Name, iloIpaddress) }
AsisBagga
No branches or pull requests
I'm trying to get the ILO IP addresses for all servers returned by GetServerHardwareList()
Using:# go version
go version go1.15.6 linux/amd64
OneView Client API Version: 2000
GetIloIPAddress() works with GetServerHardwareByName() because it sets the Client member:
GetServerHardwareList() does not set the Client member for each server, leaving it as nil, so GetIloIPAddress() panics:
For example, these will panic in GetIloIPAddress() because the Client member is not set:
OR
I can workaround it by setting the Client member before using GetIloIPAddress() but it would be better to have it set in GetServerHardwareList():
This will display all the server ILO IP addresses returned by GetServerHardwareList():
The text was updated successfully, but these errors were encountered: