Skip to content

Commit 6f79b0e

Browse files
fix: upgrade indicatif and add comprehensive documentation (#476)
* fix: upgrade indicatif to 0.18 to resolve RUSTSEC-2025-0119 Upgrade indicatif from 0.17 to 0.18 which replaces the unmaintained number_prefix crate with unit-prefix, resolving the security advisory. * docs: add comprehensive documentation for all command groups - Cloud: ACL, users, provider accounts, tasks - Enterprise: users, CRDB, databases, modules, nodes, logs, stats - Plus 44 additional doc files with command references and examples
1 parent c0bb8ef commit 6f79b0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+12848
-0
lines changed

docs/src/api-reference/api.md

Lines changed: 529 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# ACL Management
2+
3+
Redis Cloud Access Control Lists (ACLs) provide fine-grained control over database access. redisctl supports managing Redis rules, roles, and ACL users.
4+
5+
## Commands Overview
6+
7+
```bash
8+
redisctl cloud acl --help
9+
```
10+
11+
### Redis Rules
12+
13+
Redis rules define what Redis commands and keys a user can access.
14+
15+
```bash
16+
# List all Redis ACL rules
17+
redisctl cloud acl list-redis-rules <subscription_id>
18+
19+
# Create a new Redis ACL rule
20+
redisctl cloud acl create-redis-rule <subscription_id> --data '{"name": "read-only", "redisRules": ["+@read", "-@write"]}'
21+
22+
# Update an existing rule
23+
redisctl cloud acl update-redis-rule <subscription_id> <rule_id> --data '{"redisRules": ["+@read", "+@hash"]}'
24+
25+
# Delete a rule
26+
redisctl cloud acl delete-redis-rule <subscription_id> <rule_id>
27+
```
28+
29+
### Roles
30+
31+
Roles group Redis rules and database associations together.
32+
33+
```bash
34+
# List all ACL roles
35+
redisctl cloud acl list-roles <subscription_id>
36+
37+
# Create a new role
38+
redisctl cloud acl create-role <subscription_id> --data '{"name": "app-reader", "redisRules": [{"ruleId": 123}]}'
39+
40+
# Update a role
41+
redisctl cloud acl update-role <subscription_id> <role_id> --data '{"name": "app-reader-v2"}'
42+
43+
# Delete a role
44+
redisctl cloud acl delete-role <subscription_id> <role_id>
45+
```
46+
47+
### ACL Users
48+
49+
ACL users are the actual accounts that connect to databases with specific permissions.
50+
51+
```bash
52+
# List all ACL users
53+
redisctl cloud acl list-acl-users <subscription_id>
54+
55+
# Get user details
56+
redisctl cloud acl get-acl-user <subscription_id> <user_id>
57+
58+
# Create a new ACL user
59+
redisctl cloud acl create-acl-user <subscription_id> --data '{"name": "app-user", "password": "secure-password", "roles": [{"roleId": 456}]}'
60+
61+
# Update an ACL user
62+
redisctl cloud acl update-acl-user <subscription_id> <user_id> --data '{"password": "new-password"}'
63+
64+
# Delete an ACL user
65+
redisctl cloud acl delete-acl-user <subscription_id> <user_id>
66+
```
67+
68+
## JSON Output
69+
70+
All commands support `-o json` for structured output:
71+
72+
```bash
73+
redisctl cloud acl list-roles 12345 -o json | jq '.[] | {name, id}'
74+
```
75+
76+
## Common Patterns
77+
78+
### Create a Read-Only User
79+
80+
```bash
81+
# 1. Create a read-only rule
82+
redisctl cloud acl create-redis-rule 12345 --data '{
83+
"name": "readonly-rule",
84+
"redisRules": ["+@read", "-@write", "-@admin", "-@dangerous"]
85+
}'
86+
87+
# 2. Create a role using that rule
88+
redisctl cloud acl create-role 12345 --data '{
89+
"name": "readonly-role",
90+
"redisRules": [{"ruleId": <rule_id>}]
91+
}'
92+
93+
# 3. Create a user with that role
94+
redisctl cloud acl create-acl-user 12345 --data '{
95+
"name": "readonly-user",
96+
"password": "secure-password",
97+
"roles": [{"roleId": <role_id>}]
98+
}'
99+
```
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# User Management
2+
3+
Manage Redis Cloud account users who can access the Redis Cloud console and API.
4+
5+
> **Note**: These are Redis Cloud *account* users (console/API access), not database ACL users. For database-level access control, see [ACL Management](acl.md).
6+
7+
## Commands Overview
8+
9+
```bash
10+
redisctl cloud user --help
11+
```
12+
13+
## List Users
14+
15+
```bash
16+
# List all users in your account
17+
redisctl cloud user list
18+
19+
# Output as JSON
20+
redisctl cloud user list -o json
21+
```
22+
23+
## Get User Details
24+
25+
```bash
26+
# Get details for a specific user
27+
redisctl cloud user get <user_id>
28+
29+
# Get specific fields with JMESPath
30+
redisctl cloud user get <user_id> -q '{name: name, email: email, role: role}'
31+
```
32+
33+
## Update User
34+
35+
```bash
36+
# Update user information
37+
redisctl cloud user update <user_id> --data '{"name": "New Name"}'
38+
```
39+
40+
## Delete User
41+
42+
```bash
43+
# Delete a user from the account
44+
redisctl cloud user delete <user_id>
45+
```
46+
47+
## JSON Output
48+
49+
All commands support structured output for scripting:
50+
51+
```bash
52+
# List all user emails
53+
redisctl cloud user list -o json | jq '.[].email'
54+
55+
# Find admin users
56+
redisctl cloud user list -o json | jq '.[] | select(.role == "owner")'
57+
```
58+
59+
## User Roles
60+
61+
Redis Cloud account users have roles that determine their permissions:
62+
63+
- **owner**: Full access to all account features
64+
- **member**: Access to assigned resources
65+
- **viewer**: Read-only access
66+
67+
For managing database-level permissions (what Redis commands users can run), use the [ACL commands](acl.md) instead.

docs/src/cloud/commands.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Redis Cloud Commands
2+
3+
Redis Cloud commands are organized into three layers:
4+
5+
## 1. Human-Friendly Commands
6+
7+
High-level commands with typed parameters and structured output.
8+
9+
```bash
10+
redisctl cloud <resource> <action> [options]
11+
```
12+
13+
See [Human-Friendly Commands](./human-commands.md) for the complete reference.
14+
15+
## 2. Raw API Access
16+
17+
Direct access to any REST endpoint when you need full control.
18+
19+
```bash
20+
redisctl api cloud <method> <path> [options]
21+
```
22+
23+
See [Raw API Access](./api-access.md) for details.
24+
25+
## 3. Workflows (Coming Soon)
26+
27+
Multi-step orchestrated operations for complex tasks:
28+
- Database migration workflows
29+
- Backup and restore procedures
30+
- Cluster setup automation
31+
32+
## Quick Reference
33+
34+
### Most Common Commands
35+
36+
```bash
37+
# Subscriptions
38+
redisctl cloud subscription list
39+
redisctl cloud subscription get <id>
40+
41+
# Databases
42+
redisctl cloud database list --subscription-id <id>
43+
redisctl cloud database get --subscription-id <id> --database-id <id>
44+
45+
# Direct API
46+
redisctl api cloud get /subscriptions
47+
redisctl api cloud post /subscriptions/<id>/databases --data @database.json
48+
```

0 commit comments

Comments
 (0)