Forum Discussion
andy_12_5042
Nimbostratus
Mar 01, 2011iterate over return of get_session_status
I have no issues with creating something like this and then get at the value assigned to port or whatever:
>>> test =m.typefactory.create('Common.IPPortDefinition')
>>> test
(Common.IPPortDefinition){
address = None
port = None
}
>>> test.port=80
>>> test.port
80
>>> test
(Common.IPPortDefinition){
address = None
port = 80
}
However, what I cant seem to wrap my head around is this:
[[(LocalLB.PoolMember.MemberSessionStatus){
member =
(Common.IPPortDefinition){
address = "1.1.1.1"
port = 80
}
session_status = "SESSION_STATUS_ENABLED"
}]]
How would I iterate over a bunch of members like this and get just the address:port:session_status values. I know this has to be something simple but for some reason I just can quote get it. I was able to grab the session_status but not quite the right way.. Anyway thanks for any pointers...
- andy_12_5042
Nimbostratus
so I ended up doing something like this: - L4L7_53191
Nimbostratus
That's the way to do it. One of the tricks with calls like this is that iControl allows you to query for an entire list of objects. So your get_session_status() call could actually contain a list like:
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