| Crates.io | redis-cloud |
| lib.rs | redis-cloud |
| version | 0.7.6 |
| created_at | 2025-08-27 21:16:23.356316+00 |
| updated_at | 2026-01-23 19:55:45.257051+00 |
| description | Redis Cloud REST API client library |
| homepage | https://github.com/redis-developer/redisctl |
| repository | https://github.com/redis-developer/redisctl |
| max_upload_size | |
| id | 1813200 |
| size | 1,261,724 |
A comprehensive Rust client library for the Redis Cloud REST API.
[dependencies]
redis-cloud = "0.1.0"
# Optional: Enable Tower service integration
redis-cloud = { version = "0.1.0", features = ["tower-integration"] }
use redis_cloud::CloudClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create client using builder pattern
let client = CloudClient::builder()
.api_key("your-api-key")
.api_secret("your-api-secret")
.build()?;
// Get account information
let account = client.account().get().await?;
println!("Account: {:?}", account);
// List all subscriptions
let subscriptions = client.subscription().list().await?;
println!("Subscriptions: {:?}", subscriptions);
// List databases in a subscription
let databases = client.database().list("subscription-id").await?;
println!("Databases: {:?}", databases);
Ok(())
}
The examples/ directory contains runnable examples demonstrating common use cases:
basic_cloud.rs - Getting started with the API clientdatabase_management.rs - Managing databasesRun examples with:
# Set your API credentials
export REDIS_CLOUD_API_KEY="your-api-key"
export REDIS_CLOUD_API_SECRET="your-api-secret"
# Run an example
cargo run --example basic
Enable the tower-integration feature to use the client with Tower middleware:
use redis_cloud::CloudClient;
use redis_cloud::tower_support::ApiRequest;
use tower::ServiceExt;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = CloudClient::builder()
.api_key("your-api-key")
.api_secret("your-api-secret")
.build()?;
// Convert to a Tower service
let mut service = client.into_service();
// Use the service
let response = service
.oneshot(ApiRequest::get("/subscriptions"))
.await?;
println!("Response: {:?}", response.body);
Ok(())
}
This enables composition with Tower middleware like circuit breakers, retry, rate limiting, and more.
This library provides comprehensive coverage of the Redis Cloud REST API, including:
For detailed API documentation, see the Redis Cloud API Reference.
Licensed under either of
at your option.