Forum Discussion
Rest API call to delete all objects in a partition
Is there a API call that will allow me to delete a partition and all objects in it?
If not,
How can I list all objects in a partition and go about deleting them, then finally deleting the partition.
4 Replies
Never seen an API call that could delete all objects.
But if you just want to do this once you can just replace the "/config/partitions/[partition name]/bigip.conf" with an empty file and run "tmsh load sys config". Then remove the partition in the UI.
/Patrik
- Mudpuppy_182361
Nimbostratus
Hmm. Good idea. Not sure how I would automate it. Also It may leave dangling ssl certs / etc on the file system.
Thank you for the information.
- jstaff_333301
Nimbostratus
There should be a direct way to do this. Many of the function calls require you to filter out the objects of a partition you want to delete then do a bunch of non-sense to delete all of them.
There should be a call that deletes all objects owned by a partition. Then deletes the partition itself.
On my phone now so can't verify this. Be careful and make sure you have good parameter validation when using it.
$ curl -sk -u 'admin:admin' -H 'Content-Type: application/json' -X POST \ -d '{"command": "run", "utilCmdArgs": "-c \"rm /config/partitions/mypartition/bigip.conf\""}' \ https://$HOST/mgmt/tm/util/bash | jq/Patrik
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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