Forum Discussion
how to check if given pool exists using IControl
Hello,
I am trying to check if given pool exists or not. As I didn't find proper operation in iControlAPI I decided to ask you what is the prefered way to do this. As a workaround I can use some of the following:
- Get list of all pools and check if it contains the pool
- Try to execute some get operation on the pool and check if it will fail with error like this one:
Exception caught in GlobalLB::urn:iControl:GlobalLB/Pool::create() Exception: Common::OperationFailed primary_error_code : 16908390 (0x01020066) secondary_error_code : 0 error_string : 01020066:3: The requested Pool (/XXX/test.mydomain.com) already exists in partition XXX.
Can I use some of the error codes in the error message to identify that this error is "Not found"?
thanks Stoyan
1 Reply
We never included "exists" methods to the APIs. The procedures you listed are the ways to go and it depends on the size of your configuration and or how much processing you want to do. You can either get a list of pools and look for a match, or perform a get_* on your pool name and look for a SOAP exception. get_description() is probably a good one to use. Unfortunately all of the error codes are not fully documented so you'll have to test it out and use the returned error string as a match. The error returned for object not found will be the same moving forward.
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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