Forum Discussion
BigSuds: Different status on LocalLB.Pool.get_member_monitor_status
- Mar 23, 2015
Try this:
LocalLB.Pool.get_member_monitor_status(['pool_test_01', 'pool_test_02'], [[{'address': 'node001', 'port': 80}],[{'address': 'node001', 'port': 80}]])
Lots to review in these questions, and I'm not a big python guy so I'll do my best to describe how the APIs work and are parsed on the server side.
For this method:
MonitorStatus [] [] get_member_monitor_status(
in String [] pool_names,
in Common__AddressPort [] [] members
);
It would help to look at how we would have created the API for a single pool
MonitorStatus [] get_member_monitor_status(
in String pool_name,
in Common__AddressPort [] members
);
In that case, you pass in a single pool name and an array of pool members for that pool. The return is an array of MonitorStatus values, one for each pool member. That should make sense.
Now back to the multi-object API we have. The idea in the design was to allow you to do the same thing with "n" pools as you would with one in the single case. So for this, the parameters are a single array of pool names, and then a 2-d array of members (the first index in the array is just the ordinal for the pool, and the second is the array of items for each pool.
For your example of 2 pools with a single node:port, you still have to pass in the node:port individually for each pool. If you expand the arrays it would look like this in pseudo code
pool_names = array[2];
pool_names[0] = "pool_test_01"
pool_names[1] = "pool_test_02";
members = array[2][];
members[0] = array[1];
members[0][0] = new AddressPort();
members[0][0].address = 'node001'
members[0][0].port = 80
members[1] = array[1];
members[1][0] = new AddressPort()
members[1][0].address = 'node001'
members[1][0].port = 80
MonitorStatus [][] = get_member_monitor_status(pool_names, members);
On the server side, we first look at the "pool_names" parameter and loop over that array. Then for each entry, we take the associated 2'd dimension of the second array to get the list of members for the current pool.
In the first example above, you made the call without the second entry for the second pool. The server code, when iterating pool 2, found 0 members so ignored it.
I could give you some guidance on coding this in Perl or .NET but my python chops aren't there. Hopefully this gives you what you need to get the client parameters correct.
-Joe
Recent Discussions
Related Content
* 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