pub struct CreateDatabaseParams {
pub name: String,
pub memory_limit_in_gb: f64,
pub replication: Option<bool>,
pub protocol: Option<String>,
pub data_persistence: Option<String>,
pub data_eviction_policy: Option<String>,
pub redis_version: Option<String>,
pub support_oss_cluster_api: Option<bool>,
pub port: Option<i32>,
}Expand description
Parameters for creating a database
This is a convenience wrapper around DatabaseCreateRequest that
provides a simpler API for common use cases. For advanced options,
use DatabaseCreateRequest::builder() directly.
§Example
use redisctl_core::cloud::CreateDatabaseParams;
let params = CreateDatabaseParams::new("my-database", 1.0)
.with_replication(true)
.with_protocol("stack")
.with_data_persistence("aof-every-1-second");
let request = params.into_request();Fields§
§name: StringDatabase name (required)
memory_limit_in_gb: f64Memory limit in GB (required)
replication: Option<bool>Enable replication (default: true)
protocol: Option<String>Protocol: “redis”, “stack”, or “memcached” (default: “redis”)
data_persistence: Option<String>Data persistence: “none”, “aof-every-1-second”, “aof-every-write”, “snapshot-every-1-hour”, “snapshot-every-6-hours”, “snapshot-every-12-hours”
data_eviction_policy: Option<String>Data eviction policy (default: “volatile-lru”)
redis_version: Option<String>Redis version
support_oss_cluster_api: Option<bool>Support OSS Cluster API
port: Option<i32>TCP port (10000-19999)
Implementations§
Source§impl CreateDatabaseParams
impl CreateDatabaseParams
Sourcepub fn new(name: impl Into<String>, memory_limit_in_gb: f64) -> Self
pub fn new(name: impl Into<String>, memory_limit_in_gb: f64) -> Self
Create new params with required fields
Sourcepub fn with_replication(self, replication: bool) -> Self
pub fn with_replication(self, replication: bool) -> Self
Set replication
Sourcepub fn with_protocol(self, protocol: impl Into<String>) -> Self
pub fn with_protocol(self, protocol: impl Into<String>) -> Self
Set protocol
Sourcepub fn with_data_persistence(self, persistence: impl Into<String>) -> Self
pub fn with_data_persistence(self, persistence: impl Into<String>) -> Self
Set data persistence
Sourcepub fn with_eviction_policy(self, policy: impl Into<String>) -> Self
pub fn with_eviction_policy(self, policy: impl Into<String>) -> Self
Set eviction policy
Sourcepub fn with_redis_version(self, version: impl Into<String>) -> Self
pub fn with_redis_version(self, version: impl Into<String>) -> Self
Set Redis version
Sourcepub fn with_oss_cluster_api(self, enabled: bool) -> Self
pub fn with_oss_cluster_api(self, enabled: bool) -> Self
Enable OSS Cluster API support
Sourcepub fn into_request(self) -> DatabaseCreateRequest
pub fn into_request(self) -> DatabaseCreateRequest
Convert to Layer 1 DatabaseCreateRequest
Uses the TypedBuilder pattern from redis-cloud, setting only the fields that have values.
Trait Implementations§
Source§impl Clone for CreateDatabaseParams
impl Clone for CreateDatabaseParams
Source§fn clone(&self) -> CreateDatabaseParams
fn clone(&self) -> CreateDatabaseParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more