HTTP API

Lease

POST/api/v1/leases/resources
POST
/api/v1/leases/resources

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/leases/resources" \  -H "Content-Type: application/json" \  -d '{    "display_name": "string",    "kind": "string"  }'
{  "created_at": "2019-08-24T14:15:22Z",  "display_name": "string",  "kind": "string",  "resource_id": "string"}
GET/api/v1/leases/resources/{resource_id}
GET
/api/v1/leases/resources/{resource_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

resource_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/leases/resources/string"
{  "active_leases": [    {      "expires_at": "2019-08-24T14:15:22Z",      "fencing_token": 0,      "holder": {        "id": "string",        "kind": "user"      },      "lease_id": "string",      "mode": "exclusive",      "status": "pending",      "units": 0    }  ],  "bookings": [    {      "booking_id": "string",      "ends_at": "2019-08-24T14:15:22Z",      "holder_id": "string",      "mode": "exclusive",      "starts_at": "2019-08-24T14:15:22Z",      "status": "scheduled"    }  ],  "resource": {    "created_at": "2019-08-24T14:15:22Z",    "display_name": "string",    "kind": "string",    "lease_policy": {      "default_duration_seconds": 0,      "fractional": {        "enabled": true,        "total_units": 0      },      "lifetime_cap_seconds": 0,      "max_duration_seconds": 0,      "renewal_grace_seconds": 0,      "shared_modes": [        "exclusive"      ],      "transferable": true    },    "metadata": null,    "resource_id": "string",    "status": "available"  },  "wait_count": 0}
POST/api/v1/leases/{resource_id}/acquire
POST
/api/v1/leases/{resource_id}/acquire

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

resource_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/leases/string/acquire" \  -H "Content-Type: application/json" \  -d '{}'
{  "expires_at": "2019-08-24T14:15:22Z",  "fencing_token": 0,  "lease_id": "string",  "mode": "exclusive",  "resource_id": "string",  "status": "pending",  "waiting_position": 0}
GET/api/v1/leases/{resource_id}/bookings
GET
/api/v1/leases/{resource_id}/bookings

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

resource_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/leases/string/bookings"
{  "bookings": [    {      "booking_id": "string",      "ends_at": "2019-08-24T14:15:22Z",      "holder_id": "string",      "mode": "exclusive",      "starts_at": "2019-08-24T14:15:22Z",      "status": "scheduled"    }  ],  "count": 0,  "resource_id": "string"}
POST/api/v1/leases/{resource_id}/bookings
POST
/api/v1/leases/{resource_id}/bookings

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

resource_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/leases/string/bookings" \  -H "Content-Type: application/json" \  -d '{    "ends_at": "2019-08-24T14:15:22Z",    "starts_at": "2019-08-24T14:15:22Z"  }'
{  "booking_id": "string",  "ends_at": "2019-08-24T14:15:22Z",  "resource_id": "string",  "starts_at": "2019-08-24T14:15:22Z",  "status": "scheduled"}
DELETE/api/v1/leases/{resource_id}/bookings/{booking_id}
DELETE
/api/v1/leases/{resource_id}/bookings/{booking_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

resource_id*string
booking_id*string

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/leases/string/bookings/string"
{  "booking_id": "string",  "resource_id": "string",  "status": "scheduled"}
GET/api/v1/leases/{resource_id}/history
GET
/api/v1/leases/{resource_id}/history

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

resource_id*string

Query Parameters

page?integer

1-indexed page number

Formatint64
Range0 <= value
page_size?integer

Page size

Formatint64
Range0 <= value
sort_order?string

Sort order (asc or desc)

Value in

  • "asc"
  • "desc"

Response Body

application/json

curl -X GET "https://example.com/api/v1/leases/string/history"
{  "history": [    {      "actor_id": "string",      "event": "acquired",      "fencing_token": 0,      "from_status": null,      "history_id": "string",      "lease_id": "string",      "metadata": null,      "occurred_at": "2019-08-24T14:15:22Z",      "resource_id": "string",      "to_status": "pending"    }  ],  "pagination": {    "has_more": true,    "page": 0,    "page_size": 0,    "total": 0  }}
POST/api/v1/leases/{resource_id}/release
POST
/api/v1/leases/{resource_id}/release

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

resource_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/leases/string/release" \  -H "Content-Type: application/json" \  -d '{    "fencing_token": 0,    "lease_id": "string"  }'
{  "admitted_waiter": "string",  "lease_id": "string",  "message": "string",  "resource_id": "string"}
POST/api/v1/leases/{resource_id}/renew
POST
/api/v1/leases/{resource_id}/renew

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

resource_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/leases/string/renew" \  -H "Content-Type: application/json" \  -d '{    "duration_seconds": 0,    "fencing_token": 0,    "lease_id": "string"  }'
{  "expires_at": "2019-08-24T14:15:22Z",  "lease_id": "string",  "resource_id": "string",  "status": "pending"}
GET/api/v1/leases/{resource_id}/status
GET
/api/v1/leases/{resource_id}/status

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

resource_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/leases/string/status"
{  "active_leases": [    {      "expires_at": "2019-08-24T14:15:22Z",      "fencing_token": 0,      "holder": {        "id": "string",        "kind": "user"      },      "lease_id": "string",      "mode": "exclusive",      "status": "pending",      "units": 0    }  ],  "bookings": [    {      "booking_id": "string",      "ends_at": "2019-08-24T14:15:22Z",      "holder_id": "string",      "mode": "exclusive",      "starts_at": "2019-08-24T14:15:22Z",      "status": "scheduled"    }  ],  "caller_lease_id": "string",  "capacity": 0,  "resource_id": "string",  "resource_status": "available",  "wait_count": 0}
POST/api/v1/leases/{resource_id}/transfer
POST
/api/v1/leases/{resource_id}/transfer

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

resource_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/leases/string/transfer" \  -H "Content-Type: application/json" \  -d '{    "fencing_token": 0,    "lease_id": "string",    "to_holder_id": "string"  }'
{  "expires_at": "2019-08-24T14:15:22Z",  "fencing_token": 0,  "holder": {    "id": "string",    "kind": "user"  },  "lease_id": "string",  "resource_id": "string"}
POST/api/v1/leases/{resource_id}/validate
POST
/api/v1/leases/{resource_id}/validate

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

resource_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/leases/string/validate" \  -H "Content-Type: application/json" \  -d '{    "fencing_token": 0,    "lease_id": "string"  }'
{  "fencing_token": 0,  "lease_id": "string",  "reason": "string",  "resource_id": "string",  "valid": true}
GET/api/v1/leases/{resource_id}/waiting-room
GET
/api/v1/leases/{resource_id}/waiting-room

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

resource_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/leases/string/waiting-room"
{  "count": 0,  "resource_id": "string",  "waiters": [    {      "holder_id": "string",      "joined_at": "2019-08-24T14:15:22Z",      "last_seen": "2019-08-24T14:15:22Z",      "mode": "exclusive",      "priority": 0.1    }  ]}

On this page