DatabaseHandler

Struct DatabaseHandler 

Source
pub struct DatabaseHandler { /* private fields */ }
Expand description

Handler for Pro database operations

Manages database lifecycle, configuration, backup/restore, import/export, and monitoring for Redis Cloud Pro subscriptions.

Implementations§

Source§

impl DatabaseHandler

Source

pub fn new(client: CloudClient) -> Self

Create a new handler

Source

pub async fn get_subscription_databases( &self, subscription_id: i32, offset: Option<i32>, limit: Option<i32>, ) -> Result<AccountSubscriptionDatabases>

Get all databases in a Pro subscription Gets a list of all databases in the specified Pro subscription.

GET /subscriptions/{subscriptionId}/databases

Source

pub async fn create_database( &self, subscription_id: i32, request: &DatabaseCreateRequest, ) -> Result<TaskStateUpdate>

Create Pro database in existing subscription Creates a new database in an existing Pro subscription.

POST /subscriptions/{subscriptionId}/databases

Source

pub async fn delete_database_by_id( &self, subscription_id: i32, database_id: i32, ) -> Result<TaskStateUpdate>

Delete Pro database Deletes a database from a Pro subscription.

DELETE /subscriptions/{subscriptionId}/databases/{databaseId}

Source

pub async fn get_subscription_database_by_id( &self, subscription_id: i32, database_id: i32, ) -> Result<Database>

Get a single Pro database Gets details and settings of a single database in a Pro subscription.

GET /subscriptions/{subscriptionId}/databases/{databaseId}

Source

pub async fn update_database( &self, subscription_id: i32, database_id: i32, request: &DatabaseUpdateRequest, ) -> Result<TaskStateUpdate>

Update Pro database Updates an existing Pro database.

PUT /subscriptions/{subscriptionId}/databases/{databaseId}

Source

pub async fn get_database_backup_status( &self, subscription_id: i32, database_id: i32, region_name: Option<String>, ) -> Result<TaskStateUpdate>

Get Pro database backup status Gets information on the latest backup attempt for this Pro database.

GET /subscriptions/{subscriptionId}/databases/{databaseId}/backup

Source

pub async fn backup_database( &self, subscription_id: i32, database_id: i32, request: &DatabaseBackupRequest, ) -> Result<TaskStateUpdate>

Back up Pro database Manually back up the specified Pro database to a backup path. By default, backups will be stored in the ‘remoteBackup’ location for this database.

POST /subscriptions/{subscriptionId}/databases/{databaseId}/backup

Source

pub async fn get_subscription_database_certificate( &self, subscription_id: i32, database_id: i32, ) -> Result<DatabaseCertificate>

Get Pro database TLS certificate Gets the X.509 PEM (base64) encoded server certificate for TLS connection to the database. Requires ‘enableTLS’ to be ‘true’ for the database.

GET /subscriptions/{subscriptionId}/databases/{databaseId}/certificate

Source

pub async fn flush_crdb( &self, subscription_id: i32, database_id: i32, request: &CrdbFlushRequest, ) -> Result<TaskStateUpdate>

Flush Pro database Deletes all data from the specified Pro database.

PUT /subscriptions/{subscriptionId}/databases/{databaseId}/flush

Source

pub async fn get_database_import_status( &self, subscription_id: i32, database_id: i32, ) -> Result<TaskStateUpdate>

Get Pro database import status Gets information on the latest import attempt for this Pro database.

GET /subscriptions/{subscriptionId}/databases/{databaseId}/import

Source

pub async fn import_database( &self, subscription_id: i32, database_id: i32, request: &DatabaseImportRequest, ) -> Result<TaskStateUpdate>

Import data to a Pro database Imports data from an RDB file or from a different Redis database into this Pro database. WARNING: Importing data into a database removes all existing data from the database.

POST /subscriptions/{subscriptionId}/databases/{databaseId}/import

Source

pub async fn update_crdb_local_properties( &self, subscription_id: i32, database_id: i32, request: &CrdbUpdatePropertiesRequest, ) -> Result<TaskStateUpdate>

Update Active-Active database (Active-Active databases only) Updates database properties for an Active-Active database.

PUT /subscriptions/{subscriptionId}/databases/{databaseId}/regions

Source

pub async fn get_slow_log( &self, subscription_id: i32, database_id: i32, region_name: Option<String>, ) -> Result<DatabaseSlowLogEntries>

Get database slowlog Gets the slowlog for a specific database.

GET /subscriptions/{subscriptionId}/databases/{databaseId}/slow-log

Source

pub async fn get_tags( &self, subscription_id: i32, database_id: i32, ) -> Result<CloudTags>

Get database tags Gets a list of all database tags.

GET /subscriptions/{subscriptionId}/databases/{databaseId}/tags

Source

pub async fn create_tag( &self, subscription_id: i32, database_id: i32, request: &DatabaseTagCreateRequest, ) -> Result<CloudTag>

Add a database tag Adds a single database tag to a database.

POST /subscriptions/{subscriptionId}/databases/{databaseId}/tags

Source

pub async fn update_tags( &self, subscription_id: i32, database_id: i32, request: &DatabaseTagsUpdateRequest, ) -> Result<CloudTags>

Overwrite database tags Overwrites all tags on the database.

PUT /subscriptions/{subscriptionId}/databases/{databaseId}/tags

Source

pub async fn delete_tag( &self, subscription_id: i32, database_id: i32, tag_key: String, ) -> Result<HashMap<String, Value>>

Delete database tag Removes the specified tag from the database.

DELETE /subscriptions/{subscriptionId}/databases/{databaseId}/tags/{tagKey}

Source

pub async fn update_tag( &self, subscription_id: i32, database_id: i32, tag_key: String, request: &DatabaseTagUpdateRequest, ) -> Result<CloudTag>

Update database tag value Updates the value of the specified database tag.

PUT /subscriptions/{subscriptionId}/databases/{databaseId}/tags/{tagKey}

Source

pub async fn get_database_redis_version_upgrade_status( &self, subscription_id: i32, database_id: i32, ) -> Result<BdbVersionUpgradeStatus>

Get Pro database version upgrade status Gets information on the latest upgrade attempt for this Pro database.

GET /subscriptions/{subscriptionId}/databases/{databaseId}/upgrade

Source

pub async fn upgrade_database_redis_version( &self, subscription_id: i32, database_id: i32, request: &DatabaseUpgradeRedisVersionRequest, ) -> Result<TaskStateUpdate>

Upgrade Pro database version

POST /subscriptions/{subscriptionId}/databases/{databaseId}/upgrade

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,