use clap::Subcommand;
#[derive(Subcommand, Debug)]
#[command(after_long_help = "\
COMMAND GROUPS:
Core: database (db), cluster, node, shard, endpoint
Access: user, role, acl, ldap, ldap-mappings, auth
Monitoring: stats, status, alerts (alert), logs (log), diagnostics (diag),
debug-info
Admin: license (lic), module, proxy, services (svc), cm-settings, suffix
Advanced: crdb, crdb-task, bdb-group, migration, bootstrap, job-scheduler
Troubleshoot: support-package, ocsp, usage-report, local
Other: action, jsonschema, workflow
Aliases shown in parentheses (e.g. 'enterprise db list' instead of 'enterprise database list').")]
pub enum EnterpriseCommands {
#[command(subcommand, display_order = 1, visible_alias = "db")]
Database(EnterpriseDatabaseCommands),
#[command(subcommand, display_order = 2)]
Cluster(EnterpriseClusterCommands),
#[command(subcommand, display_order = 3)]
Node(EnterpriseNodeCommands),
#[command(subcommand, display_order = 4)]
Shard(crate::commands::enterprise::shard::ShardCommands),
#[command(subcommand, display_order = 5)]
Endpoint(crate::commands::enterprise::endpoint::EndpointCommands),
#[command(subcommand, display_order = 10)]
User(EnterpriseUserCommands),
#[command(subcommand, display_order = 11)]
Role(EnterpriseRoleCommands),
#[command(subcommand, display_order = 12)]
Acl(EnterpriseAclCommands),
#[command(subcommand, display_order = 13)]
Ldap(crate::commands::enterprise::ldap::LdapCommands),
#[command(subcommand, name = "ldap-mappings", display_order = 14)]
LdapMappings(crate::commands::enterprise::ldap::LdapMappingsCommands),
#[command(subcommand, display_order = 15)]
Auth(EnterpriseAuthCommands),
#[command(subcommand, display_order = 20)]
Stats(EnterpriseStatsCommands),
#[command(display_order = 21)]
Status {
#[arg(long)]
cluster: bool,
#[arg(long)]
nodes: bool,
#[arg(long)]
databases: bool,
#[arg(long)]
shards: bool,
#[arg(long)]
brief: bool,
},
#[command(subcommand, display_order = 22, visible_alias = "alert")]
Alerts(crate::commands::enterprise::alerts::AlertsCommands),
#[command(subcommand, display_order = 23, visible_alias = "log")]
Logs(crate::commands::enterprise::logs::LogsCommands),
#[command(subcommand, display_order = 24, visible_alias = "diag")]
Diagnostics(crate::commands::enterprise::diagnostics::DiagnosticsCommands),
#[command(subcommand, display_order = 25)]
DebugInfo(crate::commands::enterprise::debuginfo::DebugInfoCommands),
#[command(subcommand, display_order = 30, visible_alias = "lic")]
License(crate::commands::enterprise::license::LicenseCommands),
#[command(subcommand, display_order = 31)]
Module(crate::commands::enterprise::module::ModuleCommands),
#[command(subcommand, display_order = 32)]
Proxy(crate::commands::enterprise::proxy::ProxyCommands),
#[command(subcommand, display_order = 33, visible_alias = "svc")]
Services(crate::commands::enterprise::services::ServicesCommands),
#[command(subcommand, name = "cm-settings", display_order = 34)]
CmSettings(crate::commands::enterprise::cm_settings::CmSettingsCommands),
#[command(subcommand, display_order = 35)]
Suffix(crate::commands::enterprise::suffix::SuffixCommands),
#[command(subcommand, display_order = 40)]
Crdb(EnterpriseCrdbCommands),
#[command(subcommand, name = "crdb-task", display_order = 41)]
CrdbTask(crate::commands::enterprise::crdb_task::CrdbTaskCommands),
#[command(subcommand, name = "bdb-group", display_order = 42)]
BdbGroup(crate::commands::enterprise::bdb_group::BdbGroupCommands),
#[command(subcommand, display_order = 43)]
Migration(crate::commands::enterprise::migration::MigrationCommands),
#[command(subcommand, display_order = 44)]
Bootstrap(crate::commands::enterprise::bootstrap::BootstrapCommands),
#[command(subcommand, name = "job-scheduler", display_order = 45)]
JobScheduler(crate::commands::enterprise::job_scheduler::JobSchedulerCommands),
#[command(subcommand, name = "support-package", display_order = 50)]
SupportPackage(crate::commands::enterprise::support_package::SupportPackageCommands),
#[command(subcommand, display_order = 51)]
Ocsp(crate::commands::enterprise::ocsp::OcspCommands),
#[command(subcommand, name = "usage-report", display_order = 52)]
UsageReport(crate::commands::enterprise::usage_report::UsageReportCommands),
#[command(subcommand, display_order = 53)]
Local(crate::commands::enterprise::local::LocalCommands),
#[command(subcommand, display_order = 60)]
Action(crate::commands::enterprise::actions::ActionCommands),
#[command(subcommand, display_order = 61)]
Jsonschema(crate::commands::enterprise::jsonschema::JsonSchemaCommands),
#[command(subcommand, display_order = 62)]
Workflow(EnterpriseWorkflowCommands),
}
#[derive(Debug, Subcommand)]
pub enum EnterpriseWorkflowCommands {
List,
#[command(subcommand)]
License(crate::commands::enterprise::license_workflow::LicenseWorkflowCommands),
#[command(name = "init-cluster")]
InitCluster {
#[arg(long, default_value = "redis-cluster")]
name: String,
#[arg(long, default_value = "admin@redis.local")]
username: String,
#[arg(long, env = "REDIS_ENTERPRISE_INIT_PASSWORD")]
password: String,
#[arg(long)]
skip_database: bool,
#[arg(long, default_value = "default-db")]
database_name: String,
#[arg(long, default_value = "1")]
database_memory_gb: i64,
#[command(flatten)]
async_ops: crate::commands::cloud::async_utils::AsyncOperationArgs,
},
}
#[derive(Subcommand, Debug)]
pub enum EnterpriseClusterCommands {
Get,
#[command(after_help = "EXAMPLES:
# Update cluster name
redisctl enterprise cluster update --name my-cluster
# Enable email alerts
redisctl enterprise cluster update --email-alerts true
# Enable rack awareness
redisctl enterprise cluster update --rack-aware true
# Update multiple settings
redisctl enterprise cluster update --email-alerts true --rack-aware true
# Using JSON for advanced configuration
redisctl enterprise cluster update --data '{\"cm_session_timeout_minutes\": 30}'")]
Update {
#[arg(long)]
name: Option<String>,
#[arg(long)]
email_alerts: Option<bool>,
#[arg(long)]
rack_aware: Option<bool>,
#[arg(long, value_name = "FILE|JSON")]
data: Option<String>,
},
#[command(name = "get-policy")]
GetPolicy,
#[command(
name = "update-policy",
after_help = "EXAMPLES:
# Set default shards placement
redisctl enterprise cluster update-policy --default-shards-placement dense
# Enable rack awareness
redisctl enterprise cluster update-policy --rack-aware true
# Set default Redis version
redisctl enterprise cluster update-policy --default-redis-version 7.2
# Enable persistent node removal
redisctl enterprise cluster update-policy --persistent-node-removal true
# Using JSON for advanced configuration
redisctl enterprise cluster update-policy --data @policy.json"
)]
UpdatePolicy {
#[arg(long)]
default_shards_placement: Option<String>,
#[arg(long)]
rack_aware: Option<bool>,
#[arg(long)]
default_redis_version: Option<String>,
#[arg(long)]
persistent_node_removal: Option<bool>,
#[arg(long, value_name = "FILE|JSON")]
data: Option<String>,
},
#[command(name = "get-license")]
GetLicense,
#[command(name = "update-license")]
UpdateLicense {
#[arg(long, value_name = "FILE|KEY")]
license: String,
},
#[command(after_help = "EXAMPLES:
# Bootstrap with required parameters
redisctl enterprise cluster bootstrap --cluster-name mycluster \\
--username admin@example.com --password mypassword
# Using JSON for additional options
redisctl enterprise cluster bootstrap --data @bootstrap.json")]
Bootstrap {
#[arg(long)]
cluster_name: Option<String>,
#[arg(long)]
username: Option<String>,
#[arg(long)]
password: Option<String>,
#[arg(long, value_name = "FILE|JSON")]
data: Option<String>,
#[arg(long)]
dry_run: bool,
},
#[command(after_help = "EXAMPLES:
# Join with required parameters
redisctl enterprise cluster join --nodes 192.168.1.100 \\
--username admin@example.com --password mypassword
# Join multiple nodes
redisctl enterprise cluster join --nodes 192.168.1.100 --nodes 192.168.1.101 \\
--username admin@example.com --password mypassword
# Using JSON for additional options
redisctl enterprise cluster join --data @join.json")]
Join {
#[arg(long)]
nodes: Vec<String>,
#[arg(long)]
username: Option<String>,
#[arg(long)]
password: Option<String>,
#[arg(long, value_name = "FILE|JSON")]
data: Option<String>,
},
#[command(after_help = "EXAMPLES:
# Recover with default options
redisctl enterprise cluster recover
# Using JSON for recovery options
redisctl enterprise cluster recover --data @recover.json")]
Recover {
#[arg(long, value_name = "FILE|JSON")]
data: Option<String>,
},
Reset {
#[arg(long)]
force: bool,
},
Stats,
Metrics {
#[arg(long)]
interval: Option<String>,
},
Alerts,
Events {
#[arg(long, default_value = "100")]
limit: Option<u32>,
},
#[command(name = "audit-log")]
AuditLog {
#[arg(long)]
from: Option<String>,
},
#[command(name = "maintenance-mode-enable")]
MaintenanceModeEnable,
#[command(name = "maintenance-mode-disable")]
MaintenanceModeDisable,
#[command(name = "debug-info")]
DebugInfo,
#[command(name = "check-status")]
CheckStatus,
#[command(name = "health")]
Health,
#[command(name = "verify-balance")]
VerifyBalance,
#[command(name = "verify-rack-awareness")]
VerifyRackAwareness,
#[command(name = "get-certificates")]
GetCertificates,
#[command(
name = "update-certificates",
after_help = "EXAMPLES:
# Update proxy certificate from file
redisctl enterprise cluster update-certificates --name proxy --certificate @proxy.pem
# Update API certificate with key
redisctl enterprise cluster update-certificates --name api --certificate @api.pem --key @api.key
# Using JSON for advanced configuration
redisctl enterprise cluster update-certificates --data @certs.json"
)]
UpdateCertificates {
#[arg(long)]
name: Option<String>,
#[arg(long)]
certificate: Option<String>,
#[arg(long)]
key: Option<String>,
#[arg(long, value_name = "FILE|JSON")]
data: Option<String>,
},
#[command(name = "rotate-certificates")]
RotateCertificates,
#[command(name = "get-ocsp")]
GetOcsp,
#[command(
name = "update-ocsp",
after_help = "EXAMPLES:
# Enable OCSP with responder URL
redisctl enterprise cluster update-ocsp --enabled true \\
--responder-url http://ocsp.example.com
# Configure OCSP timeouts
redisctl enterprise cluster update-ocsp --response-timeout 30 \\
--query-frequency 3600
# Disable OCSP
redisctl enterprise cluster update-ocsp --enabled false
# Using JSON for advanced configuration
redisctl enterprise cluster update-ocsp --data @ocsp.json"
)]
UpdateOcsp {
#[arg(long)]
enabled: Option<bool>,
#[arg(long)]
responder_url: Option<String>,
#[arg(long)]
response_timeout: Option<u32>,
#[arg(long)]
query_frequency: Option<u32>,
#[arg(long)]
recovery_frequency: Option<u32>,
#[arg(long)]
recovery_max_tries: Option<u32>,
#[arg(long, value_name = "FILE|JSON")]
data: Option<String>,
},
}
#[derive(Subcommand, Debug)]
pub enum EnterpriseDatabaseCommands {
List,
Get {
id: u32,
},
#[command(after_help = "EXAMPLES:
# Simple database - just name and size
redisctl enterprise database create --name mydb --memory 1073741824
# With replication for high availability
redisctl enterprise database create --name prod-db --memory 2147483648 --replication
# With persistence and eviction policy
redisctl enterprise database create --name cache-db --memory 536870912 \\
--persistence aof --eviction-policy volatile-lru
# With sharding for horizontal scaling
redisctl enterprise database create --name large-db --memory 10737418240 \\
--sharding --shards-count 4
# With specific port
redisctl enterprise database create --name service-db --memory 1073741824 --port 12000
# With modules (auto-resolves name to module)
redisctl enterprise database create --name search-db --memory 1073741824 \\
--module search --module ReJSON
# Complete configuration from file
redisctl enterprise database create --data @database.json
# Dry run to preview without creating
redisctl enterprise database create --name test-db --memory 1073741824 --dry-run
NOTE: Memory size is in bytes. Common values:
- 1 GB = 1073741824 bytes
- 2 GB = 2147483648 bytes
- 5 GB = 5368709120 bytes
First-class parameters override values in --data when both are provided.")]
Create {
#[arg(long)]
name: Option<String>,
#[arg(long)]
memory: Option<u64>,
#[arg(long)]
port: Option<u16>,
#[arg(long)]
replication: bool,
#[arg(long)]
persistence: Option<String>,
#[arg(long)]
eviction_policy: Option<String>,
#[arg(long)]
sharding: bool,
#[arg(long)]
shards_count: Option<u32>,
#[arg(long)]
proxy_policy: Option<String>,
#[arg(long)]
crdb: bool,
#[arg(long)]
redis_password: Option<String>,
#[arg(long = "module", value_name = "NAME[@VERSION][:ARGS]")]
modules: Vec<String>,
#[arg(long)]
data: Option<String>,
#[arg(long)]
dry_run: bool,
},
#[command(after_help = "EXAMPLES:
# Update memory size
redisctl enterprise database update 1 --memory 2147483648
# Enable replication
redisctl enterprise database update 1 --replication true
# Update persistence and eviction policy
redisctl enterprise database update 1 --persistence aof --eviction-policy volatile-lru
# Update sharding configuration
redisctl enterprise database update 1 --shards-count 8
# Update proxy policy
redisctl enterprise database update 1 --proxy-policy all-master-shards
# Update Redis password
redisctl enterprise database update 1 --redis-password newsecret
# Advanced: Full update via JSON file
redisctl enterprise database update 1 --data @updates.json
NOTE: First-class parameters override values in --data when both are provided.")]
Update {
id: u32,
#[arg(long)]
name: Option<String>,
#[arg(long)]
memory: Option<u64>,
#[arg(long)]
replication: Option<bool>,
#[arg(long)]
persistence: Option<String>,
#[arg(long)]
eviction_policy: Option<String>,
#[arg(long)]
shards_count: Option<u32>,
#[arg(long)]
proxy_policy: Option<String>,
#[arg(long)]
redis_password: Option<String>,
#[arg(long)]
data: Option<String>,
#[arg(long)]
dry_run: bool,
},
Delete {
id: u32,
#[arg(long)]
force: bool,
#[arg(long)]
dry_run: bool,
},
Watch {
id: u32,
#[arg(long, default_value = "5")]
poll_interval: u64,
},
#[command(after_help = "EXAMPLES:
# Export to S3
redisctl enterprise database export 1 --location s3://bucket/backup.rdb \\
--aws-access-key AKIAIOSFODNN7EXAMPLE --aws-secret-key wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
# Export to FTP
redisctl enterprise database export 1 --location ftp://user:pass@ftp.example.com/backup.rdb
# Export to SFTP
redisctl enterprise database export 1 --location sftp://user@sftp.example.com/backup.rdb
# Using JSON for advanced configuration
redisctl enterprise database export 1 --data @export.json")]
Export {
id: u32,
#[arg(long)]
location: Option<String>,
#[arg(long)]
aws_access_key: Option<String>,
#[arg(long)]
aws_secret_key: Option<String>,
#[arg(long)]
data: Option<String>,
},
#[command(after_help = "EXAMPLES:
# Import from S3
redisctl enterprise database import 1 --location s3://bucket/backup.rdb \\
--aws-access-key AKIAIOSFODNN7EXAMPLE --aws-secret-key wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
# Import from FTP with flush
redisctl enterprise database import 1 --location ftp://user:pass@ftp.example.com/backup.rdb --flush
# Import from HTTP/HTTPS
redisctl enterprise database import 1 --location https://example.com/backup.rdb
# Import and wait for completion
redisctl enterprise database import 1 --location https://example.com/backup.rdb --wait
# Using JSON for advanced configuration
redisctl enterprise database import 1 --data @import.json")]
Import {
id: u32,
#[arg(long)]
location: Option<String>,
#[arg(long)]
aws_access_key: Option<String>,
#[arg(long)]
aws_secret_key: Option<String>,
#[arg(long)]
flush: bool,
#[arg(long)]
data: Option<String>,
#[command(flatten)]
async_ops: crate::commands::cloud::async_utils::AsyncOperationArgs,
},
Backup {
id: u32,
#[command(flatten)]
async_ops: crate::commands::cloud::async_utils::AsyncOperationArgs,
},
#[command(after_help = "EXAMPLES:
# Restore from latest backup
redisctl enterprise database restore 1
# Restore from specific backup
redisctl enterprise database restore 1 --backup-uid backup-12345
# Using JSON for advanced configuration
redisctl enterprise database restore 1 --data @restore.json")]
Restore {
id: u32,
#[arg(long)]
backup_uid: Option<String>,
#[arg(long)]
data: Option<String>,
},
Flush {
id: u32,
#[arg(long)]
force: bool,
},
GetShards {
id: u32,
},
#[command(after_help = "EXAMPLES:
# Update shard count
redisctl enterprise database update-shards 1 --shards-count 4
# Update shards placement policy
redisctl enterprise database update-shards 1 --shards-placement sparse
# Using JSON for advanced configuration
redisctl enterprise database update-shards 1 --data @shards.json")]
UpdateShards {
id: u32,
#[arg(long)]
shards_count: Option<u32>,
#[arg(long)]
shards_placement: Option<String>,
#[arg(long)]
data: Option<String>,
},
GetModules {
id: u32,
},
#[command(after_help = "EXAMPLES:
# Add a module
redisctl enterprise database update-modules 1 --add-module search
# Add module with arguments
redisctl enterprise database update-modules 1 --add-module 'search:MAXSEARCHRESULTS 100'
# Remove a module
redisctl enterprise database update-modules 1 --remove-module ReJSON
# Using JSON for advanced configuration
redisctl enterprise database update-modules 1 --data @modules.json")]
UpdateModules {
id: u32,
#[arg(long = "add-module")]
add_modules: Vec<String>,
#[arg(long = "remove-module")]
remove_modules: Vec<String>,
#[arg(long)]
data: Option<String>,
},
Upgrade {
id: u32,
#[arg(long)]
version: Option<String>,
#[arg(long)]
preserve_roles: bool,
#[arg(long)]
force_restart: bool,
#[arg(long)]
may_discard_data: bool,
#[arg(long)]
force_discard: bool,
#[arg(long)]
keep_crdt_protocol_version: bool,
#[arg(long)]
parallel_shards_upgrade: Option<u32>,
#[arg(long)]
force: bool,
},
GetAcl {
id: u32,
},
#[command(after_help = "EXAMPLES:
# Set default user enabled
redisctl enterprise database update-acl 1 --default-user true
# Set ACL by UID
redisctl enterprise database update-acl 1 --acl-uid 5
# Using JSON for advanced configuration
redisctl enterprise database update-acl 1 --data @acl.json")]
UpdateAcl {
id: u32,
#[arg(long)]
acl_uid: Option<u32>,
#[arg(long)]
default_user: Option<bool>,
#[arg(long)]
data: Option<String>,
},
Stats {
id: u32,
},
Metrics {
id: u32,
#[arg(long)]
interval: Option<String>,
},
Slowlog {
id: u32,
#[arg(long)]
limit: Option<u32>,
},
ClientList {
id: u32,
},
}
#[derive(Subcommand, Debug)]
pub enum EnterpriseNodeCommands {
List,
Get {
id: u32,
},
#[command(after_help = "EXAMPLES:
# Add node with IP address
redisctl enterprise node add --address 192.168.1.100
# Add node with credentials
redisctl enterprise node add --address 192.168.1.100 \\
--username admin@example.com --password secret
# Using JSON for advanced configuration
redisctl enterprise node add --data @node.json")]
Add {
#[arg(long)]
address: Option<String>,
#[arg(long)]
username: Option<String>,
#[arg(long)]
password: Option<String>,
#[arg(long, value_name = "FILE|JSON")]
data: Option<String>,
},
Remove {
id: u32,
#[arg(long)]
force: bool,
},
#[command(after_help = "EXAMPLES:
# Update node to accept new shards
redisctl enterprise node update 1 --accept-servers true
# Set node's external address
redisctl enterprise node update 1 --external-addr 10.0.0.1
# Set rack ID for rack awareness
redisctl enterprise node update 1 --rack-id rack1
# Update multiple settings
redisctl enterprise node update 1 --accept-servers false --rack-id rack2
# Using JSON for advanced configuration
redisctl enterprise node update 1 --data '{\"max_redis_servers\": 200}'")]
Update {
id: u32,
#[arg(long)]
accept_servers: Option<bool>,
#[arg(long)]
external_addr: Option<Vec<String>>,
#[arg(long)]
rack_id: Option<String>,
#[arg(long, value_name = "FILE|JSON")]
data: Option<String>,
},
Status {
id: u32,
},
Stats {
id: u32,
},
Metrics {
id: u32,
#[arg(long)]
interval: Option<String>,
},
Check {
id: u32,
},
Alerts {
id: u32,
},
#[command(name = "maintenance-enable")]
MaintenanceEnable {
id: u32,
},
#[command(name = "maintenance-disable")]
MaintenanceDisable {
id: u32,
},
Rebalance {
id: u32,
},
Drain {
id: u32,
},
Restart {
id: u32,
#[arg(long)]
force: bool,
},
#[command(name = "get-config")]
GetConfig {
id: u32,
},
#[command(
name = "update-config",
after_help = "EXAMPLES:
# Set max Redis servers
redisctl enterprise node update-config 1 --max-redis-servers 200
# Set bigstore driver
redisctl enterprise node update-config 1 --bigstore-driver rocksdb
# Using JSON for advanced configuration
redisctl enterprise node update-config 1 --data @config.json"
)]
UpdateConfig {
id: u32,
#[arg(long)]
max_redis_servers: Option<u32>,
#[arg(long)]
bigstore_driver: Option<String>,
#[arg(long, value_name = "FILE|JSON")]
data: Option<String>,
},
#[command(name = "get-rack")]
GetRack {
id: u32,
},
#[command(name = "set-rack")]
SetRack {
id: u32,
#[arg(long)]
rack: String,
},
#[command(name = "get-role")]
GetRole {
id: u32,
},
Resources {
id: u32,
},
Memory {
id: u32,
},
Cpu {
id: u32,
},
Storage {
id: u32,
},
Network {
id: u32,
},
}
#[derive(Subcommand, Debug)]
pub enum EnterpriseUserCommands {
List,
Get {
id: u32,
},
#[command(after_help = "EXAMPLES:
# Create user with email and password
redisctl enterprise user create --email admin@example.com --password secret123 --role admin
# Create user with display name
redisctl enterprise user create --email user@example.com --password secret123 --role db_viewer --name \"John Doe\"
# Create user with email alerts enabled
redisctl enterprise user create --email ops@example.com --password secret123 --role db_member --email-alerts
# Create user with RBAC role IDs
redisctl enterprise user create --email rbac@example.com --password secret123 --role db_viewer --role-uid 1 --role-uid 2
# Advanced: Full configuration via JSON file
redisctl enterprise user create --data @user.json
NOTE: First-class parameters override values in --data when both are provided.")]
Create {
#[arg(long)]
email: Option<String>,
#[arg(long)]
password: Option<String>,
#[arg(long)]
role: Option<String>,
#[arg(long)]
name: Option<String>,
#[arg(long)]
email_alerts: bool,
#[arg(long = "role-uid")]
role_uids: Vec<u32>,
#[arg(long)]
auth_method: Option<String>,
#[arg(long)]
data: Option<String>,
},
#[command(after_help = "EXAMPLES:
# Update user's name
redisctl enterprise user update 1 --name \"Jane Doe\"
# Update user's role
redisctl enterprise user update 1 --role admin
# Update user's password
redisctl enterprise user update 1 --password newsecret123
# Enable email alerts
redisctl enterprise user update 1 --email-alerts true
# Update RBAC role assignments
redisctl enterprise user update 1 --role-uid 1 --role-uid 3
# Advanced: Full update via JSON file
redisctl enterprise user update 1 --data @updates.json
NOTE: First-class parameters override values in --data when both are provided.")]
Update {
id: u32,
#[arg(long)]
email: Option<String>,
#[arg(long)]
password: Option<String>,
#[arg(long)]
role: Option<String>,
#[arg(long)]
name: Option<String>,
#[arg(long)]
email_alerts: Option<bool>,
#[arg(long = "role-uid")]
role_uids: Vec<u32>,
#[arg(long)]
data: Option<String>,
},
Delete {
id: u32,
#[arg(long)]
force: bool,
},
#[command(name = "reset-password")]
ResetPassword {
id: u32,
#[arg(long)]
password: Option<String>,
},
#[command(name = "get-roles")]
GetRoles {
#[arg(name = "user-id")]
user_id: u32,
},
#[command(name = "assign-role")]
AssignRole {
#[arg(name = "user-id")]
user_id: u32,
#[arg(long)]
role: u32,
},
#[command(name = "remove-role")]
RemoveRole {
#[arg(name = "user-id")]
user_id: u32,
#[arg(long)]
role: u32,
},
}
#[derive(Subcommand, Debug)]
pub enum EnterpriseRoleCommands {
List,
Get {
id: u32,
},
#[command(after_help = "EXAMPLES:
# Create role with management permission
redisctl enterprise role create --name db-admin --management admin
# Create role with cluster viewer access
redisctl enterprise role create --name cluster-viewer --management cluster_viewer
# Create role with database-specific permissions
redisctl enterprise role create --name mydb-admin --management db_viewer --data '{\"bdb_roles\": [{\"bdb_uid\": 1, \"role\": \"admin\"}]}'
# Advanced: Full configuration via JSON file
redisctl enterprise role create --data @role.json
NOTE: First-class parameters override values in --data when both are provided.")]
Create {
#[arg(long)]
name: Option<String>,
#[arg(long)]
management: Option<String>,
#[arg(long)]
data: Option<String>,
},
#[command(after_help = "EXAMPLES:
# Update role name
redisctl enterprise role update 1 --name new-role-name
# Update management permission
redisctl enterprise role update 1 --management admin
# Advanced: Full update via JSON file
redisctl enterprise role update 1 --data @updates.json
NOTE: First-class parameters override values in --data when both are provided.")]
Update {
id: u32,
#[arg(long)]
name: Option<String>,
#[arg(long)]
management: Option<String>,
#[arg(long)]
data: Option<String>,
},
Delete {
id: u32,
#[arg(long)]
force: bool,
},
#[command(name = "get-permissions")]
GetPermissions {
id: u32,
},
#[command(name = "get-users")]
GetUsers {
#[arg(name = "role-id")]
role_id: u32,
},
}
#[derive(Subcommand, Debug)]
pub enum EnterpriseAclCommands {
List,
Get {
id: u32,
},
#[command(after_help = "EXAMPLES:
# Create ACL with full access
redisctl enterprise acl create --name full-access --acl '+@all ~*'
# Create ACL with read-only access
redisctl enterprise acl create --name read-only --acl '+@read ~*' --description 'Read-only access'
# Create ACL with specific key patterns
redisctl enterprise acl create --name app-acl --acl '+@all ~app:*'
# Advanced: Full configuration via JSON file
redisctl enterprise acl create --data @acl.json
NOTE: First-class parameters override values in --data when both are provided.")]
Create {
#[arg(long)]
name: Option<String>,
#[arg(long)]
acl: Option<String>,
#[arg(long)]
description: Option<String>,
#[arg(long)]
data: Option<String>,
},
#[command(after_help = "EXAMPLES:
# Update ACL name
redisctl enterprise acl update 1 --name new-acl-name
# Update ACL rules
redisctl enterprise acl update 1 --acl '+@read +@write ~*'
# Update description
redisctl enterprise acl update 1 --description 'Updated description'
# Advanced: Full update via JSON file
redisctl enterprise acl update 1 --data @updates.json
NOTE: First-class parameters override values in --data when both are provided.")]
Update {
id: u32,
#[arg(long)]
name: Option<String>,
#[arg(long)]
acl: Option<String>,
#[arg(long)]
description: Option<String>,
#[arg(long)]
data: Option<String>,
},
Delete {
id: u32,
#[arg(long)]
force: bool,
},
Test {
#[arg(long)]
user: u32,
#[arg(long)]
command: String,
},
}
#[derive(Subcommand, Debug)]
pub enum EnterpriseLdapCommands {
#[command(name = "get-config")]
GetConfig,
#[command(
name = "update-config",
after_help = "EXAMPLES:
# Enable LDAP with server URL
redisctl enterprise rbac ldap update-config --enabled true --server-url ldap://ldap.example.com
# Using JSON for full configuration
redisctl enterprise rbac ldap update-config --data @ldap.json"
)]
UpdateConfig {
#[arg(long)]
enabled: Option<bool>,
#[arg(long)]
server_url: Option<String>,
#[arg(long)]
bind_dn: Option<String>,
#[arg(long)]
bind_password: Option<String>,
#[arg(long)]
base_dn: Option<String>,
#[arg(long)]
user_filter: Option<String>,
#[arg(long, value_name = "FILE|JSON")]
data: Option<String>,
},
#[command(name = "test-connection")]
TestConnection,
Sync,
#[command(name = "get-mappings")]
GetMappings,
}
#[derive(Subcommand, Debug)]
pub enum EnterpriseAuthCommands {
Test {
#[arg(long)]
user: String,
},
#[command(name = "session-list")]
SessionList,
#[command(name = "session-revoke")]
SessionRevoke {
#[arg(name = "session-id")]
session_id: String,
},
#[command(name = "session-revoke-all")]
SessionRevokeAll {
#[arg(long)]
user: u32,
},
}
#[derive(Subcommand, Debug)]
pub enum EnterpriseCrdbCommands {
List,
Get {
id: u32,
},
#[command(after_help = "EXAMPLES:
# Create CRDB with name and memory
redisctl enterprise crdb create --name my-crdb --memory-size 1073741824
# Create CRDB with default database name
redisctl enterprise crdb create --name my-crdb --default-db-name mydb
# Using JSON for advanced configuration
redisctl enterprise crdb create --data @crdb.json")]
Create {
#[arg(long)]
name: Option<String>,
#[arg(long)]
memory_size: Option<u64>,
#[arg(long)]
default_db_name: Option<String>,
#[arg(long)]
encryption: Option<bool>,
#[arg(long)]
data: Option<String>,
},
#[command(after_help = "EXAMPLES:
# Update memory size (1GB)
redisctl enterprise crdb update 1 --memory-size 1073741824
# Enable encryption
redisctl enterprise crdb update 1 --encryption true
# Set data persistence policy
redisctl enterprise crdb update 1 --data-persistence aof
# Update multiple settings
redisctl enterprise crdb update 1 --memory-size 2147483648 --replication true
# Using JSON for advanced configuration
redisctl enterprise crdb update 1 --data '{\"causal_consistency\": true}'")]
Update {
id: u32,
#[arg(long)]
memory_size: Option<u64>,
#[arg(long)]
encryption: Option<bool>,
#[arg(long)]
data_persistence: Option<String>,
#[arg(long)]
replication: Option<bool>,
#[arg(long)]
eviction_policy: Option<String>,
#[arg(long)]
data: Option<String>,
},
Delete {
id: u32,
#[arg(long)]
force: bool,
},
#[command(name = "get-clusters")]
GetClusters {
id: u32,
},
#[command(
name = "add-cluster",
after_help = "EXAMPLES:
# Add cluster with URL
redisctl enterprise crdb add-cluster 1 --url https://cluster2.example.com:9443
# Add cluster with credentials
redisctl enterprise crdb add-cluster 1 --url https://cluster2.example.com:9443 \\
--username admin@example.com --password mypassword
# Using JSON for full configuration
redisctl enterprise crdb add-cluster 1 --data @cluster.json"
)]
AddCluster {
id: u32,
#[arg(long)]
url: Option<String>,
#[arg(long)]
name: Option<String>,
#[arg(long)]
username: Option<String>,
#[arg(long)]
password: Option<String>,
#[arg(long)]
compression: Option<bool>,
#[arg(long, value_name = "FILE|JSON")]
data: Option<String>,
},
#[command(name = "remove-cluster")]
RemoveCluster {
id: u32,
#[arg(long)]
cluster: u32,
},
#[command(
name = "update-cluster",
after_help = "EXAMPLES:
# Update cluster URL
redisctl enterprise crdb update-cluster 1 --cluster 2 --url https://newurl.example.com:9443
# Enable compression
redisctl enterprise crdb update-cluster 1 --cluster 2 --compression true
# Using JSON for full configuration
redisctl enterprise crdb update-cluster 1 --cluster 2 --data @update.json"
)]
UpdateCluster {
id: u32,
#[arg(long)]
cluster: u32,
#[arg(long)]
url: Option<String>,
#[arg(long)]
compression: Option<bool>,
#[arg(long)]
proxy_policy: Option<String>,
#[arg(long, value_name = "FILE|JSON")]
data: Option<String>,
},
#[command(name = "get-instances")]
GetInstances {
id: u32,
},
#[command(name = "get-instance")]
GetInstance {
#[arg(name = "crdb-id")]
crdb_id: u32,
#[arg(long)]
instance: u32,
},
#[command(
name = "update-instance",
after_help = "EXAMPLES:
# Update instance memory size
redisctl enterprise crdb update-instance 1 --instance 2 --memory-size 2147483648
# Update instance port
redisctl enterprise crdb update-instance 1 --instance 2 --port 12001
# Using JSON for full configuration
redisctl enterprise crdb update-instance 1 --instance 2 --data @instance.json"
)]
UpdateInstance {
#[arg(name = "crdb-id")]
crdb_id: u32,
#[arg(long)]
instance: u32,
#[arg(long)]
memory_size: Option<u64>,
#[arg(long)]
port: Option<u16>,
#[arg(long)]
enabled: Option<bool>,
#[arg(long, value_name = "FILE|JSON")]
data: Option<String>,
},
#[command(name = "flush-instance")]
FlushInstance {
#[arg(name = "crdb-id")]
crdb_id: u32,
#[arg(long)]
instance: u32,
#[arg(long)]
force: bool,
},
#[command(name = "get-replication-status")]
GetReplicationStatus {
id: u32,
},
#[command(name = "get-lag")]
GetLag {
id: u32,
},
#[command(name = "force-sync")]
ForceSync {
id: u32,
#[arg(long)]
source: u32,
},
#[command(name = "pause-replication")]
PauseReplication {
id: u32,
},
#[command(name = "resume-replication")]
ResumeReplication {
id: u32,
},
#[command(name = "get-conflicts")]
GetConflicts {
id: u32,
#[arg(long)]
limit: Option<u32>,
},
#[command(name = "get-conflict-policy")]
GetConflictPolicy {
id: u32,
},
#[command(
name = "update-conflict-policy",
after_help = "EXAMPLES:
# Set conflict policy to last-write-wins
redisctl enterprise crdb update-conflict-policy 1 --policy last-write-wins
# Set policy with source preference
redisctl enterprise crdb update-conflict-policy 1 --policy source-wins --source-id 2
# Using JSON for full configuration
redisctl enterprise crdb update-conflict-policy 1 --data @policy.json"
)]
UpdateConflictPolicy {
id: u32,
#[arg(long)]
policy: Option<String>,
#[arg(long)]
source_id: Option<u32>,
#[arg(long, value_name = "FILE|JSON")]
data: Option<String>,
},
#[command(name = "resolve-conflict")]
ResolveConflict {
id: u32,
#[arg(long)]
conflict: String,
#[arg(long)]
resolution: String,
},
#[command(name = "get-tasks")]
GetTasks {
id: u32,
},
#[command(name = "get-task")]
GetTask {
#[arg(name = "crdb-id")]
crdb_id: u32,
#[arg(long)]
task: String,
},
#[command(name = "retry-task")]
RetryTask {
#[arg(name = "crdb-id")]
crdb_id: u32,
#[arg(long)]
task: String,
},
#[command(name = "cancel-task")]
CancelTask {
#[arg(name = "crdb-id")]
crdb_id: u32,
#[arg(long)]
task: String,
},
Stats {
id: u32,
},
Metrics {
id: u32,
#[arg(long)]
interval: Option<String>,
},
#[command(name = "get-connections")]
GetConnections {
id: u32,
},
#[command(name = "get-throughput")]
GetThroughput {
id: u32,
},
#[command(name = "health-check")]
HealthCheck {
id: u32,
},
#[command(after_help = "EXAMPLES:
# Backup to S3
redisctl enterprise crdb backup 1 --location s3://bucket/crdb-backup
# Using JSON for advanced configuration
redisctl enterprise crdb backup 1 --data @backup.json")]
Backup {
id: u32,
#[arg(long)]
location: Option<String>,
#[arg(long)]
data: Option<String>,
},
#[command(after_help = "EXAMPLES:
# Restore from specific backup
redisctl enterprise crdb restore 1 --backup-uid backup-12345
# Restore from location
redisctl enterprise crdb restore 1 --location s3://bucket/crdb-backup
# Using JSON for advanced configuration
redisctl enterprise crdb restore 1 --data @restore.json")]
Restore {
id: u32,
#[arg(long)]
backup_uid: Option<String>,
#[arg(long)]
location: Option<String>,
#[arg(long)]
data: Option<String>,
},
#[command(name = "get-backups")]
GetBackups {
id: u32,
},
#[command(after_help = "EXAMPLES:
# Export to S3
redisctl enterprise crdb export 1 --location s3://bucket/crdb-export
# Using JSON for advanced configuration
redisctl enterprise crdb export 1 --data @export.json")]
Export {
id: u32,
#[arg(long)]
location: Option<String>,
#[arg(long)]
data: Option<String>,
},
}
#[derive(Subcommand, Debug, Clone)]
pub enum EnterpriseStatsCommands {
Database {
id: u32,
#[arg(long, short = 'f')]
follow: bool,
#[arg(long, default_value = "5")]
poll_interval: u64,
},
DatabaseShards {
id: u32,
},
DatabaseMetrics {
id: u32,
#[arg(long, default_value = "1h")]
interval: String,
},
Node {
id: u32,
#[arg(long, short = 'f')]
follow: bool,
#[arg(long, default_value = "5")]
poll_interval: u64,
},
NodeMetrics {
id: u32,
#[arg(long, default_value = "1h")]
interval: String,
},
Cluster {
#[arg(long, short = 'f')]
follow: bool,
#[arg(long, default_value = "5")]
poll_interval: u64,
},
ClusterMetrics {
#[arg(long, default_value = "1h")]
interval: String,
},
Listener,
Export {
#[arg(long, default_value = "json")]
format: String,
#[arg(long)]
interval: Option<String>,
},
}