Forum Discussion

animageofmine_2's avatar
animageofmine_2
Icon for Nimbostratus rankNimbostratus
Feb 26, 2016

Check if a pool exists?

1) I know there is a method to get list of pools. But that seems very suboptimal if the requirement is to just check if the pool exists. I was looking at iControl->LocalLB->Pool APIs and I didn't find anything obvious other than using an API that could possibly throw an exception if the pool does not exist. But to depend on exception does not seem reliable either. Is there any way to simply check if the pool exists?

 

2) Is there a way to create pool and pool members in one API?

 

3) This should be obvious, but still to double check. Are the operations/APIs, especially the write APIs that change the state of F5 atomic?

 

1 Reply

  • @animageofmine, currently there are no "exists" functions in the API. As you said, you must either query the list of objects and look for it in that response, or perform a get action against it and check for an exception. Either is a viable solution.

     

    As for creating a pool with it's members in one call, the LocalLB::Pool::create_v2() method takes in an initial set of ip:port members for the pool creation.

     

    For question 3, can you elaborate? All writes will change the running configuration. One thing to keep in mind is that they do not flush the changes to persistent storage on disk. That has to be done manually with the System::ConfigSync::save_configuration() method. We chose to remove this from each API call as the write overhead is fairly large and for scenarios with bulk operations, adding that overhead to every call made orchestration type workflows painfully long.

     

    Hope this helps...

     

    -Joe