Forum Discussion

Larry_Dalton_53's avatar
Larry_Dalton_53
Icon for Nimbostratus rankNimbostratus
Dec 22, 2008

Fetch ip of pool

How can I fetch the IP of a pool using the Perl SOAP SDK on LTP version 9x?

 

7 Replies

  • This example from the codeshare should get you started. It prints a cli equivalent of the network map in the gui, which includes the pool members within a pool assigned to each virtual.

     

     

    http://devcentral.f5.com/wiki/default.aspx/iControl/PerlLocalTrafficMap.html Click here
  • Also, just so you are clear on symantics. A Pool has no IP Address : Port associated with it. A Virtual Server has an IP Address and a Pool is an attribute of the VS. A pool is a collection of Pool Members which in turn have a IP Address : Port specification.

     

     

    -Joe
  • The Perl LocalTrafficMap.pl yields the pool member's IP, but doesn't list the Virtual Server (VS) IP. What call would I make to pull that property?

     

    LD_
  • The hierarchy is this: The top level object is a Virtual Server which is defined by an IP Address and port (or muliple ports if it's a wildcard virtual). A Virtual Server has a Pool as an attribute of it. A pool consists of Pool Members which are defined by an IP Address and Port.

    So, is your question, given a pool, what is the IP address of the Virtual Servers that reference that pool as a resource? Keep in mind that more than one Virtual Server can reference a pool. If that is your question, then there is no single API to do the reverse lookup for you. You'll have to do something like this pseudocode:

    string [] vs_list = LocalLB.VirtualServer.get_list(); 
     string [] def_pools = LocalLB.VirtualServer.get_default_pool_name(vs_list); 
     IPPortDefinition [] vs_dests = LocalLB.VirtualServer.get_destination(vs_list); 
      
     string pool_to_match = "mypool"; 
     print "Virtual Servers containing pool " + pool_to_match; 
     for(int i=0; i { 
       if ( def_pools[ i ].Equals(pool) ) 
       { 
         print "Virtual Server " + vs_list[ i ] + " " + vs_dests[ i ].address + ":" + vs_dests[ i ].port; 
       } 
     }

    Make sense?

    -Joe
  • Not really. if there is no function to pull the IP of the virtual server, regardless of pool, then one should be added. Lets forget the pool, and its members. How do you get the IP(s) and port(s) assigned to the virtual server. The above code looks like the perl equiv of LocalTrafficMap.pl which I use. LocalLB.VirtualServer.get_vs_ip('vs-name') perhaps.

     

     

    LD_
  • You want the get_destination attribute. Check out Joe's PerlVirtualShow codeshare contribution:

     

     

    http://devcentral.f5.com/wiki/default.aspx/iControl/PerlVirtualShow.html Click here
  • My example did return the IP of the virtual server. Look at the get_destination() method.

     

     

    -Joe