Forum Discussion

Richard__Harlan's avatar
Richard__Harlan
Historic F5 Account
Nov 08, 2004

Haveing a problem with Get_rule

I am writeing a script to get the rules that a virtual server is connected to. I am us get_list to get the list of the Virtual servers and there ports, but when I pass that information to get rules I get a 500 server error. Below is a code snip. Thanks

 

 

  
  sub virtual()  
  {  
     
  $soap_response = $virtuallist->get_list();  
     
  if ( $soap_response->fault )  
  {  
  print $soap_response->faultcode, "(faultstring) ", $soap_response->faultstring,"\n";  
  print $soap_response->faultcode, "(faultdetail) ", $soap_response->faultdetail, "\n";  
  }  
  else  
  {  
  print "Available Virtuals Servers: \n";  
  my $virtualnumber = 0;  
  my @virtual_def_list = @{$soap_response->result};  
  foreach my $virtual_def (@virtual_def_list)  
  {  
  if ( $virtualonly != "1" ) {  
  $addressport = $virtual_def->{"address"}.":".$virtual_def->{port};  
  }  
  print "\t[$virtualnumber] = '", $addressport,"'\n";  
  $virtual_ipaddress = inet_aton($virtual_def->{address});  
  $dnshostname = gethostbyaddr($virtual_ipaddress, AF_INET);  
  print "         Hostname = $dnshostname\n";  
     
  ($vaddress,$vport) = split(/\:/,$addressport);  
  $vserv->{address} = $vaddress;  
  $vserv->{port} = $vport;  
  $vnode_def->{ipport} = $vserv;  
     
  $soaprule = $virtuallist->get_rule  
          (  
                  SOAP::Data->name(virtual_server => $vnode_def)  
          );  
     
  $outputrule = ${$soaprule->result};  
    
     
  $virtualnumber++;  
  }  
  }  
  }  
 

 

  • Loc_Pham_101863's avatar
    Loc_Pham_101863
    Historic F5 Account
    The signature of ITCMLocalLB.VirtualServer.get_rule () method is:

     

      
       String get_rule(   
           in SessionCredentials creds,  <== CORBA Specific   
           in IPPortDefinition virtual_server   
       );  
      

     

     

    I notice that in your code, the call to get_rule should be using something like:

     

     

      
       $soaprule = $virtuallist->get_rule    
       (    
          SOAP::Data->name (virtual_server => $virtual_def)   
       );   
      

     

     

    since $vnode_def is not the correct type for the "virtual_server" parameter of get_rule.

     

     

    Loc