Forum Discussion
13 Replies
Sort By
- OTS02CirrusOK, I see that "new" should not be capitalized, but am still having trouble getting this thing off the ground.
- You need to declare your MemberStatisticEntry as a 2-d array per the API definition. Also, the first parameter needs to be an array of pool names. This code should work for you:
public UInt64 build64(iControl.CommonULong64 ul64) { return (UInt64)((UInt64)(ul64.high << 32) | (UInt64)ul64.low); } public void getPoolMemberStatistics(string pool, string memberaddr, int memberport) { string [] pool_names = new string[] { pool }; iControl.CommonIPPortDefinition[][] members = new iControl.CommonIPPortDefinition[1][]; members[0 ] = new iControl.CommonIPPortDefinition[1]; members[0][0] = new iControl.CommonIPPortDefinition(); members[0][0].address = memberaddr; members[0][0].port = memberport; iControl.LocalLBPoolMemberMemberStatistics [] stats = m_interfaces.LocalLBPoolMember.get_statistics(pool_names, members); //Loop over the pools for (int i=0; i { Console.WriteLine("Pool: {0}", pool_names[ i ]); // Loop over the pool members for each pool for (int j = 0; j < stats[ i ].statistics.Length; j++) { Console.WriteLine(" Member -> {0}:{1}", stats[ i ].statistics[ j ].member.address, stats[ i ].statistics[ j ].member.port.ToString()); for(int k=0; k < stats[ i ].statistics[ j ].statistics.Length; k++) { Console.WriteLine(" {0} -> {1}", stats[ i ].statistics[ j ].statistics[ k ].type.ToString(), build64(stats[ i ].statistics[ j ].statistics[ k ].value).ToString()); } } } }
- OTS02CirrusThank you so much Joe!