pub struct ModuleHandler { /* private fields */ }Expand description
Module handler for managing Redis modules
Implementations§
Source§impl ModuleHandler
impl ModuleHandler
Sourcepub fn new(client: RestClient) -> Self
pub fn new(client: RestClient) -> Self
Create a new handler bound to the given REST client.
Sourcepub async fn upload(
&self,
module_data: Vec<u8>,
file_name: &str,
) -> Result<Value>
pub async fn upload( &self, module_data: Vec<u8>, file_name: &str, ) -> Result<Value>
Upload new module (tries v2 first, falls back to v1)
Note: Some Redis Enterprise versions (particularly RE 8.x) do not support module upload via the REST API. In those cases, use the Admin UI or node-level CLI tools (rladmin) to upload modules.
Sourcepub async fn update(&self, uid: &str, updates: Value) -> Result<Module>
pub async fn update(&self, uid: &str, updates: Value) -> Result<Module>
Update module configuration
Sourcepub async fn config_bdb(&self, bdb_uid: u32, config: Value) -> Result<Module>
pub async fn config_bdb(&self, bdb_uid: u32, config: Value) -> Result<Module>
Configure modules for a specific database - POST /v1/modules/config/bdb/{uid}
Sourcepub async fn list_user_defined_artifacts(&self) -> Result<Value>
pub async fn list_user_defined_artifacts(&self) -> Result<Value>
List custom module artifacts on the local node.
GET /v2/local/modules/user-defined/artifacts. Live verification on
Redis Enterprise Software 8.0.10-81 returned 200 OK with [] on a
cluster with no custom modules uploaded.
Sourcepub async fn upload_user_defined_artifact(
&self,
module_data: Vec<u8>,
file_name: &str,
) -> Result<Value>
pub async fn upload_user_defined_artifact( &self, module_data: Vec<u8>, file_name: &str, ) -> Result<Value>
Upload a custom module artifact to the local node.
POST /v2/local/modules/user-defined/artifacts. The endpoint expects
a multipart upload; the file is sent under the module form field
to match the existing v1/v2 module upload behaviour. Live
verification on 8.0.10-81 returned 400 no_module when an empty
body was sent.
Sourcepub async fn register_user_defined(&self, body: Value) -> Result<Value>
pub async fn register_user_defined(&self, body: Value) -> Result<Value>
Register a previously-uploaded artifact as a cluster-wide user-defined module configuration.
POST /v2/modules/user-defined. The body shape is version-specific
(it must reference an artifact that has already been uploaded via
upload_user_defined_artifact
and describe how the cluster should load it); pass a Value
matching the documented payload. Live verification on 8.0.10-81
returned 406 invalid_module when an empty body was sent.
Sourcepub async fn delete_user_defined(&self, uid: &str) -> Result<()>
pub async fn delete_user_defined(&self, uid: &str) -> Result<()>
Delete a custom module configuration cluster-wide.
DELETE /v2/modules/user-defined/{uid}. Live verification on
8.0.10-81 returned 404 module_delete_failed against a uid that
does not exist on the cluster.