Forum Discussion
williambb_9960
Nimbostratus
Sep 28, 2009Get Node Status in Visual Basic
I've been beating my head on sharp corners for a couple of days on this issue and am deferring to the experts. I'm fairly new to VB and very new to iControl. We're running LTM 9.3.1 and I need to get a list of nodes for an LTM and their enabled status. In my code below I'm getting an error on NodeName(0) passed to get_session_enabled_state of "Value of type 'string' cannot be converted to '1-dimensional array of String'."
Any help with this? (I have to use VB - we've adopted it as a standard for all development)
Module Module1
Sub Main()
Dim objLTM As New iControl.Interfaces()
objLTM.initialize(MyLTM, MyUID, MyPassword)
Dim arrNodes() As String = objLTM.LocalLBNodeAddress.get_list
Dim NodeName(0) As String
NodeName(0) = Node
Dim NodeState = New iControl.LocalLBEnabledStatus
NodeState = objLTM.LocalLBNodeAddress.get_session_enabled_state(NodeName(0))
Console.WriteLine(Node, " --> ", NodeState)
Next
End Sub
End Module
- The error is correct. The get_session_enabled_state method looks like this:
EnabledState [] get_session_enabled_state( in String [] node_addresses );
Dim node_list() As String = m_interfaces.LocalLBNodeAddress.get_list() Dim node_statuses() As iControl.LocalLBEnabledStatus node_statuses = m_interfaces.LocalLBNodeAddress.get_session_enabled_state(node_list) For i As Integer = 0 To node_list.Length - 1 Console.WriteLine("Node " & node_list(i) & " -> " & node_statuses(i).ToString()) Next
http://devcentral.f5.com/wiki/default.aspx/iControl/APIReference.html
- williambb_9960
Nimbostratus
Beautiful. Thx much Joe. I've been digging through the SDK and code shares but wasn't able to follow the iControl object references. I'm getting there and so far the iControl has a pretty sweet feature set. - Great. Please don't be shy in asking questions. We'll do our best to help you out.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects