Skip to content
cloudhostDocs
API reference

Caches

Serverless caches for any cache client and over HTTP.

GET/v1/cache/databases

List caches#

Credential
An API key or a dashboard session
Roles
Any role

Response

200object

  • databasesCache[]required
    • namestringrequired
    • hoststringrequired
    • portintegerrequired
    • rest_urlstringrequired
    • max_memory_mbinteger

      one of 32, 64, 128, 256

    • evictionboolean
    • created_atstring (date-time)
    • statusstring

      one of available, unavailable

    • projectsConnected[]

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/cache/databases" \
  -H "Authorization: Bearer $KEY"
POST/v1/cache/databases

Create a cache#

With a read-write token default, returned once.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Request bodyapplication/json

  • namestringrequired

    one DNS label: lowercase letters, digits and hyphens, 1-63 characters, no --

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • max_memory_mbinteger

    one of 32, 64, 128, 256 · default 64

  • evictionboolean

    default true

Response

201CacheCreated

  • namestringrequired
  • hoststringrequired
  • portintegerrequired
  • rest_urlstringrequired
  • max_memory_mbinteger

    one of 32, 64, 128, 256

  • evictionboolean
  • created_atstring (date-time)
  • statusstring

    one of available, unavailable

  • projectsConnected[]
  • tokenstringrequired

    chc_ token, shown once

  • notestring

Errors

StatusDescription
400Bad request: bad_name, bad_memory, bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
409Conflict: name_taken
500internal: an unexpected failure
503Unavailable: no_nodes

Example

curl -X POST "https://api.ibel.ai/v1/cache/databases" \
  -H "Authorization: Bearer $KEY" \
  -d '{"name":"sessions"}'
GET/v1/cache/databases/{name}

Get a cache#

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the cache's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200Cache

  • namestringrequired
  • hoststringrequired
  • portintegerrequired
  • rest_urlstringrequired
  • max_memory_mbinteger

    one of 32, 64, 128, 256

  • evictionboolean
  • created_atstring (date-time)
  • statusstring

    one of available, unavailable

  • projectsConnected[]

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/cache/databases/sessions" \
  -H "Authorization: Bearer $KEY"
DELETE/v1/cache/databases/{name}

Delete a cache#

With its data. Refused while a live version binds it (checked after the role and the name).

Credential
An API key or a dashboard session
Roles
owner, admin, developer
Step-up
With a dashboard session, a second factor confirmed in the last 10 minutes; API keys pass.

Parameters

  • namestringpathrequired

    the cache's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200Deleted

  • namestring
  • deletedbooleanrequired

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required
404Not found: not_found
409Conflict: bound
500internal: an unexpected failure

Example

curl -X DELETE "https://api.ibel.ai/v1/cache/databases/sessions" \
  -H "Authorization: Bearer $KEY"
PATCH/v1/cache/databases/{name}

Change the settings of a cache#

Only the fields sent change; the cache restarts on them and keeps its data.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the cache's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Request bodyapplication/json

  • max_storage_mbinteger
  • checkpoint_daysinteger
  • max_memory_mbinteger
  • evictionboolean

Response

200object

Errors

StatusDescription
400Bad request: bad_storage, bad_checkpoint_days, bad_memory, nothing_to_change
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found

Example

curl -X PATCH "https://api.ibel.ai/v1/cache/databases/sessions" \
  -H "Authorization: Bearer $KEY" \
  -d '{"max_storage_mb":1,"checkpoint_days":1,"max_memory_mb":1,"eviction":true}'
GET/v1/cache/databases/{name}/tokens

List tokens#

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the cache's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200object

  • tokensCacheToken[]required
    • idstringrequired
    • rolestringrequired

      one of rw, ro

    • namestring
    • created_atstring (date-time)
    • revoked_atstring (date-time) | null

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/cache/databases/sessions/tokens" \
  -H "Authorization: Bearer $KEY"
POST/v1/cache/databases/{name}/tokens

Make a token#

Credential
An API key or a dashboard session
Roles
owner, admin, developer
Step-up
With a dashboard session, a second factor confirmed in the last 10 minutes; API keys pass.

Parameters

  • namestringpathrequired

    the cache's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Request bodyapplication/json

  • rolestring

    one of rw, ro · default "rw"

  • namestring

    up to 100 characters

Response

201object

  • idstringrequired
  • rolestringrequired
  • tokenstringrequired

    shown once

Errors

StatusDescription
400Bad request: bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required
404Not found: not_found
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/cache/databases/sessions/tokens" \
  -H "Authorization: Bearer $KEY" \
  -d '{"role":"rw","name":"sessions"}'
DELETE/v1/cache/databases/{name}/tokens/{id}

Revoke a token#

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the cache's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • idstringpathrequired

    token id

Response

200object

  • idstring
  • revokedboolean

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

Example

curl -X DELETE "https://api.ibel.ai/v1/cache/databases/sessions/tokens/7e5926b6f29c" \
  -H "Authorization: Bearer $KEY"
POST/v1/cache/databases/{name}/command

Run a cache command or pipeline#

A single command the cache refuses is 400 command_error with its reply as the message.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the cache's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Request bodyapplication/json

CacheCommand

Response

200CacheReply

Errors

StatusDescription
400Bad request: bad_command, command_error, bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure
503Unavailable: unavailable

Example

curl -X POST "https://api.ibel.ai/v1/cache/databases/sessions/command" \
  -H "Authorization: Bearer $KEY" \
  -d '["…"]'
GET/v1/cache/limits

What the plan allows for caches#

Memory and stored sizes, checkpoint days and the command rate of the plan of the team. Any role.

Credential
An API key or a dashboard session
Roles
Any role

Response

200object

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential

Example

curl "https://api.ibel.ai/v1/cache/limits" \
  -H "Authorization: Bearer $KEY"
GET/v1/cache/databases/{name}/stats

Keys, memory, hit rate and stored size of a cache#

Live from the cache; while it is idle, the stored size of the last hour with live false. Any role.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the cache's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200object

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found

Example

curl "https://api.ibel.ai/v1/cache/databases/sessions/stats" \
  -H "Authorization: Bearer $KEY"
GET/v1/cache/databases/{name}/checkpoints

The checkpoints of a cache#

Newest first, each kept checkpoint_days. Any role.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the cache's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200object

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
409Not available: not_available

Example

curl "https://api.ibel.ai/v1/cache/databases/sessions/checkpoints" \
  -H "Authorization: Bearer $KEY"
POST/v1/cache/databases/{name}/checkpoints

Take a cache checkpoint now#

Every write acknowledged before it is in it.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the cache's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Request bodyapplication/json

object

Response

201object

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
409Not available: not_available

Example

curl -X POST "https://api.ibel.ai/v1/cache/databases/sessions/checkpoints" \
  -H "Authorization: Bearer $KEY" \
  -d '{}'
POST/v1/cache/databases/{name}/checkpoints/{id}/restore

Restore a cache from a checkpoint#

Replaces every key with the checkpoints; writes since then are lost. A session needs a step-up.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the cache's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • idstringpathrequired

    the checkpoint's id

    up to 128 characters

Request bodyapplication/json

object

Response

200object

Errors

StatusDescription
400Bad request: not_available
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required
404Not found: not_found
409Not available: not_available

Example

curl -X POST "https://api.ibel.ai/v1/cache/databases/sessions/checkpoints/7e5926b6f29c/restore" \
  -H "Authorization: Bearer $KEY" \
  -d '{}'
GET/v1/cache/databases/{name}/usage

Commands and bytes per minute#

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the cache's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • hoursintegerquery

    1-744, default 1

    1–744 · default 1

Response

200CacheUsage

  • totalobjectrequired
    • commandsinteger
    • bytesinteger
  • seriesobject[]required
    • minutestring (date-time)
    • commandsinteger
    • bytesinteger

Errors

StatusDescription
400Bad request: bad_param
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/cache/databases/sessions/usage" \
  -H "Authorization: Bearer $KEY"
GET/v1/cache/databases/{name}/observability

Commands, hit rate, memory, keys#

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the cache's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • rangestringquery

    1h (1-minute steps), 24h (15 minutes) or 7d (2 hours); any other value is 400 bad_range

    one of 1h, 24h, 7d · default "1h"

Response

200ResourceObservability

  • rangestringrequired
  • stepstringrequired
  • totalsobjectrequired
  • metricsobject[]required
  • seriesobject[]required
  • tablesobject[]

    databases only: the latest top statements

  • notestring

Errors

StatusDescription
400Bad request: bad_range
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/cache/databases/sessions/observability" \
  -H "Authorization: Bearer $KEY"