Forum Discussion
Scot_Beery_8237
Nimbostratus
Mar 26, 2010poolmember set_ratio
I'm having troubles trying to set the poolmember ratio. This is my code:
Dim m_interfaces As iControl.Interfaces = New iControl.Interfaces
m_interfaces.initialize("171.21.1.150", "username", "pwd")
Dim pm As iControl.LocalLBPoolMember
pm = m_interfaces.LocalLBPoolMember
Dim memberinfo As New iControl.LocalLBPoolMemberMemberRatio
Dim member As New iControl.CommonIPPortDefinition
Dim ratios(0) As iControl.LocalLBPoolMemberMemberRatio
member.address = "IPAddress"
member.port = "8399"
memberinfo.member = member
memberinfo.ratio = 99
ratios(0) = memberinfo
Dim pool(0) As String
pool(0) = "POOLName"
pm.set_ratio(pool, ratios)
I keep getting the compile error below. If I switch ratios to type "object" then it doesn't error out till runtime. I cannot figure out the syntax of this call...can someone help.
Value of type '1-dimensional array of iControl.LocalLBPoolMemberMemberRatio' cannot be converted to '1-dimensional array of 1-dimensional array of iControl.LocalLBPoolMemberMemberRatio' because 'iControl.LocalLBPoolMemberMemberRatio' is not derived from '1-dimensional array of iControl.LocalLBPoolMemberMemberRatio'.
- The function definition for the LocalLB.PoolMember.set_ratio method is
set_ratio( in String [] pool_names, in LocalLB__PoolMember__MemberRatio [] [] ratios );
' Allocate poolNameA parameter of size 1 with single entry of "poolname" Dim poolNameA() As String = New String() {"poolname"} ' Allocate ratioAofA parameter of size 1,1 (one pool for first param, and one member for that pool). Dim ratioAofA()() As iControl.LocalLBPoolMemberMemberRatio ratioAofA = New iControl.LocalLBPoolMemberMemberRatio(0)() {} ' Allocate 2nd dimension of the array to be of size 1 ratioAofA(0) = New iControl.LocalLBPoolMemberMemberRatio(0) {} ' Allocate the structure in array value [0][0] ratioAofA(0)(0) = New iControl.LocalLBPoolMemberMemberRatio() ' Allocate the the member CommonIPPortDefinition structure ratioAofA(0)(0).member = New iControl.CommonIPPortDefinition() ' Fill in array value [0][0] ratioAofA(0)(0).member.address = "10.10.10.10" ratioAofA(0)(0).member.port = 8399 ratioAofA(0)(0).ratio = 99 m_interfaces.LocalLBPoolMember.set_ratio(poolNameA, ratioAofA)
pool_1 10.10.10.10:80, 99 20.20.20.20:80, 50 pool_2 30.30.30.30:80, 25 40.40.40.40:80, 30 50.50.50.50:80, 40
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