diff --git a/pages/platform/delete-locks.mdx b/pages/platform/delete-locks.mdx new file mode 100644 index 0000000..fff4dd5 --- /dev/null +++ b/pages/platform/delete-locks.mdx @@ -0,0 +1,56 @@ +--- +title: Delete Locks +navigation_icon: lock +--- + +Delete locks prevent accidental deletion of instances and volumes. +When you set a delete lock on a resource, any attempt to delete it returns an error until you remove it. + +Delete locks apply to: +- Instances +- Instance templates +- Volumes +- Volume templates + +## Enabling a delete lock + +Set a delete lock on an instance via the `PATCH` endpoint: + +```bash title="" +kraft cloud instance update --delete-lock +``` + +Set a delete lock on a volume: + +```bash title="" +kraft cloud volume update --delete-lock +``` + +## Removing a delete lock + +Remove the delete lock before deleting: + +```bash title="" +kraft cloud instance update --no-delete-lock +kraft cloud volume update --no-delete-lock +``` + +## Checking the delete lock status + +The instance and volume status responses include a `delete_lock` field: + +```bash title="" +kraft cloud instance get +kraft cloud volume get +``` + +## Behaviour + +- **Deletion blocked**: Any `DELETE` request on a locked resource returns an error. +- **Autokill skipped**: The autokill subsystem skips instances and service groups that have a delete lock set. + The autokill timer doesn't fire while the lock is active. +- **Templates**: Delete locks are independently configurable on instance templates and volume templates via their respective `PATCH` endpoints. + +## Learn more + +* Unikraft Cloud's [REST API reference](/api/platform/v1), in particular the sections on [instances](/api/platform/v1/instances) and [volumes](/api/platform/v1/volumes)