Locks

Acquire a project lock

Changed on

Acquires a project-scoped lease using the project embedded in the service-role key. The caller must hold the locks.manage permission. Repeating the request with the same lock token is idempotent and resets that lease to the requested TTL. A different live owner receives 409 lock_held; a caller whose own lease already lapsed receives 409 lock_ownership_lost.

post/locks/{key}/lease

Request

  • Base URL: https://api.volcano.dev
  • URL: https://api.volcano.dev/locks/{key}/lease
  • Auth: HTTP bearer

Path parameters

keystring required

Project-local lock name.

Headers

X-Volcano-Lock-Tokenstring uuid required

Opaque UUID generated once by the caller and retained for the lease lifetime.

X-Volcano-Request-Idstring uuid required

UUID correlating this request across client and server logs. Repeat safety comes from the lock token, so a retry under a reused request ID still counts against the quota.

Request body

ttl_secondsinteger required

Lease duration in seconds, from 5 seconds through 90 days, measured from when the request is served. Renew before it elapses. A renewal sets the new expiry outright, so a shorter TTL shortens the lease. Renewals cannot extend an acquisition beyond its absolute 90-day deadline.

Response

Lease acquired

expires_atstring date-time required

Advisory lease expiry timestamp in UTC.

fencing_tokeninteger required

Monotonically increasing token for this acquisition. It rises whenever the lock changes hands and stays the same across renewals of one lease. Pass it to the resource you are protecting and reject any write carrying a token lower than the highest already seen; that is what stops a displaced holder from writing after its lease lapsed.

Changes

    • ▲

      the response's body type changed from no type to object for status

    • ▲

      the response's body type changed from no type to object for status

    • ▲

      the response's body type changed from no type to object for status

    • ▲

      the response's body type changed from no type to object for status

    • ▲

      the response's body type changed from no type to object for status

    • ▲

      the response's body type changed from no type to object for status

    • ○

      added the optional property to the response with the status

    • ○

      added the optional property to the response with the status

    • ○

      added the optional property to the response with the status

    • ○

      added the optional property to the response with the status

    • ○

      added the optional property to the response with the status

    • ○

      added the optional property to the response with the status

    • ○

      added the required property to the response with the status

    • ○

      added the required property to the response with the status

    • ○

      added the required property to the response with the status

    • ○

      added the required property to the response with the status

    • ○

      added the required property to the response with the status

    • ○

      added the required property to the response with the status

    • ○

      endpoint added