Forum Discussion
omniplex
Nimbostratus
Dec 22, 2008GTM Pools
Is there a trick to disabling a GTM pool used by a wide IP?
I can enable them just fine when they have been manually disabled, but for some reason the iControl interface just ignores the disable state and nothing happens.
Here is copy of the code in question:
@gtmPools = ('prod1','prod2','prod3','prod4');
@gtmEnabled=(1,1,1,1);
@gtmDisabled=(0,0,0,0);
$gtm = SOAP::Lite
-> uri('urn:iControl:GlobalLB/Pool')
-> proxy("https://$gtmHost:443/iControl/iControlPortal.cgi");
eval { $LBVirtual->transport->http_request->header
(
'Authorization' =>
'Basic ' . MIME::Base64::encode("$sUID:$sPassword", '')
); };
$soapResponse = $gtm->set_enabled_state(
SOAP::Data->name(pool_names => [@gtmPools]),
SOAP::Data->name(states => [@gtmDisabled])
);
@gtmStatus = @{$soapResponse->result};
The only difference between enable and disable code is the variable @gtmEnabled is used instead.
EDIT: I guess it would help to mention that this is perl.
- In V9, you'll have to use the string literals for the enumeration types. So, your code should look like this:
@gtmEnabled = ('STATE_ENABLED', 'STATE_ENABLED', 'STATE_ENABLED', 'STATE_ENABLED'); @gtmDisabled = ('STATE_DISABLED', 'STATE_DISABLED', 'STATE_DISABLED', 'STATE_DISABLED');
my @gtmPools; push @gtmPools, "prod1"; push @gtmPools, "prod2"; push @gtmPools, "prod3"; push @gtmPools, "prod4"; my @gtmEnabled; push @gtmEnabled, "STATE_ENABLED"; push @gtmEnabled, "STATE_ENABLED"; push @gtmEnabled, "STATE_ENABLED"; push @gtmEnabled, "STATE_ENABLED"; my @gtmDisabled; push @gtmDisabled, "STATE_DISABLED"; push @gtmDisabled, "STATE_DISABLED"; push @gtmDisabled, "STATE_DISABLED"; push @gtmDisabled, "STATE_DISABLED";
- omniplex
Nimbostratus
Unfortunately that didn't work either.xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> prod1 prod2 prod3 prod4 STATE_DISABLED STATE_DISABLED STATE_DISABLED STATE_DISABLED
xmlns:E="http://schemas.xmlsoap.org/soap/envelope/" xmlns:A="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.w3.org/2001/XMLSchema" xmlns:iControl="urn:iControl" E:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> xmlns:m="urn:iControl:GlobalLB/Pool">
- It looks as if it should work. I just tested it with this code
http://devcentral.f5.com/wiki/default.aspx/iControl/PerlGTMPool.html
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> gtm_pool STATE_DISABLED
> .\PerlGTMPool.pl bigip 443 user pass
- omniplex
Nimbostratus
Well, I ran your script which worked.
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