Forum Discussion
jean-marc_14076
Nimbostratus
Jan 15, 2018how to delete ramcache of a specific partition with icontrol rest api ?
i need to delete ramache of a specific partition / profile on a 11.6.0 HF 7 big-ip by icontrol rest.
In the curl call i have try : curl ... -X DELETE
it works fine on the Common folde...
Satoshi_Toyosa1
Jan 31, 2018Ret. Employee
all is a
tmsh ltm profile ramcache
option, not a catch-all meta symbol like *. If you specify a ramcache profile /Test/all, for example, BIG-IP (tmsh) looks for the profile named all under the partition /Test. If it does not find it, it reports Invalid profile name
error. This is the reason why an iControl REST request to ~Test~all gets an error.
The all option is applied to the current partition in
tmsh show ltm profile ramcache
command. To change the partition, you need to run cd
command in tmsh. The following example demonstrates the behaviour.
for part in " " "cd /Test;" "cd /Common;"; do echo --$part && echo "$part; \
show ltm profile ramcache all" | tmsh | egrep 'URI|Ltm::Ramcache' | grep -v apm-enduser; done
-- <<< default parition = /Common
Ltm::Ramcaches /Common/webacceleration
URI : /index.html
URI : /cookie.html
URI : /
--cd /Test;
Ltm::Ramcaches /Test/myweb
URI : /index.html
URI : /cookie.html
URI : /
Ltm::Ramcaches /Test/myweb2
URI : /index.html
URI : /cookie.html
URI : /
--cd /Common;
Ltm::Ramcaches /Common/webacceleration
URI : /index.html
URI : /cookie.html
URI : /
Unfortunately, we cannot use the tmsh
cd
command in iControl REST, hence all can only be used for the default partition /Common: e.g.,
curl -sku admin:passwd https://localhost/mgmt/tm/ltm/profile/ramcache/all/stats \
| python -m json.tool | sed 's/\\n/\n/g;' | egrep 'URI|Ltm::Ramcache' | grep -v apm-enduser
"apiAnonymous": "Ltm::Ramcaches /Common/webacceleration
URI : /index.html
URI : /cookie.html
URI : /
Interestingly, the all option behaves differently when used in
delete
command. As you stated, it deletes all the entries in all the profiles under all the partitions. Not just the current partition. Again, you can't specify partition plus all (/Test/all or ~Test~all😞 It's an option, not a wild-card.
A workaround is to loop around a list of ramcache profiles: e.g.,
for i in myweb myweb2; do curl -sku admin:passwd \
https://localhost/mgmt/tm/ltm/profile/ramcache/~Test~$i -X DELETE
I hope this clarifies some myths. Let me know if you have additional questions.
Cheers, Satoshi
P.S. Interestingly, although the all option appears in tab completion, it is not explained in the
tmsh help ltm profile ramcache
.Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects