Forum Discussion
Derek_Murphy_38
Nimbostratus
Aug 21, 2012API doc for iControl?
Hi,
I was wondering if there was an API doc that explained top level down what was available to call etc. I just installed the icontrol gem for ruby and looked at some of the examples, but was w...
Darrell_G_36120
Altocumulus
Aug 21, 2012Here's a snippet of my updated f5-node-initiator (this was the one good example of pool/node manipulation using the Ruby iControl).
collect list of existing pool member definitions
pool_members = bigip['LocalLB.Pool'].get_member_v2([ pool_name ])[0].collect do |pool_member|
pool_member['address'] + ':' + pool_member['port'].to_s
end
don't attempt to add member if it already exists
unless pool_members.include?('/Common/' + node_name + ':' + node_port.to_s)
bigip['LocalLB.Pool'].add_member_v2([ pool_name ], [[{ 'address' => node_name, 'port' => node_port.to_i }]])
puts ' Node "' + node_name + ':' + node_port + '" added to "' + pool_name + '" pool...'
else
puts ' Node "' + node_name + ':' + node_port + '" already exists in "' + pool_name + '". Not added.'
end
Here's the link to the original: https://devcentral.f5.com/wiki/icontrol.NodeInitiator.ashx
Hope it helps.
--Darrell G.
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