Forum Discussion

Kevin_382901's avatar
Kevin_382901
Icon for Nimbostratus rankNimbostratus
Apr 16, 2019

Using iControlREST to list entries in ramcache

I'm trying to build a bash script to query the F5 so that we can see what entries are on the ramcache profile. I am able to delete entries with:

 

curl -sk -u $USERNAME:$PASSWORD -X DELETE

 

but I can't find out how to do something like that but for getting info:

 

curl -sk -u $USERNAME:$PASSWORD -X GET

 

I see cryptic mentions online and in the docs that this is possible, but I can't figure it out. Am I going about this the wrong way?

 

2 Replies

  • In tmsh, you need to use

    show
    command to view the LTM ramcache profile data: e.g.,

    tmsh show ltm profile ramcache webacceleration
    

    Fot the iControl REST equivalent, then, add

    stats
    to the endpoint (an endpoint without
    stats
    is for tmsh's
    list
    command). So,

    curl -sku : https:///mgmt/tm/ltm/profile/ramcache/webacceleration/stats
    

    should show the current cache.

    Similarly, to remove the cache completely (

    tmsh delete ltm profile ramcache webacceleration
    equivalent):

    curl -sku : https:///mgmt/tm/ltm/profile/ramcache/webacceleration -X DELETE
    

    See also K13255: Displaying and deleting HTTP cache entries from the command line (11.x - 13.x).

  • Here's a tmsh command example for removing the specific cache entry from the webacceleration ramcache by URI. In this case,

    /foo.html
    .

    tmsh delete ltm profile ramcache webacceleration uri /foo.html
    

    The iControl REST equivalent is

    curl -sku : -X DELETE \
      https:///mgmt/tm/ltm/profile/ramcache/webacceleration?options=uri,/foo.html
    

    There are many ways to manipulate the cache entries. Please refer to the tmsh help (from the tmsh prompt,

    help ltm profile ramcache
    ).

    By the way, please consider posting the equivalent tmsh command you wish to perform if possible. That way, people can know exactly what you would like to do.