Skip to content

Commit ca8486b

Browse files
Merge pull request #88 from redis-field-engineering/feat/phase-2-enhance-commands
feat: Phase 2 - Add critical Cloud API commands
2 parents beff114 + 8c54aa4 commit ca8486b

File tree

5 files changed

+1880
-37
lines changed

5 files changed

+1880
-37
lines changed

PHASE_2_AUDIT.md

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
# Phase 2: Command Coverage Audit
2+
3+
## Redis Cloud API Coverage
4+
5+
| API Category | API Method | Current CLI Command | Status | Notes |
6+
|--------------|------------|-------------------|---------|--------|
7+
| **Subscriptions** | | | | |
8+
| | list() |`cloud subscription list` | ✅ Implemented | |
9+
| | get() |`cloud subscription show` | ✅ Implemented | |
10+
| | create() | ⚠️ `cloud subscription create` | ⚠️ Basic | Needs more options |
11+
| | update() | ⚠️ `cloud subscription update` | ⚠️ Basic | Only name |
12+
| | delete() |`cloud subscription delete` | ❌ Not implemented | |
13+
| | databases() || ❌ Missing | Should list databases in subscription |
14+
| | pricing() || ❌ Missing | |
15+
| | payment_methods() || ❌ Missing | |
16+
| | cloud_accounts() || ❌ Missing | |
17+
| | get_cidr_whitelist() || ❌ Missing | |
18+
| | update_cidr_whitelist() || ❌ Missing | |
19+
| | get_vpc_peerings() || ❌ Missing | |
20+
| **Databases** | | | | |
21+
| | list() |`cloud database list` | ✅ Implemented | Lists across all subscriptions |
22+
| | show() |`cloud database show` | ✅ Implemented | |
23+
| | create() | ⚠️ `cloud database create` | ⚠️ Redirect | Redirects to subscription context |
24+
| | update() | ⚠️ `cloud database update` | ⚠️ Basic | Only name/memory |
25+
| | delete() | ⚠️ `cloud database delete` | ⚠️ Basic | No --force flag |
26+
| | backup() || ❌ Not implemented | |
27+
| | import() || ❌ Not implemented | |
28+
| **Accounts** | | | | |
29+
| | list() |`cloud account list` | ✅ Implemented | |
30+
| | show() |`cloud account show` | ✅ Implemented | |
31+
| | info() || ❌ Missing | Different from show |
32+
| | owner() || ❌ Missing | |
33+
| | users() || ❌ Missing | |
34+
| | payment_methods() || ❌ Missing | |
35+
| **Users** | | | | |
36+
| | list() |`cloud user list` | ✅ Implemented | |
37+
| | show() |`cloud user show` | ✅ Implemented | |
38+
| | create() |`cloud user create` | ❌ Not implemented | Shows "not yet implemented" |
39+
| | update() |`cloud user update` | ❌ Not implemented | Shows "not yet implemented" |
40+
| | delete() |`cloud user delete` | ❌ Not implemented | Shows "not yet implemented" |
41+
| **Regions** | | | | |
42+
| | list() |`cloud region list` | ✅ Implemented | |
43+
| **Tasks** | | | | |
44+
| | list() |`cloud task list` | ✅ Implemented | |
45+
| | show() |`cloud task show` | ✅ Implemented | |
46+
| | wait() || ❌ Missing | Should add --wait flag |
47+
| **ACLs** | | | | |
48+
| | list() |`cloud acl` | ❌ Not implemented | Shows "not yet implemented" |
49+
| | get() || ❌ Missing | |
50+
| | create() || ❌ Missing | |
51+
| | update() || ❌ Missing | |
52+
| | delete() || ❌ Missing | |
53+
| | list_users() || ❌ Missing | |
54+
| | list_roles() || ❌ Missing | |
55+
| | list_redis_rules() || ❌ Missing | |
56+
| **Peering** | | | | |
57+
| | list() || ❌ Missing | No peering command at all |
58+
| | create() || ❌ Missing | |
59+
| | get() || ❌ Missing | |
60+
| | delete() || ❌ Missing | |
61+
| **Transit Gateway** | | | | |
62+
| | list() || ❌ Missing | No transit-gateway command |
63+
| | get_attachment() || ❌ Missing | |
64+
| | create_attachment() || ❌ Missing | |
65+
| | delete_attachment() || ❌ Missing | |
66+
| | list_invitations() || ❌ Missing | |
67+
| | accept_invitation() || ❌ Missing | |
68+
| | reject_invitation() || ❌ Missing | |
69+
| **Cloud Accounts** | | | | |
70+
| | list() || ❌ Missing | Different from Account |
71+
| | get() || ❌ Missing | |
72+
| | create() || ❌ Missing | |
73+
| | update() || ❌ Missing | |
74+
| | delete() || ❌ Missing | |
75+
| **Backups** | | | | |
76+
| | list() || ❌ Missing | No backup command |
77+
| | create() || ❌ Missing | |
78+
| | get() || ❌ Missing | |
79+
| | restore() || ❌ Missing | |
80+
| | delete() || ❌ Missing | |
81+
| **Fixed Plans** | | | | |
82+
| | list() || ❌ Missing | No fixed command |
83+
| | get() || ❌ Missing | |
84+
| | plans() || ❌ Missing | |
85+
| **Flexible Plans** | | | | |
86+
| | list() || ❌ Missing | No flexible command |
87+
| | get() || ❌ Missing | |
88+
| | create() || ❌ Missing | |
89+
| | update() || ❌ Missing | |
90+
| | delete() || ❌ Missing | |
91+
| **CRDB** | | | | |
92+
| | list() || ❌ Missing | No crdb command |
93+
| | get() || ❌ Missing | |
94+
| | create() || ❌ Missing | |
95+
| | update() || ❌ Missing | |
96+
| | delete() || ❌ Missing | |
97+
| | get_regions() || ❌ Missing | |
98+
| | add_region() || ❌ Missing | |
99+
| | remove_region() || ❌ Missing | |
100+
| **API Keys** | | | | |
101+
| | list() || ❌ Missing | No api-key command |
102+
| | get() || ❌ Missing | |
103+
| | create() || ❌ Missing | |
104+
| | update() || ❌ Missing | |
105+
| | delete() || ❌ Missing | |
106+
| | regenerate() || ❌ Missing | |
107+
| | enable() || ❌ Missing | |
108+
| | disable() || ❌ Missing | |
109+
| **Metrics** | | | | |
110+
| | database() || ❌ Missing | No metrics command |
111+
| | subscription() || ❌ Missing | |
112+
| **Logs** | | | | |
113+
| | database() || ❌ Missing | No logs command |
114+
| | system() || ❌ Missing | |
115+
| | session() || ❌ Missing | |
116+
| **Private Service Connect** | | | | |
117+
| | list() || ❌ Missing | No psc command |
118+
| | get() || ❌ Missing | |
119+
| | create() || ❌ Missing | |
120+
| | update() || ❌ Missing | |
121+
| | delete() || ❌ Missing | |
122+
123+
## Redis Enterprise API Coverage
124+
125+
| API Category | API Method | Current CLI Command | Status | Notes |
126+
|--------------|------------|-------------------|---------|--------|
127+
| **Clusters** | | | | |
128+
| | info() |`enterprise cluster info` | ✅ Implemented | |
129+
| | nodes() |`enterprise cluster nodes` | ✅ Implemented | |
130+
| | settings() |`enterprise cluster settings` | ✅ Implemented | |
131+
| | update() |`enterprise cluster update` | ✅ Implemented | |
132+
| **Databases** | | | | |
133+
| | list() |`enterprise database list` | ✅ Implemented | |
134+
| | show() |`enterprise database show` | ✅ Implemented | |
135+
| | create() | ⚠️ `enterprise database create` | ⚠️ Basic | Needs more options |
136+
| | update() | ⚠️ `enterprise database update` | ⚠️ Basic | Only name/memory |
137+
| | delete() | ⚠️ `enterprise database delete` | ⚠️ Basic | No --force flag |
138+
| | backup() |`enterprise database backup` | ✅ Implemented | |
139+
| | import() |`enterprise database import` | ✅ Implemented | |
140+
| **Nodes** | | | | |
141+
| | list() |`enterprise node list` | ✅ Implemented | |
142+
| | show() |`enterprise node show` | ✅ Implemented | |
143+
| | update() | ⚠️ `enterprise node update` | ⚠️ Basic | Only external_addr |
144+
| | add() || ❌ Missing | |
145+
| | remove() || ❌ Missing | |
146+
| **Users** | | | | |
147+
| | list() |`enterprise user list` | ✅ Implemented | |
148+
| | show() |`enterprise user show` | ✅ Implemented | |
149+
| | create() | ⚠️ `enterprise user create` | ⚠️ Basic | Limited options |
150+
| | update() | ⚠️ `enterprise user update` | ⚠️ Basic | Only email/password |
151+
| | delete() | ⚠️ `enterprise user delete` | ⚠️ Basic | No --force flag |
152+
| **Roles** | | | | |
153+
| | list() |`enterprise role list` | ✅ Implemented | |
154+
| | show() |`enterprise role show` | ✅ Implemented | |
155+
| | create() | ⚠️ `enterprise role create` | ⚠️ Basic | |
156+
| | update() | ⚠️ `enterprise role update` | ⚠️ Basic | |
157+
| | delete() | ⚠️ `enterprise role delete` | ⚠️ Basic | No --force flag |
158+
| **Modules** | | | | |
159+
| | list() |`enterprise module list` | ✅ Implemented | |
160+
| | show() |`enterprise module show` | ✅ Implemented | |
161+
| | upload() |`enterprise module upload` | ❌ Not implemented | Shows "not yet implemented" |
162+
| **License** | | | | |
163+
| | info() |`enterprise license info` | ✅ Implemented | |
164+
| | update() |`enterprise license update` | ✅ Implemented | |
165+
| **Bootstrap** | | | | |
166+
| | create() |`enterprise bootstrap create` | ✅ Implemented | |
167+
| | join() || ❌ Missing | |
168+
169+
## Summary
170+
171+
### Cloud API Coverage
172+
- **Total API Methods**: ~100+
173+
- **Fully Implemented**: ~15 (15%)
174+
- **Partially Implemented**: ~8 (8%)
175+
- **Not Implemented**: ~77 (77%)
176+
177+
### Enterprise API Coverage
178+
- **Total API Methods**: ~30
179+
- **Fully Implemented**: ~15 (50%)
180+
- **Partially Implemented**: ~10 (33%)
181+
- **Not Implemented**: ~5 (17%)
182+
183+
### Priority Missing Commands for Cloud
184+
1. **Peering** - Critical for networking
185+
2. **Transit Gateway** - Critical for networking
186+
3. **Backups** - Critical for operations
187+
4. **ACLs** - Critical for security
188+
5. **CRDB** - Critical for Active-Active
189+
6. **Metrics & Logs** - Important for monitoring
190+
7. **API Keys** - Important for automation
191+
8. **Cloud Accounts** - Important for multi-cloud
192+
193+
### Priority Missing Commands for Enterprise
194+
1. **Node add/remove** - Critical for cluster management
195+
2. **Module upload** - Important for custom modules
196+
3. **Bootstrap join** - Important for cluster setup
197+
198+
## Next Steps
199+
200+
1. Implement missing critical commands
201+
2. Enhance existing basic commands with more options
202+
3. Add convenience flags (--wait, --force, --dry-run)
203+
4. Improve error messages
204+
5. Add progress indicators for long operations

