Create a resource lock

Beta Create a lock for a resource, to help prevent you from inadvertently deleting it or modifying some aspects of it. You can apply a lock to a single resource, or to a resource and all of its sub-resources. This operation can only be accessed by account users with unrestricted access. Talk to your local account administrator about access management.

Once a resource has a lock, that resource (and its sub-resources, if applicable) can't be deleted, regardless of your user permission. You can unlock a resource by running the Delete a resource lock operation for the specific lock.

👍

There's a tutorial

We offer an example API workflow you can follow to set up a resource lock on a Linode.

Permissions and scopes

To call this operation, you need permissions, based on the model you're using:

  • OAuth scopes. Your user needs these scopes assigned. Learn more.

    • Scopes: account:read_write

CLI

linode-cli resource-locks create \ --entity_id 8642531 \ --entity_type linode \ --lock_type cannot_delete \

Learn more

Path Params
string
enum
required

Enum Call the v4beta URL for operations still only in beta.

Allowed:
Body Params
Responses

Response body
object
string
enum

The type of resource. This can be linode for a resource lock on a Linode, lkecluster for a Linode Kubernetes engine cluster, lkenodepool for a Linode Kubernetes engine node pool, nodebalancer for a NodeBalancer, or volume for a Block Storage volume.

linode lkecluster lkenodepool nodebalancer volume

integer

Filterable The unique identifier assigned to the resource lock.

string
enum

Filterable The type of lock set for the resource:

  • cannot_delete. The resource itself can't be deleted. Any sub-resources attached to it can be freely deleted. You need to unlock the resource by deleting its lock to delete it.

  • cannot_delete_with_subresources. The resource and its various sub-resources can't be deleted. For example, if a Linode instance has a configuration profile interface assigned to it, this lock prevents you from deleting either of them. You need to unlock the resource by deleting its lock. Then you can delete the resource and any of its sub-resources.

📘

The cannot_delete_with_subresources form of lock_type does not apply for an entity_type of lkecluster or lkenodepool.

cannot_delete cannot_delete_with_subresources

Language
Credentials