Forum Discussion

Richard__Harlan's avatar
Richard__Harlan
Historic F5 Account
Dec 01, 2004

get_proxy_target

Haveing a little problem with get_proxy_target. Below is the code snip. Once this is done my whole iContorl script will be done. So any help would be great.

 

 

foreach $proxy_def (@proxy_def_list)

 

{

 

 

$proxy_address = $proxy_def->{"address"}.":".$proxy_def->{port};

 

($paddress,$pport) = split (/\:/,$proxy_address);

 

$pserv->{address} = $paddress;

 

$pserv->{port} = $pport;

 

 

$soapproxy = $proxy->get_proxy_target

 

(

 

SOAP::Data->name(proxies => $pserv)

 

);

 

$outputproxy = $soapproxy->result;

 

$target = $outputproxy->{"address"}.":".$outputproxy->{"port"};

 

print " [$proxy_count] = $proxy_address\n";

 

print " The proxy points to $target\n";

 

  • The signature for get_proxy_target() is:

     

     

    IPPortDefinition[] get_proxy_target( 
         in IPPortDefinition[] proxies 
     );

     

     

    The inbound parameter is an array of IPPortDefinition structures, in your code you are passing a singular value. Change your code to the following and you should be set:

     

     

    $soapproxy = $proxy->get_proxy_target  
     (  
       SOAP::Data->name(proxies => [$pserv])  
     );

     

     

    One question I have is why are you converting the $proxy_def into a string, splitting the string, and then rebuilding the structure in $pserv? Can't you just pass in $proxy_def into the call like this:

     

     

    $soapproxy = $proxy->get_proxy_target  
     (  
       SOAP::Data->name(proxies => [$proxy_def])  
     );

     

     

    -Joe
  • Richard__Harlan's avatar
    Richard__Harlan
    Historic F5 Account
    It worked. Thanks

     

     

    To answer your question I do not know, got in the grove of doing it one way total missed the fact that I was doing the samething twice. Again thanks, it nice when you can move things off your plate.
  • Richard__Harlan's avatar
    Richard__Harlan
    Historic F5 Account
    Things are going great thanks to you guys. The script I just finished now will allow us poll our 12 BigIP and dun all there data into our inventory database. Then we will be able to all information about our hosting environment. The BigIP has been the missing piece for a while. But now that we have that going we will be in very good shape. Thanks again