Skip to content

Commit c4ad7c0

Browse files
committed
docs: add support package optimization and upload documentation
Add comprehensive documentation for new support package features: - Package optimization with --optimize flag (20-30% size reduction) - Direct upload to Files.com with --upload flag - Secure API key management with files-key commands - Update README with support package quick start - Add writing style guidelines to CLAUDE.md to prevent emojis and marketing language
1 parent 5a8a1a5 commit c4ad7c0

File tree

3 files changed

+217
-0
lines changed

3 files changed

+217
-0
lines changed

CLAUDE.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,45 @@ redisctl/
2424
└── docs/ # mdBook documentation
2525
```
2626

27+
## Writing Style for Documentation and PRs
28+
29+
**CRITICAL**: Follow these strict guidelines for all documentation, commit messages, and PR descriptions:
30+
31+
### What to AVOID
32+
-**No emojis** - Never use emojis in commits, PRs, or code (✅ ❌ 🚀 etc.)
33+
-**No marketing language** - Avoid "exciting", "powerful", "seamless", "game-changing", etc.
34+
-**No superlatives** - Don't use "best", "perfect", "amazing", "incredible"
35+
-**No hype** - Write factual, technical descriptions only
36+
-**No exclamation points** - Use periods for professional tone
37+
38+
### What to DO
39+
- ✓ Use **technical, factual language**
40+
- ✓ Focus on **what changed and why**
41+
- ✓ Be **specific and concrete**
42+
- ✓ Use **imperative mood for commits** (e.g., "Add feature" not "Added feature")
43+
- ✓ Reference **issue numbers** where applicable
44+
45+
### Examples
46+
47+
**Bad**:
48+
```
49+
🚀 feat: Add amazing support package upload feature!
50+
51+
This exciting new feature seamlessly integrates with Files.com to provide
52+
a powerful solution for uploading support packages! ✨
53+
```
54+
55+
**Good**:
56+
```
57+
feat: add support package upload with Files.com integration
58+
59+
Implements support package upload to Files.com via files-sdk 0.3.1.
60+
Adds --upload and --no-save flags to support-package commands.
61+
Supports environment variable and secure keyring storage for API keys.
62+
63+
Closes #123
64+
```
65+
2766
## Build and Development Commands
2867

2968
### Essential Commands

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ A unified command-line interface for managing Redis Cloud and Redis Enterprise d
1010
## Features
1111

1212
- **Unified Interface** - Single CLI for both Redis Cloud and Redis Enterprise
13+
- **Support Package Management** - Generate, optimize, and upload diagnostic packages to Redis Support
1314
- **Async Operations** - Full support for long-running operations with `--wait` flags
1415
- **Explicit Commands** - Clear separation between Cloud and Enterprise operations
1516
- **Multiple Output Formats** - JSON, YAML, and Table output with JMESPath filtering
@@ -142,6 +143,34 @@ redisctl cloud database list -o json | jq # JSON with jq
142143
redisctl cloud database create --data @database.json --wait
143144
```
144145

146+
### 3. Generate and Upload Support Packages
147+
148+
Generate diagnostic support packages for Redis Enterprise clusters and optionally upload them directly to Redis Support:
149+
150+
```bash
151+
# Generate cluster support package
152+
redisctl enterprise support-package cluster
153+
154+
# Generate optimized package (reduces size by ~20-30%)
155+
redisctl enterprise support-package cluster --optimize
156+
157+
# Generate and upload to Redis Support (Files.com)
158+
export REDIS_ENTERPRISE_FILES_API_KEY="your-files-api-key"
159+
redisctl enterprise support-package cluster --upload
160+
161+
# Upload without saving locally
162+
redisctl enterprise support-package cluster --upload --no-save
163+
164+
# Optimize and upload in one command
165+
redisctl enterprise support-package cluster --optimize --upload --no-save
166+
167+
# Database-specific support package
168+
redisctl enterprise support-package database 1 --optimize --upload
169+
170+
# Store Files.com API key securely (requires secure-storage feature)
171+
redisctl files-key set "$REDIS_ENTERPRISE_FILES_API_KEY" --use-keyring
172+
```
173+
145174
## Using with Docker
146175

147176
```bash

docs/src/enterprise/operations/support-package.md

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,22 @@ redisctl enterprise support-package cluster --skip-checks
3131

3232
# Use new API endpoints (Redis Enterprise 7.4+)
3333
redisctl enterprise support-package cluster --use-new-api
34+
35+
# Optimize package size (reduces by ~20-30%)
36+
redisctl enterprise support-package cluster --optimize
37+
38+
# Show optimization details
39+
redisctl enterprise support-package cluster --optimize --optimize-verbose
40+
41+
# Upload directly to Redis Support (Files.com)
42+
export REDIS_ENTERPRISE_FILES_API_KEY="your-api-key"
43+
redisctl enterprise support-package cluster --upload
44+
45+
# Upload without saving locally
46+
redisctl enterprise support-package cluster --upload --no-save
47+
48+
# Optimize and upload in one command
49+
redisctl enterprise support-package cluster --optimize --upload --no-save
3450
```
3551

