Back to explore

storage

Cache

Credits: 0.000001

Decrement

POST /v1/cache/Decrement

Decrement a value (if it's a number). If key not found it is equivalent to set.

Request

keystring

The key to decrement

valuenumber

The amount to decrement the value by

Response

keystring

The key decremented

valuenumber

The new value

Request

Response

{
    "key": "counter",
    "value": 0
}

Credits: 0.000001

Delete

POST /v1/cache/Delete

Delete a value from the cache. If key not found a success response is returned.

Request

keystring

The key to delete

Response

statusstring

Returns "ok" if successful

Request

Response

{
    "status": "ok"
}

Credits: 0.000001

Get

POST /v1/cache/Get

Get an item from the cache by key. If key is not found, an empty response is returned.

Request

keystring

The key to retrieve

Response

keystring

The key

ttlnumber

Time to live in seconds

valuestring

The value

Request

Response

{
    "key": "foo",
    "value": "bar",
    "ttl": 0
}

Credits: 0.000001

Increment

POST /v1/cache/Increment

Increment a value (if it's a number). If key not found it is equivalent to set.

Request

keystring

The key to increment

valuenumber

The amount to increment the value by

Response

keystring

The key incremented

valuenumber

The new value

Request

Response

{
    "key": "counter",
    "value": 2
}

Credits: 0.000001

List Keys

POST /v1/cache/ListKeys

List all the available keys

Request

{}

Response

keysarray

Request

Response

{
    "keys": [
        "counter",
        "foo"
    ]
}

Credits: 0.000001

Set

POST /v1/cache/Set

Set an item in the cache. Overwrites any existing value already set.

Request

keystring

The key to update

ttlnumber

Time to live in seconds

valuestring

The value to set

Response

statusstring

Returns "ok" if successful

Request

Response

{
    "status": "ok"
}