Upstash
Serverless Redis с Upstash
Upstash — serverless data-платформа для современных приложений, которым нужно быстрое, простое и масштабируемое хранение данных с минимальной настройкой. Upstash специализируется на предоставлении Redis и Kafka как полностью управляемых облачных сервисов с оплатой за запрос, что делает его популярным выбором для разработчиков, создающих serverless-, edge- и event-driven архитектуры.
Upstash Redis позволяет:
- Мгновенно сохранять и получать данные: читайте и записывайте key-value пары, хэши, списки, множества и многое другое через высокопроизводительный REST API.
- Масштабироваться serverless-способом: никакой инфраструктуры. Upstash автоматически масштабируется вместе с приложением, и вы платите только за фактическое использование.
- Получать глобальный доступ: разворачивайте сервис рядом с пользователями благодаря поддержке нескольких регионов и глобальной дистрибуции.
- Легко интегрироваться: используйте REST API Upstash в serverless-функциях, edge-воркерах, Next.js, Vercel, Cloudflare Workers и других средах.
- Автоматизировать через скрипты: запускайте Lua-скрипты для расширенных транзакций и автоматизации.
- Обеспечивать безопасность: защищайте данные встроенной аутентификацией и TLS-шифрованием.
Интеграция Upstash в AACFlow даёт вашим агентам и воркфлоу возможность читать, записывать и управлять данными в Upstash Redis через простые унифицированные команды — это идеально подходит для масштабируемых автоматизаций, кэширования результатов, работы с очередями и многого другого без задач по администрированию серверов.
Connect to Upstash Redis to perform key-value, hash, list, и utility operations via the REST API.
Получить значение of a key from Upstash Redis.
| Параметр | Тип | Обязательный | Описание |
|---|
restUrl | string | Да | Upstash Redis REST URL |
restToken | string | Да | Upstash Redis REST Token |
key | string | Да | The key to retrieve |
| Параметр | Тип | Описание |
|---|
key | string | The key that was retrieved |
value | json | The value of the key (string), or null if not found |
Установить value of a key in Upstash Redis с an optional expiration time in seconds.
| Параметр | Тип | Обязательный | Описание |
|---|
restUrl | string | Да | Upstash Redis REST URL |
restToken | string | Да | Upstash Redis REST Token |
key | string | Да | The key to set |
value | string | Да | The value to store |
ex | number | Нет | Expiration time in seconds (optional) |
| Параметр | Тип | Описание |
|---|
key | string | The key that was set |
result | string | The result of the SET operation (typically "OK") |
Удалить key from Upstash Redis.
| Параметр | Тип | Обязательный | Описание |
|---|
restUrl | string | Да | Upstash Redis REST URL |
restToken | string | Да | Upstash Redis REST Token |
key | string | Да | The key to delete |
| Параметр | Тип | Описание |
|---|
key | string | The key that was deleted |
deletedCount | number | Number of keys deleted (0 if key did not exist, 1 if deleted) |
Список keys matching a pattern in Upstash Redis. Defaults to listing all keys (*).
| Параметр | Тип | Обязательный | Описание |
|---|
restUrl | string | Да | Upstash Redis REST URL |
restToken | string | Да | Upstash Redis REST Token |
pattern | string | Нет | Pattern to match keys (e.g., "user:"). Defaults to "" for all keys. |
| Параметр | Тип | Описание |
|---|
pattern | string | The pattern used to match keys |
keys | array | List of keys matching the pattern |
count | number | Number of keys found |
Выполнить an arbitrary Redis command against Upstash Redis. Pass the full command as a JSON array (e.g., [
| Параметр | Тип | Обязательный | Описание |
|---|
restUrl | string | Да | Upstash Redis REST URL |
restToken | string | Да | Upstash Redis REST Token |
command | string | Да | Redis command as a JSON array (e.g., ["HSET", "myhash", "field1", "value1"]) or a simple command string (e.g., "PING") |
| Параметр | Тип | Описание |
|---|
command | string | The command that was executed |
result | json | The result of the Redis command |
Set a field in a hash stored at a key in Upstash Redis.
| Параметр | Тип | Обязательный | Описание |
|---|
restUrl | string | Да | Upstash Redis REST URL |
restToken | string | Да | Upstash Redis REST Token |
key | string | Да | The hash key |
field | string | Да | The field name within the hash |
value | string | Да | The value to store in the hash field |
| Параметр | Тип | Описание |
|---|
key | string | The hash key |
field | string | The field that was set |
result | number | Number of new fields added (0 if field was updated, 1 if new) |
Получить значение of a field in a hash stored at a key in Upstash Redis.
| Параметр | Тип | Обязательный | Описание |
|---|
restUrl | string | Да | Upstash Redis REST URL |
restToken | string | Да | Upstash Redis REST Token |
key | string | Да | The hash key |
field | string | Да | The field name to retrieve |
| Параметр | Тип | Описание |
|---|
key | string | The hash key |
field | string | The field that was retrieved |
value | json | The value of the hash field (string), or null if not found |
Получить все fields и values of a hash stored at a key in Upstash Redis.
| Параметр | Тип | Обязательный | Описание |
|---|
restUrl | string | Да | Upstash Redis REST URL |
restToken | string | Да | Upstash Redis REST Token |
key | string | Да | The hash key |
| Параметр | Тип | Описание |
|---|
key | string | The hash key |
fields | object | All field-value pairs in the hash, keyed by field name |
fieldCount | number | Number of fields in the hash |
Atomically increment the integer value of a key by one in Upstash Redis. If the key does not exist, it — это set to 0 before incrementing.
| Параметр | Тип | Обязательный | Описание |
|---|
restUrl | string | Да | Upstash Redis REST URL |
restToken | string | Да | Upstash Redis REST Token |
key | string | Да | The key to increment |
| Параметр | Тип | Описание |
|---|
key | string | The key that was incremented |
value | number | The new value after incrementing |
Set a timeout on a key in Upstash Redis. After the timeout, the key — это deleted.
| Параметр | Тип | Обязательный | Описание |
|---|
restUrl | string | Да | Upstash Redis REST URL |
restToken | string | Да | Upstash Redis REST Token |
key | string | Да | The key to set expiration on |
seconds | number | Да | Timeout in seconds |
| Параметр | Тип | Описание |
|---|
key | string | The key that expiration was set on |
result | number | 1 if the timeout was set, 0 if the key does not exist |
Получить remaining time to live of a key in Upstash Redis. Returns -1 if the key has no expiration, -2 if the key does not exist.
| Параметр | Тип | Обязательный | Описание |
|---|
restUrl | string | Да | Upstash Redis REST URL |
restToken | string | Да | Upstash Redis REST Token |
key | string | Да | The key to check TTL for |
| Параметр | Тип | Описание |
|---|
key | string | The key checked |
ttl | number | Remaining TTL in seconds. Positive integer if the key has a TTL set, -1 if the key exists with no expiration, -2 if the key does not exist. |
Prepend a value to the beginning of a list in Upstash Redis. Creates the list if it does not exist.
| Параметр | Тип | Обязательный | Описание |
|---|
restUrl | string | Да | Upstash Redis REST URL |
restToken | string | Да | Upstash Redis REST Token |
key | string | Да | The list key |
value | string | Да | The value to prepend to the list |
| Параметр | Тип | Описание |
|---|
key | string | The list key |
length | number | The length of the list after the push |
Получить a range of elements from a list in Upstash Redis. Use 0 и -1 для start и stop to get all elements.
| Параметр | Тип | Обязательный | Описание |
|---|
restUrl | string | Да | Upstash Redis REST URL |
restToken | string | Да | Upstash Redis REST Token |
key | string | Да | The list key |
start | number | Да | Start index (0-based, negative values count from end) |
stop | number | Да | Stop index (inclusive, -1 for last element) |
| Параметр | Тип | Описание |
|---|
key | string | The list key |
values | array | List of elements in the specified range |
count | number | Number of elements returned |
Проверить if a key exists in Upstash Redis. Returns true if the key exists, false otherwise.
| Параметр | Тип | Обязательный | Описание |
|---|
restUrl | string | Да | Upstash Redis REST URL |
restToken | string | Да | Upstash Redis REST Token |
key | string | Да | The key to check |
| Параметр | Тип | Описание |
|---|
key | string | The key that was checked |
exists | boolean | Произошла ли key exists (true) or not (false) |
Установить value of a key only if it does not already exist. Returns true if the key was set, false if it already existed.
| Параметр | Тип | Обязательный | Описание |
|---|
restUrl | string | Да | Upstash Redis REST URL |
restToken | string | Да | Upstash Redis REST Token |
key | string | Да | The key to set |
value | string | Да | The value to store if the key does not exist |
| Параметр | Тип | Описание |
|---|
key | string | The key that was attempted to set |
wasSet | boolean | Произошла ли key was set (true) or already existed (false) |
Increment the integer value of a key by a given amount. Use a negative value to decrement. If the key does not exist, it — это set to 0 before the operation.
| Параметр | Тип | Обязательный | Описание |
|---|
restUrl | string | Да | Upstash Redis REST URL |
restToken | string | Да | Upstash Redis REST Token |
key | string | Да | The key to increment |
increment | number | Да | Amount to increment by (use negative value to decrement) |
| Параметр | Тип | Описание |
|---|
key | string | The key that was incremented |
value | number | The new value after incrementing |