Stack Locking
Atmos Pro supports locking your Atmos stacks to ensure only one process in running on a particular stack at a time.
How it Works
Atmos pro supports locking your Atmos stacks to ensure only one process in running on a particular stack at a time.
Lock a Stack
Atmos CLI
By far, the easiest way to lock a stack is to use the Atmos CLI. The Atmos CLI supports locking a stack by running the following command:
API Call
Locking a stack can also be performed by calling the POST /api/locks
endpoint.
This endpoint takes a key
and ttl
as required parameters and optionally supports properties
and message
as
optional parameters. The key
is used to identify the stack that you want to lock. The ttl
is the time in
milliseconds that the lock should be valid for. The properties
is an array of key/value pairs that will be stored with
the lock. The message
is a string that will be stored with the lock and displayed to anyone trying to lock an already
locked stack. If the lock already exists, the API will return a 409
status code.
Request
POST /api/locks
Response (201)
Response (409)
Unlock a Stack
Atmos CLI
The Atmos CLI is also the easiest way to unlock a stack that has been previously locked. The Atmos CLI supports locking a stack by running the following command:
API Call
Unlocking a stack can also be performed by calling the DELETE /api/locks
endpoint.
This endpoint takes a key
as input and the API will return a 200
status code.
Request
DELETE /api/locks