PHASE_2_SUMMARY.md

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# Phase 2 Progress Summary
2+
3+
## ✅ Completed in This Session
4+
5+
### 1. Comprehensive Audit
6+
- Audited all Cloud API endpoints (~100+ methods)
7+
- Audited all Enterprise API endpoints (~30 methods)
8+
- Created detailed coverage report in PHASE_2_AUDIT.md
9+
- Identified critical missing commands
10+
11+
### 2. Implemented Critical Cloud Commands
12+
13+
#### VPC Peering (`cloud peering`)
14+
- `list` - List all VPC peerings for a subscription
15+
- `show` - Show peering details
16+
- `create` - Create new VPC peering connection
17+
- `delete` - Delete peering (with --force confirmation)
18+
19+
#### Transit Gateway (`cloud transit-gateway`)
20+
- `list` - List Transit Gateway attachments
21+
- `show` - Show attachment details
22+
- `create` - Create new TGW attachment
23+
- `delete` - Delete attachment (with --force confirmation)
24+
25+
#### Backups (`cloud backup`)
26+
- `list` - List database backups
27+
- `show` - Show backup details
28+
- `create` - Create new backup
29+
- `restore` - Restore from backup
30+
- `delete` - Delete backup (with --force confirmation)
31+
32+
#### ACLs (`cloud acl`)
33+
- `list` - List ACL rules for a database
34+
- `show` - Show ACL rule details
35+
- `create` - Create new ACL rule
36+
- `update` - Update existing ACL rule
37+
- `delete` - Delete ACL rule (with --force confirmation)
38+
39+
#### CRDB Active-Active (`cloud crdb`)
40+
- `list` - List all Active-Active databases
41+
- `show` - Show CRDB details
42+
- `create` - Create new Active-Active database
43+
- `update` - Update CRDB configuration
44+
- `delete` - Delete CRDB (with --force confirmation)
45+
- `add-region` - Add region to CRDB
46+
- `remove-region` - Remove region from CRDB
47+
48+
#### API Keys (`cloud api-key`)
49+
- `list` - List all API keys
50+
- `show` - Show API key details
51+
- `create` - Create new API key
52+
- `update` - Update API key name/role
53+
- `delete` - Delete API key (with --force confirmation)
54+
- `regenerate` - Regenerate API key secret
55+
- `enable` - Enable API key
56+
- `disable` - Disable API key
57+
58+
#### Metrics (`cloud metrics`)
59+
- `database` - Get database metrics with filtering
60+
- `subscription` - Get subscription metrics with filtering
61+
- Support for custom metric names and time periods
62+
63+
#### Logs (`cloud logs`)
64+
- `database` - Get database logs (slowlog, audit) with pagination
65+
- `system` - Get system logs with pagination
66+
- `session` - Get session logs with pagination
67+
68+
#### Cloud Accounts (`cloud cloud-account`)
69+
- `list` - List all cloud accounts
70+
- `show` - Show cloud account details
71+
- `create` - Create new cloud account
72+
- `update` - Update cloud account credentials
73+
- `delete` - Delete cloud account (with --force confirmation)
74+
75+
#### Fixed Plans (`cloud fixed-plan`)
76+
- `list` - List all fixed plans
77+
- `show` - Show fixed plan details
78+
- `plans` - List available plans for region
79+
80+
#### Flexible Plans (`cloud flexible-plan`)
81+
- `list` - List all flexible plans
82+
- `show` - Show flexible plan details
83+
- `create` - Create new flexible plan
84+
- `update` - Update flexible plan configuration
85+
- `delete` - Delete flexible plan (with --force confirmation)
86+
87+
#### Private Service Connect (`cloud private-service-connect`)
88+
- `list` - List PSC endpoints for subscription
89+
- `show` - Show PSC endpoint details
90+
- `create` - Create new PSC endpoint
91+
- `update` - Update PSC endpoint configuration
92+
- `delete` - Delete PSC endpoint (with --force confirmation)
93+
94+
## 📊 Coverage Improvement
95+
96+
### Before Phase 2
97+
- **Cloud API**: ~15% coverage (15 of 100+ methods)
98+
- **Enterprise API**: ~50% coverage (15 of 30 methods)
99+
100+
### After Phase 2 (Current Status)
101+
- **Cloud API**: ~40% coverage (40+ of 100+ methods) ✅ **+25%**
102+
- **Enterprise API**: ~50% coverage (unchanged, focus was on Cloud)
103+
104+
## 🎯 Key Features Added
105+
106+
1. **Consistent --force Flag**: All destructive operations now require `--force` or show confirmation prompt
107+
2. **Proper Parameter Structure**: All commands use proper typed parameters
108+
3. **Output Format Support**: All commands work with `--output json/yaml/table`
109+
4. **JMESPath Queries**: All commands support `--query` for filtering output
110+
5. **Error Handling**: Proper error messages and validation
111+
112+
## 📝 Still TODO for Phase 2
113+
114+
### High Priority
115+
- [x] API Keys management ✅ **COMPLETED**
116+
- [x] Metrics commands ✅ **COMPLETED**
117+
- [x] Logs commands ✅ **COMPLETED**
118+
- [x] Fixed/Flexible plan commands ✅ **COMPLETED**
119+
- [x] Private Service Connect commands ✅ **COMPLETED**
120+
- [x] Cloud Accounts (different from Account) ✅ **COMPLETED**
121+
122+
### Medium Priority
123+
- [ ] Enhance existing commands with more options
124+
- [ ] Add --wait flag for async operations
125+
- [ ] Add progress indicators
126+
127+
### Low Priority
128+
- [ ] Improve error messages with suggestions
129+
- [ ] Add --dry-run support
130+
- [ ] Add shell completion support
131+
132+
## 🚀 Next Steps
133+
134+
1. Continue implementing remaining high-priority commands
135+
2. Add integration tests for new commands
136+
3. Update documentation with new command examples
137+
4. Consider creating a PR for Phase 2 work so far
138+
5. Begin planning Phase 3 (Workflow Commands)
139+
140+
## 💡 Notes
141+
142+
- The new commands follow the existing patterns for consistency
143+
- All API endpoints are accessed using the raw API client methods
144+
- Force confirmations prevent accidental deletions
145+
- The architecture is ready for Phase 3 workflow commands

0 commit comments

Comments
 (0)