Forum Discussion
royster_128009
Nimbostratus
Dec 03, 2004Previous SDKs
Hello.
I have some old code from a previous script which queries a 3DNS unit running v4.2ptf9
[...]
my $soap = SOAP::Lite
-> uri('urn:iControl:ITCMGlobalLB/Wideip')
-> readable(1)
-> proxy("https://$sHost:$sPort/iControl/iControlPortal.cgi");
[...]
my $soap_response = $soap->get_pool_list
(
SOAP::Data->name ( wideip_name => $wip )
);
if ( $soap_response->fault ) {
print $soap_response->faultcode, "(faultstring) ", $soap_response->faultstring, "\n";
print $soap_response->faultcode, "(faultdetail) ", $soap_response->faultdetail, "\n"; }
else
{
my @pool_def_list = @{$soap_response->result};
foreach my $pool_def (@pool_def_list) {
my $poolName = $pool_def->{"name"};
my $poolState = $pool_def->{"state"};
my $stateofpool = $StateCodes->{$poolState};
[...]
which uses :
my $StateCodes =
{
0 => "UNKNOWN",
1 => "UP",
2 => "UNAVAILABLE",
3 => "DOWN",
};
which I'm sure is wrong and should be using
my $StatusCodes =
{
0 => "ENABLED",
1 => "DISABLED",
2 => "DISABLE_PARENT",
};
or similar
but looking at the new SDK PoolAttribute returned looks different:
====
A struct that gives a limited description of pool attributes.
name String
number_virtual_servers short
type LoadBalanceResultType
status EnableStatus
state StatColor
====
and similarly for get_pool_virtual_server_list
I'm sure it wasn't like this before but this was a while ago and it could just be me going mad. I don't have the SDK I used to check the return values - is there a previous one available? Can you confirm that this has changed?
many thanks
-r
- Ahh, the beauty of perl and it's dynamic runtime really keeps you guessing doesn't it. Here's how that method works (as it has since BIG-IP v4.2 - SDK version 2.1).
enum LoadBalanceResultType { LB_RES_A = 0, LB_RES_CNAME = 1 }; enum EnableStatus { STAT_BLUE = 0, STAT_GREEN = 1, STAT_YELLOW = 2, STAT_RED = 3, STAT_GRAY = 4, STAT_PURPLE = 5, STAT_ORANGE = 6, STAT_WHITE = 7 }; enum EnableStatus { ENABLE = 0, DISABLE = 1, DISABLE_PARENT = 2 }; struct PoolAttribute { String name; short number_virtual_servers; LoadBalanceResultType type; EnableStatus status; StatColor state; }; PoolAttribute[] get_pool_list( in String wideip_name );
- royster_128009
Nimbostratus
thanks for the clarification. I'm upgrading the units to v4.5.11 shortly so am updating the code. - Does the SDK sample work and yours not? If so, please post the code that you are having problems with and I'll take a look. Usually that error message means you are passing a value in that doesn't exist on the system.
- royster_128009
Nimbostratus
No its your code on ~sdk/support/SOAP/perl/GlobalLB/GlobalLBWideip.pl - Sorry this has taken a few days to get to, My 4.x dev machine has not been behaving itself lately.
... print "VS : $source->{'addr'}:$source->{'port'}\n"; print " trans : $translated->{'addr'}:$translated->{'port'}\n"; print " ratio : $ratio\n"; print " status: $status\n"; print " state : $state\n"; $soapResponse2 = $Wideip->get_pool_virtual_server_availability ( SOAP::Data->name(wideip_name => sWideip), SOAP::Data->name(pool_name => $sPool), SOAP::Data->name(vs => $source), SOAP::Data->name(check_vs_dependencies => 1) );
... print "VS : $source->{'addr'}:$source->{'port'}\n"; print " trans : $translated->{'addr'}:$translated->{'port'}\n"; print " ratio : $ratio\n"; print " status: $status\n"; print " state : $state\n"; $soapResponse2 = $Wideip->get_pool_virtual_server_availability ( SOAP::Data->name(wideip_name => $sWideip), SOAP::Data->name(pool_name => $sPool), SOAP::Data->name(vs => $source), SOAP::Data->name(check_vs_dependencies => 1) );
- royster_128009
Nimbostratus
$doh
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