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 ...
Sep 28, 2009
The error is correct. The get_session_enabled_state method looks like this:
EnabledState [] get_session_enabled_state(
in String [] node_addresses
);
It takes as input a string array of node_addresses you wish to query. You can just use the value returned from the LocalLB.NodeAddress.get_list() method. In your code you are passing in a single string, not the array. If you wish to query only a single object, then you'll need to create an array of size 1 and include the value you wish to query in there. Also, the value you are assigning the output to is of type iControl.LocalLBEnabledStatus while that should be an array as well to account for each of the objects passed in the node_addresses parameter.
The reason we designed the API to take arrays instead of singular values was to help with large configurations. For systems with 1000's of node addresses, it's much easier to make one call than 1000+ of them. And since we have close to 3000 methods in the iControl API it was too much on our side to implement 2 sets of methods to handle both bulk and single method calls.
Give this a shot:
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
In the future, for reference you can check out the iControl API reference wiki.
http://devcentral.f5.com/wiki/default.aspx/iControl/APIReference.html
Click here
Hope this helps...
-Joe
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