Forum Discussion
vinzclortho
Nimbostratus
Mar 10, 2014Using System::Connections::delete_active_connection in ruby iControl Gem
I am attempting to delete active connections for a particular IP using the ruby iControl gem. I want to mirror the functionality of the tmsh command : delete /sys connection cs-client-addr To...
vinzclortho
Nimbostratus
Mar 11, 2014Got this working with 0 for all ports and "0.0.0.0" for all IPs. I also had to change the format a bit. Evidently the ruby gem is not expecting a "connections" hash key, just an array. Thanks for the help, Jason.
Working code :
def delete_active_connections(ip_addr)
result = conn["System.Connections"].delete_active_connection([{
"clientside_client" => {"port" => 0, "address" => ip_addr},
"clientside_server" => {"port" => 0, "address" => "0.0.0.0"},
"serverside_server" => {"port" => 0, "address" => "0.0.0.0"},
"protocol" => "PROTOCOL_ANY"
}])
result
end
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