Forum Discussion
TC
Nimbostratus
Mar 07, 2014Virtual Server Scripting
Hi All
We have a LTM/APM configuration, and have customised the APM logon screen. We now have quite a number of virtual servers and currently to put the virtual servers into maintenance we chang...
Kevin_Stewart
Employee
Mar 07, 2014If you're running 11.4 or above you could incorporate the new iControl REST API. Here's what that might look like with cURL:
Removing the access profile:
curl -sk -u admin:admin -X DELETE https://x.x.x.x/mgmt/tm/ltm/virtual/my_vs/profiles/my_access_profile
Adding the access profile:
curl -sk -u admin:admin -X POST https://x.x.x.x/mgmt/tm/ltm/virtual/my_vs/profiles -d '{"name":"my_access_profile"}' -H "Content-Type: application/json"
It'd be pretty straight forward to incorporate these REST calls into a Perl, Python, PowerShell, or Bash script.
You could also, alternatively, use a data group to manage maintenance. Something like this:
when HTTP_REQUEST {
if { [class match [virtual] equals maint_mode] } {
ACCESS::disable
pool maintmode_pool
}
}
where "maint_mode" is a string-based data group containing the names of virtual servers that you want to be in maintenance mode. Example:
ltm data-group internal maint_mode {
records {
/Common/my-vs1 { }
}
type string
}
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