Forum Discussion
how 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 folder as show the audit log :
folder=/Common module=(tmos) status=[Command OK] cmd_data=delete ltm profile ramcache all
the bigip as several partition "mypartition1, mypartition2 ..." , but i did not find example showing how to tell i want to delete on partition1. Any idea ?
3 Replies
- Satoshi_Toyosa1Ret. Employee
Possibly ~ (tilda)?
The API User Guide says: "When a resource name includes a forward slash (/) in its name, substitute a tilde (~) for the forward slash in the path. For example, a resource name, such as /Common/plist1, should be modified to the format shown here: ;
- TCB_167490Historic F5 Account
The /all syntax in iControl REST applies only to the Common partition. Deleting all profiles from a partition other than the Common partition by using iControl REST is not supported.
- Satoshi_Toyosa1Ret. Employee
all is a
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 reportstmsh ltm profile ramcache
error. This is the reason why an iControl REST request to ~Test~all gets an error.Invalid profile name
The all option is applied to the current partition in
command. To change the partition, you need to runtmsh show ltm profile ramcache
command in tmsh. The following example demonstrates the behaviour.cd
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
command in iControl REST, hence all can only be used for the default partition /Common: e.g.,cd
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
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.delete
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
* 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