3652
**Example Output**:
@@ -132,6 +148,139 @@ Next steps:
132148
3. Delete local file after upload to free space
133149
```
134150

151+
## Package Optimization
152+
153+
Support packages can be large (500MB-2GB+). The `--optimize` flag reduces package size by 20-30% through:
154+
155+
- **Log truncation**: Keeps most recent 1000 lines per log file (configurable)
156+
- **Redundant data removal**: Removes duplicate or unnecessary files
157+
- **Nested archive cleanup**: Removes nested .gz files
158+
159+
### Basic Optimization
160+
161+
```bash
162+
# Optimize with defaults
163+
redisctl enterprise support-package cluster --optimize
164+
165+
# Customize log retention
166+
redisctl enterprise support-package cluster --optimize --log-lines 5000
167+
168+
# Show detailed optimization stats
169+
redisctl enterprise support-package cluster --optimize --optimize-verbose
170+
```
171+
172+
### Optimization Output
173+
174+
```
175+
Optimization: 487.3 MB → 358.2 MB (26.5% reduction)
176+
177+
Files processed: 847
178+
Files truncated: 142
179+
Files removed: 23
180+
```
181+
182+
### When to Use Optimization
183+
184+
**Use optimization when:**
185+
- Package size exceeds upload limits
186+
- Network bandwidth is limited
187+
- Storage space is constrained
188+
- Only recent log data is needed
189+
190+
**Skip optimization when:**
191+
- Full historical logs are needed for issue diagnosis
192+
- Investigating intermittent issues from the past
193+
- Redis Support specifically requests unoptimized packages
194+
195+
## Direct Upload to Redis Support
196+
197+
Upload support packages directly to Files.com for Redis Support tickets, eliminating manual upload steps.
198+
199+
### Setup Files.com API Key
200+
201+
Get your Files.com API key from Redis Support, then configure it:
202+
203+
```bash
204+
# Option 1: Environment variable (recommended for CI/CD)
205+
export REDIS_ENTERPRISE_FILES_API_KEY="your-api-key"
206+
207+
# Option 2: Secure keyring storage (requires secure-storage feature)
208+
redisctl files-key set "$REDIS_ENTERPRISE_FILES_API_KEY" --use-keyring
209+
210+
# Option 3: Global config file (plaintext)
211+
redisctl files-key set "$REDIS_ENTERPRISE_FILES_API_KEY" --global
212+
213+
# Option 4: Per-profile config
214+
redisctl files-key set "$REDIS_ENTERPRISE_FILES_API_KEY" --profile enterprise-prod
215+
```
216+
217+
### Upload Commands
218+
219+
```bash
220+
# Generate and upload
221+
redisctl enterprise support-package cluster --upload
222+
223+
# Upload without local copy (saves disk space)
224+
redisctl enterprise support-package cluster --upload --no-save
225+
226+
# Optimize before upload (recommended)
227+
redisctl enterprise support-package cluster --optimize --upload --no-save
228+
229+
# Database-specific package
230+
redisctl enterprise support-package database 1 --optimize --upload
231+
```
232+
233+
### Upload Output
234+
235+
```
236+
Generating support package...
237+
Uploading to Files.com: /RLEC_Customers/Uploads/support-package-cluster-20240115T143000.tar.gz
238+
Size: 358234567 bytes
239+
240+
✓ Support package created successfully
241+
Uploaded to: RLEC_Customers/Uploads/support-package-cluster-20240115T143000.tar.gz
242+
Size: 341.7 MB
243+
Time: 124s
244+
```
245+
246+
### API Key Priority
247+
248+
The Files.com API key is resolved in this order:
249+
250+
1. `REDIS_ENTERPRISE_FILES_API_KEY` environment variable
251+
2. Profile-specific `files_api_key` in config
252+
3. Global `files_api_key` in config
253+
4. System keyring (if secure-storage feature enabled)
254+
5. `REDIS_FILES_API_KEY` environment variable (fallback)
255+
256+
### Secure API Key Storage
257+
258+
With the `secure-storage` feature, API keys are stored in your OS keyring:
259+
260+
- **macOS**: Keychain
261+
- **Windows**: Credential Manager
262+
- **Linux**: Secret Service (GNOME Keyring, KWallet)
263+
264+
```bash
265+
# Install with secure storage
266+
cargo install redisctl --features secure-storage
267+
268+
# Store key securely
269+
redisctl files-key set "$REDIS_ENTERPRISE_FILES_API_KEY" --use-keyring
270+
271+
# Verify storage
272+
redisctl files-key get
273+
# Output: Key found in keyring: your-ke...key4
274+
275+
# Remove when no longer needed
276+
redisctl files-key remove --keyring
277+
```
278+
279+
The config file only stores a reference:
280+
```toml
281+
files_api_key = "keyring:files-api-key"
282+
```
283+
135284
## Pre-flight Checks
136285

137286
The command automatically performs safety checks before generating packages:

0 commit comments

Comments
 (0)