Forum Discussion
elastic_82555
Nimbostratus
Sep 24, 2013Retrieving VS, pool, and nodes from F5
Hi,
Using Chef extensively internally, and now would like to take all the node ip's(hostnames) out of chef, then programatically(using RESTful) interface, query the F5, to retrieve the nodes, pool...
- Oct 09, 2013
Example Python code:
try: logging.info("Connecting to BIG-IP and pulling statistics...") b = bigsuds.BIGIP(hostname=ltm_host, username=user, password=password) logging.info("Requesting session...") b = b.with_session_id() except bigsuds.Connecti , detail: logging.critical("Unable to connect to BIG-IP. Details: %s" % pformat(detail)) sys.exit(1) logging.info("Setting recursive query state to enabled...") b.System.Session.set_recursive_query_state(state='STATE_ENABLED') logging.info("Switching active folder to root...") b.System.Session.set_active_folder(folder="/")
elastic_82555
Nimbostratus
Oct 10, 2013Hi, Yes, that was the magic. Using the ruby icontrol, and using the example filelist-virtual-servers.rb, here are the code changes
bigip = F5::IControl.new(bigip_address, bigip_user, bigip_pass, ["LocalLB.VirtualServer", "LocalLB.Rule", "System.Session"]).get_interface
sapi = bigip["System.Session"]
puts "recursive query state = ", sapi.get_recursive_query_state.to_s
sapi.set_recursive_query_state(state='STATE_ENABLED')
puts "recursive query state = ", sapi.get_recursive_query_state.to_s
The rest of the code is left as is, and this produces the entire list. Also for further reference, used the following links to fill in the background on "folders" with F5.
https://devcentral.f5.com/articles/icontrol-101-24-folders
many thanks
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