Optimistic locking

Is there any way to have some form of Optimistic locking (or even pessimistic locking) when interacting with the Vault REST API? We’re reading some data from vault and then perform an update using in part the data read from vault, how can we ensure that the data hasn’t been modified concurrently between those two operations?

The locking behavior in Vault varies by endpoint and plugin. In many cases, locks are already included. They may vary by endpoint depending on its specific needs. Are there particular API endpoints or plugins that you’re using?

The current scenario is for POST, PUT or DELETE to this endpoint:

/v1/sys/policy