Forum Discussion

Internet_Suppo1's avatar
Internet_Suppo1
Icon for Nimbostratus rankNimbostratus
Mar 03, 2014

iControl Rest Query for partition other than common

Hi Folks

 

Hoping you can give me a steer, I'm using the iControl Rest to do some basic listing of details......it works fine the common partition but i'm trying to query another partition and can't quite work out the syntax.

 

e.g. These work great and list the details in the common partition curl -sk -u '':'' https:///mgmt/tm/ltm/pool | sed 's/,/\'$'\n/g' curl -sk -u '':'' https:///mgmt/tm/ltm/virtual-address | sed 's/,/\'$'\n/g'

 

The following works to list the "Systems_Dev" partition high level details. Trying to work out how to dive into this partition in detail curl -sk -u '':'' https://******/mgmt/tm/sys/folder/~Systems_Dev | sed 's/,/\'$'\n/g'

 

So basically, I need to list the pool and virtual-address details for the "Systems_Dev" partition.

 

Tried this in attempt to filter by partition but still on common data returned: curl -sk -u '':'' https://******/mgmt/tm/ltm/virtual-address?$ftion%20eq%20Systems_Dev | sed 's/,/\'$'\n/g'

 

Any help would be great.. Cheers Steve

 

7 Replies

  • Try this:

    curl -sk -u admin:admin -X GET https://x.x.x.x/mgmt/tm/pool?$filter=partition%20eq%20Systems_Dev
    
  • No joy i'm afraid Kevin.

     

    The partition definately exists and the user account that is being used has full admin access.

     

    curl -sk -u xxx:xxx -X GET https://x.x.x.x/mgmt/tm/pool?$filter=partition%20eq%20Systems_Dev

     

    {"code":404 "message":"http://localhost:8100/mgmt/tm/pool?=partition%20eq%20Systems_Dev" "restOperationId":3806288 "errorStack":["com.f5.rest.common.RestWorkerUriNotFoundException: http://localhost:8100/mgmt/tm/pool?=partition%20eq%20Systems_Dev" "at com.f5.rest.common.RestServer.trySendInProcess(RestServer.java:126)" "at com.f5.rest.common.RestRequestReceiver.dispatchToService(RestRequestReceiver.java:93)" "at com.f5.rest.common.RestRequestReceiver.processNext(RestRequestReceiver.java:57)" "at com.f5.rest.common.RestHelper$2.run(RestHelper.java:1480)" "at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)" "at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)" "at java.lang.Thread.run(Unknown Source)

     

  • Typo:

    curl -sk -u admin:admin -X GET https://x.x.x.x/mgmt/tm/ltm/pool?$filter=partition%20eq%20Systems_Dev
    
  • So that query executes but the results set is not what I would expect.

     

    It returns pools from the "common" partition and none of the pools from the "Systems_Dev" partition. Same as my orginial issue.

     

    I've greped and counted the result set to be really sure. There is 85 pools in total, 82 in "common" and 3 in "Systems_Dev". The above query returns 82 pools, so all of those in "common".

     

  • You're absolutely right. Funny thing is, if I cURL from a Windows box (using the exact same URL), I get the correct information. Still testing...

     

  • I had to re-read the iControl REST user guide, but I think I found the missing detail:

    curl -sk -u admin:admin -X GET https://x.x.x.x/mgmt/tm/ltm/pool?\$filter=partition%20eq%20Systems_Dev
    

    It's subtle, but you have to escape the $ sign on a Linux system.

    \$filter vs. $filter