Forum Discussion
API's for assigning an iRule to a VIP/code
For the same case we use a little trick: we added a fake pool (POOL-trigger in code below) with one fake node without a monitor, that works just like trigger in an Irule.
In normal conditions than the fake node in Unknown state the Irule passes traffic to usual logic and than you disable the fake node by hand or API Irule switch traffic to a maintenace pool or hardcore text.
And this approach has nice benefit, you don't need to share admin account rights. Account with Operator role can execute this trigger.
when HTTP_REQUEST {
if { ([active_members POOL-trigger] < 1) } {
pool POOL-maintenance
}
else {
# usual logic
}
}
Sample API requests for disable/enable trigger node:
<PATCH> /mgmt/tm/ltm/pool/~partitionname~POOL-trigger/~partitionname~fakenode:443/ -d '{"session":"user-disabled"}'
<PATCH> /mgmt/tm/ltm/pool/~partitionname~POOL-trigger/~partitionname~fakenode:443/ -d '{"session":"user-enabled"}'
- Nikson_MOct 14, 2021Cirrus
Hi Maxim,
Do you know any links to these API's documentation?
Regards,
Nikhil Kulkarni.
Recent Discussions
Related Content
* 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