Forum Discussion

DevBabu_124276's avatar
DevBabu_124276
Icon for Nimbostratus rankNimbostratus
Mar 18, 2016

iControl REST question

Is there any way I can get all the pools starting with some specific names with a REST call.

 

For example:

 

I have pools with name:

 

CDEQ_http_pool CDEQ_https_pool CDEQ_8080_pool

 

I need to get the state of all the pools starting with CDEQ_.

 

I tired with:

 

$select=name eq CDEQ_http_pool

 

even I don't get any data back for this pool.

 

Do I need to loop through all the pools and filter it in my script or can I get it through a REST call.

 

7 Replies

  • You'll probably want to query

    https://bigip/mgmt/tm/ltm/pool/?$select=name,fullPath
    , filter your results, and the query the state of each pool that matched using
    https://bigip/mgmt/tm/ltm/pool/(fullpath)/stats?$select=status.availabilityState
    . You will have to replace / in the fullPath with ~ in your pool member query.

    • DevBabu's avatar
      DevBabu
      Icon for Cirrus rankCirrus
      Thanks Brad. Sorry, I think I did not made my question clear. I have three pools that start with CDEQ_. As we do CDEQ* to filter only the pools that start with CDEQ in GUI. Is there a way to achieve the same doing a GET call like https://bigip/mgmt/tm/ltm/pool/~Common~CDEQ*. Or do I need to do the usual way. Get all the pools returned with https://bigip/mgmt/tm/ltm/pool/ and match the pool name that starts with CDEQ through my script.
    • Brad_Parker's avatar
      Brad_Parker
      Icon for Cirrus rankCirrus
      You can not query with pattern matching or wildcards at this time. You will have to gather, filter, and query status of each like I suggested above.
  • You'll probably want to query

    https://bigip/mgmt/tm/ltm/pool/?$select=name,fullPath
    , filter your results, and the query the state of each pool that matched using
    https://bigip/mgmt/tm/ltm/pool/(fullpath)/stats?$select=status.availabilityState
    . You will have to replace / in the fullPath with ~ in your pool member query.

    • DevBabu's avatar
      DevBabu
      Icon for Cirrus rankCirrus
      Thanks Brad. Sorry, I think I did not made my question clear. I have three pools that start with CDEQ_. As we do CDEQ* to filter only the pools that start with CDEQ in GUI. Is there a way to achieve the same doing a GET call like https://bigip/mgmt/tm/ltm/pool/~Common~CDEQ*. Or do I need to do the usual way. Get all the pools returned with https://bigip/mgmt/tm/ltm/pool/ and match the pool name that starts with CDEQ through my script.
    • Brad_Parker_139's avatar
      Brad_Parker_139
      Icon for Nacreous rankNacreous
      You can not query with pattern matching or wildcards at this time. You will have to gather, filter, and query status of each like I suggested above.
  • According to the iControl REST API User Guide it is possible to filter ltm objects only by partition names. Probably that won't help you, but still you can do this by adding the following string at the end of the URL: ?$filter=partition eq partitionName