| Crates.io | redis-enterprise |
| lib.rs | redis-enterprise |
| version | 0.7.4 |
| created_at | 2025-08-27 21:16:55.259533+00 |
| updated_at | 2026-01-23 19:56:02.841181+00 |
| description | Redis Enterprise REST API client library |
| homepage | https://github.com/redis-developer/redisctl |
| repository | https://github.com/redis-developer/redisctl |
| max_upload_size | |
| id | 1813201 |
| size | 959,438 |
A comprehensive Rust client library for the Redis Enterprise REST API.
[dependencies]
redis-enterprise = "0.1.0"
# Optional: Enable Tower service integration
redis-enterprise = { version = "0.1.0", features = ["tower-integration"] }
use redis_enterprise::EnterpriseClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create client using builder pattern
let client = EnterpriseClient::builder()
.url("https://cluster.example.com:9443")
.username("admin@example.com")
.password("your-password")
.insecure(false) // Set to true for self-signed certificates
.build()?;
// Get cluster information
let cluster = client.cluster().info().await?;
println!("Cluster: {:?}", cluster);
// List databases (BDBs)
let databases = client.database().list().await?;
println!("Databases: {:?}", databases);
// Get node statistics
let nodes = client.node().list().await?;
println!("Nodes: {:?}", nodes);
Ok(())
}
The examples/ directory contains runnable examples demonstrating common use cases:
basic_enterprise.rs - Getting started with cluster connectiondatabase_management.rs - Managing databases and viewing statisticsRun examples with:
# Set your cluster credentials
export REDIS_ENTERPRISE_URL="https://localhost:9443"
export REDIS_ENTERPRISE_USER="admin@redis.local"
export REDIS_ENTERPRISE_PASSWORD="your-password"
export REDIS_ENTERPRISE_INSECURE="true" # For self-signed certificates
# Run an example
cargo run --example basic
Enable the tower-integration feature to use the client with Tower middleware:
use redis_enterprise::EnterpriseClient;
use redis_enterprise::tower_support::ApiRequest;
use tower::ServiceExt;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = EnterpriseClient::builder()
.base_url("https://localhost:9443")
.username("admin")
.password("password")
.insecure(true)
.build()?;
// Convert to a Tower service
let mut service = client.into_service();
// Use the service
let response = service
.oneshot(ApiRequest::get("/v1/cluster"))
.await?;
println!("Response: {:?}", response.body);
Ok(())
}
This enables composition with Tower middleware like circuit breakers, retry, rate limiting, and more.
This library provides 100% coverage of the Redis Enterprise REST API, including:
For detailed API documentation, see the Redis Enterprise REST API Reference.
Licensed under either of
at your option.