Forum Discussion
Andrew_Husking
Cirrus
Jan 31, 2017RESTAPI - Delete sys connection
I've been doing some work with the Rest API, and have been able to successfully show the connection table and limit it to a client address.
However I'd like to delete the connections for a speci...
tatmotiv
Cirrostratus
Feb 03, 2017I've done this via cli script with some variables:
cli script clearconns {
proc script::init {} {
}
proc script::run {} {
tmsh::delete sys connection cs-server-addr [lindex $tmsh::argv 1] cs-server-port [lindex $tmsh::argv 2] ss-server-addr [lindex $tmsh::argv 3] ss-server-port [lindex $tmsh::argv 4]
}
proc script::help {} {
}
proc script::tabc {} {
}
total-signing-status not-all-signed
}
This can be called from external via iControl REST, e.g. like this:
POST -H "Content-Type: application/json" https://mybigip/mgmt/tm/cli/script -d '{"command":"run","utilCmdArgs":"clearconns 10.1.2.3%23 443 10.45.67.89%23 80"}'
Don't forget to include the %nn suffix with the IP addresses when using route domains!
HTH Martin
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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