Forum Discussion
jajamax_127538
Nimbostratus
Dec 03, 2003modify the LocalLBNode script???
I've got the LocalLBNode.pl working, but I'd like it to do more. Can anyone help with an "IF like" statement? What I'm wanting is basically this:
If node is enabled, then disable
If no...
Dec 06, 2003
What are the specifics of what you are doing? Are you looking for a "toggle" logic that will flip the node. The code in LocalLBNode.pl has the call to get_state() which returns the enabled state. It also illustrates the set_state() method to set the state to enabled or disabled. If you want to toggle, you can do something like this (minus the error checking)
Query the Node's state
$soap_response =
$soap->get_state
(
SOAP::Data->name ( node_def => $node_definition )
);
my $state = $soap_response->result;
my $toggleState;
if ( 0 == $state )
{
$toggleState = 1;
}
else
{
$toggleState = 0;
}
Toggle the state
$soap_response =
$soap->set_state
(
SOAP::Data->name ( node_defs => ( [$node_definition] ) ),
SOAP::Data->name ( state => $toggleState )
);
Hope this helps.
-Joe
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
