Stoyan_263592
May 12, 2016Nimbostratus
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