pub struct DatabaseHandler { /* private fields */ }
Expand description
Database handler for executing database commands
Implementations§
Source§impl DatabaseHandler
impl DatabaseHandler
pub fn new(client: RestClient) -> Self
Sourcepub async fn list(&self) -> Result<Vec<DatabaseInfo>>
pub async fn list(&self) -> Result<Vec<DatabaseInfo>>
List all databases (BDB.LIST)
Sourcepub async fn info(&self, uid: u32) -> Result<DatabaseInfo>
pub async fn info(&self, uid: u32) -> Result<DatabaseInfo>
Get specific database info (BDB.INFO)
Sourcepub async fn get(&self, uid: u32) -> Result<DatabaseInfo>
pub async fn get(&self, uid: u32) -> Result<DatabaseInfo>
Get specific database info (alias for info)
Sourcepub async fn create(
&self,
request: CreateDatabaseRequest,
) -> Result<DatabaseInfo>
pub async fn create( &self, request: CreateDatabaseRequest, ) -> Result<DatabaseInfo>
Create a new database (BDB.CREATE)
Sourcepub async fn update(&self, uid: u32, updates: Value) -> Result<DatabaseInfo>
pub async fn update(&self, uid: u32, updates: Value) -> Result<DatabaseInfo>
Update database configuration (BDB.UPDATE)
Sourcepub async fn restart(&self, uid: u32) -> Result<DatabaseActionResponse>
pub async fn restart(&self, uid: u32) -> Result<DatabaseActionResponse>
Restart database (BDB.RESTART)
Sourcepub async fn export(
&self,
uid: u32,
export_location: &str,
) -> Result<ExportResponse>
pub async fn export( &self, uid: u32, export_location: &str, ) -> Result<ExportResponse>
Export database (BDB.EXPORT)
Sourcepub async fn import(
&self,
uid: u32,
import_location: &str,
flush: bool,
) -> Result<ImportResponse>
pub async fn import( &self, uid: u32, import_location: &str, flush: bool, ) -> Result<ImportResponse>
Import database (BDB.IMPORT)
Sourcepub async fn flush(&self, uid: u32) -> Result<DatabaseActionResponse>
pub async fn flush(&self, uid: u32) -> Result<DatabaseActionResponse>
Flush database (BDB.FLUSH)
Sourcepub async fn backup(&self, uid: u32) -> Result<BackupResponse>
pub async fn backup(&self, uid: u32) -> Result<BackupResponse>
Backup database (BDB.BACKUP)
Sourcepub async fn restore(
&self,
uid: u32,
backup_uid: Option<&str>,
) -> Result<DatabaseActionResponse>
pub async fn restore( &self, uid: u32, backup_uid: Option<&str>, ) -> Result<DatabaseActionResponse>
Restore database from backup (BDB.RESTORE)
Sourcepub async fn endpoints(&self, uid: u32) -> Result<Vec<EndpointInfo>>
pub async fn endpoints(&self, uid: u32) -> Result<Vec<EndpointInfo>>
Get database endpoints (BDB.ENDPOINTS)
Sourcepub async fn optimize_shards_placement(&self, uid: u32) -> Result<Value>
pub async fn optimize_shards_placement(&self, uid: u32) -> Result<Value>
Optimize shards placement (status) - GET
Sourcepub async fn recover_status(&self, uid: u32) -> Result<Value>
pub async fn recover_status(&self, uid: u32) -> Result<Value>
Recover database (status) - GET
Sourcepub async fn recover(&self, uid: u32) -> Result<DatabaseActionResponse>
pub async fn recover(&self, uid: u32) -> Result<DatabaseActionResponse>
Recover database - POST
Sourcepub async fn resume_traffic(&self, uid: u32) -> Result<DatabaseActionResponse>
pub async fn resume_traffic(&self, uid: u32) -> Result<DatabaseActionResponse>
Resume traffic - POST
Sourcepub async fn stop_traffic(&self, uid: u32) -> Result<DatabaseActionResponse>
pub async fn stop_traffic(&self, uid: u32) -> Result<DatabaseActionResponse>
Stop traffic - POST
Sourcepub async fn rebalance(&self, uid: u32) -> Result<DatabaseActionResponse>
pub async fn rebalance(&self, uid: u32) -> Result<DatabaseActionResponse>
Rebalance database - PUT
Sourcepub async fn revamp(&self, uid: u32) -> Result<DatabaseActionResponse>
pub async fn revamp(&self, uid: u32) -> Result<DatabaseActionResponse>
Revamp database - PUT
Sourcepub async fn backup_reset_status(&self, uid: u32) -> Result<Value>
pub async fn backup_reset_status(&self, uid: u32) -> Result<Value>
Reset backup status - PUT
Sourcepub async fn export_reset_status(&self, uid: u32) -> Result<Value>
pub async fn export_reset_status(&self, uid: u32) -> Result<Value>
Reset export status - PUT
Sourcepub async fn import_reset_status(&self, uid: u32) -> Result<Value>
pub async fn import_reset_status(&self, uid: u32) -> Result<Value>
Reset import status - PUT
Sourcepub async fn peer_stats(&self, uid: u32) -> Result<Value>
pub async fn peer_stats(&self, uid: u32) -> Result<Value>
Peer stats for a database - GET
Sourcepub async fn peer_stats_for(&self, uid: u32, peer_uid: u32) -> Result<Value>
pub async fn peer_stats_for(&self, uid: u32, peer_uid: u32) -> Result<Value>
Peer stats for a specific peer - GET
Sourcepub async fn sync_source_stats(&self, uid: u32) -> Result<Value>
pub async fn sync_source_stats(&self, uid: u32) -> Result<Value>
Sync source stats for a database - GET
Sourcepub async fn sync_source_stats_for(
&self,
uid: u32,
src_uid: u32,
) -> Result<Value>
pub async fn sync_source_stats_for( &self, uid: u32, src_uid: u32, ) -> Result<Value>
Sync source stats for a specific source - GET
Sourcepub async fn syncer_state(&self, uid: u32) -> Result<Value>
pub async fn syncer_state(&self, uid: u32) -> Result<Value>
Syncer state (all) - GET
Sourcepub async fn syncer_state_crdt(&self, uid: u32) -> Result<Value>
pub async fn syncer_state_crdt(&self, uid: u32) -> Result<Value>
Syncer state for CRDT - GET
Sourcepub async fn syncer_state_replica(&self, uid: u32) -> Result<Value>
pub async fn syncer_state_replica(&self, uid: u32) -> Result<Value>
Syncer state for replica - GET
Sourcepub async fn passwords_delete(&self, uid: u32) -> Result<()>
pub async fn passwords_delete(&self, uid: u32) -> Result<()>
Database passwords delete - DELETE
Sourcepub async fn alerts_all(&self) -> Result<Value>
pub async fn alerts_all(&self) -> Result<Value>
List all database alerts - GET
Sourcepub async fn alerts_for(&self, uid: u32) -> Result<Value>
pub async fn alerts_for(&self, uid: u32) -> Result<Value>
List alerts for a specific database - GET
Sourcepub async fn alert_detail(&self, uid: u32, alert: &str) -> Result<Value>
pub async fn alert_detail(&self, uid: u32, alert: &str) -> Result<Value>
Get a specific alert for a database - GET
Sourcepub async fn crdt_source_alerts_all(&self) -> Result<Value>
pub async fn crdt_source_alerts_all(&self) -> Result<Value>
CRDT source alerts - GET
Sourcepub async fn crdt_source_alerts_for(&self, uid: u32) -> Result<Value>
pub async fn crdt_source_alerts_for(&self, uid: u32) -> Result<Value>
CRDT source alerts for DB - GET
Sourcepub async fn crdt_source_alerts_source(
&self,
uid: u32,
source_id: u32,
) -> Result<Value>
pub async fn crdt_source_alerts_source( &self, uid: u32, source_id: u32, ) -> Result<Value>
CRDT source alerts for specific source - GET
Sourcepub async fn crdt_source_alert_detail(
&self,
uid: u32,
source_id: u32,
alert: &str,
) -> Result<Value>
pub async fn crdt_source_alert_detail( &self, uid: u32, source_id: u32, alert: &str, ) -> Result<Value>
CRDT source alert detail - GET
Sourcepub async fn replica_source_alerts_all(&self) -> Result<Value>
pub async fn replica_source_alerts_all(&self) -> Result<Value>
Replica source alerts - GET
Sourcepub async fn replica_source_alerts_for(&self, uid: u32) -> Result<Value>
pub async fn replica_source_alerts_for(&self, uid: u32) -> Result<Value>
Replica source alerts for DB - GET
Sourcepub async fn replica_source_alerts_source(
&self,
uid: u32,
source_id: u32,
) -> Result<Value>
pub async fn replica_source_alerts_source( &self, uid: u32, source_id: u32, ) -> Result<Value>
Replica source alerts for specific source - GET
Sourcepub async fn replica_source_alert_detail(
&self,
uid: u32,
source_id: u32,
alert: &str,
) -> Result<Value>
pub async fn replica_source_alert_detail( &self, uid: u32, source_id: u32, alert: &str, ) -> Result<Value>
Replica source alert detail - GET
Sourcepub async fn upgrade(
&self,
uid: u32,
module_name: &str,
new_version: &str,
) -> Result<DatabaseActionResponse>
pub async fn upgrade( &self, uid: u32, module_name: &str, new_version: &str, ) -> Result<DatabaseActionResponse>
Upgrade database with new module version (BDB.UPGRADE)
Sourcepub async fn reset_password(
&self,
uid: u32,
new_password: &str,
) -> Result<DatabaseActionResponse>
pub async fn reset_password( &self, uid: u32, new_password: &str, ) -> Result<DatabaseActionResponse>
Reset database password (BDB.RESET_PASSWORD)
Sourcepub async fn availability(&self, uid: u32) -> Result<Value>
pub async fn availability(&self, uid: u32) -> Result<Value>
Check database availability
Sourcepub async fn endpoint_availability(&self, uid: u32) -> Result<Value>
pub async fn endpoint_availability(&self, uid: u32) -> Result<Value>
Check local database endpoint availability
Sourcepub async fn create_v2(&self, request: Value) -> Result<DatabaseInfo>
pub async fn create_v2(&self, request: Value) -> Result<DatabaseInfo>
Create database using v2 API (supports recovery plan)