ListLocks
Lists locks currently tracked in a namespace. Paginated. Only locks that have at least one holder are stored; never-acquired (unlocked) names do not appear.
Read-only and safe to retry.
Request
- Leave
pagination_tokenempty for the first page. limitsets the number of entries per page.
{
"namespace_name": "UserObjects",
"pagination_token": "",
"limit": 100
}
Response
- Returns
NotFoundif the namespace does not exist. - Non-empty
next_pagination_tokenindicates more pages are available. - Each holder’s
metadatais the optional, opaque map attached at acquire time — see Metadata.
{
"locks": [
{
"name": "users/123/profile",
"state": "LOCK_STATE_EXCLUSIVE_LOCKED",
"locked_at": 1695826239671432000,
"last_activity_at": 1695826239671432000,
"lock_holders": [
{
"lease_id": "ll_NfKKeiPbP18NFeU3lLGrRWWgDJRB",
"locked_at": 1695826239671432000,
"metadata": {
"host": "node-1"
}
}
]
}
],
"next_pagination_token": "",
"previous_pagination_token": ""
}