HTTP API

Distributed Locking

GET/api/v1/distributed-state/{namespace}/{key}/lock
GET
/api/v1/distributed-state/{namespace}/{key}/lock

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

namespace*string

Namespace for the lock

key*string

Lock key identifier

Response Body

application/json

curl -X GET "https://example.com/api/v1/distributed-state/string/string/lock"
{  "acquired_at": "2019-08-24T14:15:22Z",  "expires_at": "2019-08-24T14:15:22Z",  "fence_token": 0,  "is_locked": true,  "key": "string",  "lock_id": "string",  "metadata": null,  "namespace": "string",  "owner_id": "string",  "time_remaining_ms": 0}
POST/api/v1/distributed-state/{namespace}/{key}/lock
POST
/api/v1/distributed-state/{namespace}/{key}/lock

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

namespace*string

Namespace for the lock

key*string

Lock key identifier

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request to acquire a distributed lock

Response Body

application/json

curl -X POST "https://example.com/api/v1/distributed-state/string/string/lock" \  -H "Content-Type: application/json" \  -d '{    "owner_id": "string"  }'
{  "acquired_at": "2019-08-24T14:15:22Z",  "expires_at": "2019-08-24T14:15:22Z",  "fence_token": 0,  "key": "string",  "lock_id": "string",  "metadata": null,  "namespace": "string",  "owner_id": "string",  "ttl_seconds": 0}
PATCH/api/v1/distributed-state/{namespace}/{key}/lock
PATCH
/api/v1/distributed-state/{namespace}/{key}/lock

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

namespace*string

Namespace for the lock

key*string

Lock key identifier

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request to extend (renew) a distributed lock held by the caller

Response Body

application/json

curl -X PATCH "https://example.com/api/v1/distributed-state/string/string/lock" \  -H "Content-Type: application/json" \  -d '{    "lock_id": "string",    "owner_id": "string"  }'
{  "expires_at": "2019-08-24T14:15:22Z",  "fence_token": 0,  "key": "string",  "lock_id": "string",  "namespace": "string",  "owner_id": "string",  "ttl_seconds": 0}
DELETE/api/v1/distributed-state/{namespace}/{key}/lock
DELETE
/api/v1/distributed-state/{namespace}/{key}/lock

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

namespace*string

Namespace for the lock

key*string

Lock key identifier

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request to release a distributed lock

Response Body

curl -X DELETE "https://example.com/api/v1/distributed-state/string/string/lock" \  -H "Content-Type: application/json" \  -d '{    "lock_id": "string",    "owner_id": "string"  }'
Empty

On this page