Skip to content

Commit b051c08

Browse files
committed
readme update
1 parent 1f58e58 commit b051c08

File tree

1 file changed

+173
-46
lines changed

1 file changed

+173
-46
lines changed

β€Žgeneric/management/cli/README.md

Lines changed: 173 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,32 @@ A comprehensive command-line interface for managing Exivity operations including
44

55
## Features
66

7-
- **Rate Management**: Import, validate, and index rates with CSV support
8-
- **Workflow Management**: Create workflows with 24-hour environment duplication
9-
- **Environment Management**: Manage hourly environments (hour_00-hour_23)
10-
- **Interactive Menus**: User-friendly questionary-based navigation
7+
- **Rate Management**: Import, validate, export, and index rates with CSV support
8+
- **Workflow Management**: Create workflows with configurable environment duplication
9+
- **Environment Management**: Manage environments with flexible naming conventions
10+
- **Configuration Management**: YAML-based configuration with interactive editing
11+
- **Interactive Menus**: User-friendly questionary-based navigation with topic organization
1112
- **Batch Operations**: Efficient bulk processing with atomic operations
1213
- **Data Validation**: Comprehensive validation against system data
14+
- **Export Operations**: Export rates and environment settings to CSV/JSON
1315

1416
## Installation
1517

1618
1. **Install Dependencies**:
1719
```bash
18-
pip install requests questionary
20+
pip install requests questionary PyYAML
1921
```
2022

21-
2. **Run the CLI**:
23+
2. **Install Package** (Optional):
24+
```bash
25+
pip install -e .
26+
```
27+
28+
3. **Run the CLI**:
2229
```bash
2330
python -m exivity_cli.main
31+
# OR (if installed as package)
32+
exivity-cli
2433
# OR
2534
python exivity-cli.py
2635
# OR
@@ -30,8 +39,9 @@ A comprehensive command-line interface for managing Exivity operations including
3039
## Quick Start
3140

3241
1. **Connect to API**: Enter your Exivity server URL, credentials, and SSL preferences
33-
2. **Choose Operation**: Select from Rate Management or Workflow Management
42+
2. **Choose Operation**: Select from Rate Management, Workflow Management, or Environment Management
3443
3. **Follow Prompts**: Use the interactive menus to perform operations
44+
4. **Configure Settings**: Use the Configuration menu to customize defaults and behavior
3545

3646
---
3747

@@ -43,8 +53,10 @@ A comprehensive command-line interface for managing Exivity operations including
4353
When you start the CLI, you'll be prompted for:
4454
- **Base URL**: Your Exivity server URL (e.g., `https://localhost`)
4555
- **SSL Verification**: Choose "No" for self-signed certificates
46-
- **Username**: Default is "admin"
47-
- **Password**: Default is "exivity"
56+
- **Username**: Default is "admin" (configurable)
57+
- **Password**: Default is "exivity" (configurable)
58+
59+
The CLI now supports YAML-based configuration in `config.yaml` for default connection settings, environment naming conventions, and other preferences.
4860

4961
### πŸ’° Rate Management
5062

@@ -56,6 +68,21 @@ View comprehensive system statistics:
5668
- Rate distribution by account
5769
- Date ranges of existing rates
5870

71+
#### Export Rates to CSV
72+
Export existing rates for backup or analysis:
73+
1. Select "Export rates to CSV file"
74+
2. Choose export format (account rates or list prices)
75+
3. Select date range and filters
76+
4. Review export summary
77+
5. Download CSV file
78+
79+
**Features**:
80+
- **Account Rates Export**: Complete rate data with account/service details
81+
- **List Prices Export**: Simplified pricing data format
82+
- **Date Range Filtering**: Export rates for specific time periods
83+
- **Service Name Inclusion**: Optional service name lookup
84+
- **Multiple Formats**: YYYYMMDD or YYYY-MM-DD date formats
85+
5986
#### CSV Rate Import
6087

6188
**Supported CSV Format**:
@@ -130,13 +157,19 @@ Verify if specific rate revisions exist:
130157
### βš™οΈ Workflow Management
131158

132159
#### Hourly Workflow Creation
133-
Create workflows that run across all 24 hourly environments:
160+
Create workflows that run across configurable environments:
134161

135162
**Process**:
136163
1. Enter workflow name and description
137164
2. Handle existing workflows (delete/recreate option)
138165
3. Configure date offsets for all steps
139-
4. Build workflow steps interactively:
166+
4. Build workflow steps interactively
167+
168+
**Configuration Options**:
169+
- **Environment Count**: Configure number of environments (default: 24)
170+
- **Naming Convention**: Customize environment naming (e.g., hour_00, shift_01)
171+
- **Variable Creation**: Automatically add environment variables
172+
- **Timeout Settings**: Default timeout per workflow step
140173

141174
**Step Types**:
142175

@@ -159,6 +192,7 @@ Create workflows that run across all 24 hourly environments:
159192
**Example Workflow**:
160193
```
161194
Workflow: Daily Processing
195+
Configuration: 24 environments (hour_00-hour_23)
162196
Steps:
163197
1. Extract: "DataSource" script
164198
2. Transform: "ProcessData" script
@@ -167,32 +201,80 @@ Steps:
167201
Result: 48 total steps (2 Γ— 24 environments)
168202
```
169203

204+
#### Advanced Workflow Tools
205+
- **Hourly Workflow Tools**: Create, list, duplicate, and delete hourly workflows
206+
- **Cross-Hour Duplication**: Copy workflows across different time periods
207+
- **Workflow Editing**: Modify existing workflow parameters
208+
- **Bulk Operations**: Manage multiple workflows simultaneously
209+
170210
#### Environment Management
171211

172-
**Hourly Environments Status**:
173-
View status of hour_00-hour_23 environments:
212+
**Environment Status**:
213+
View status of configured environments:
174214
- βœ… Existing environments with IDs
175215
- ❌ Missing environments
176216
- 🏠 Default environment identification
177-
178-
**Recreate Missing Environments**:
179-
- Automatically creates missing hour_00-hour_23 environments
180-
- Adds hour variables (hour=00, hour=01, etc.)
181-
- Protects existing environments
182-
183-
**Delete Hourly Environments**:
184-
- ⚠️ **CAUTION**: Deletes all hour_00-hour_23 environments
185-
- πŸ›‘οΈ **Protection**: Default environment cannot be deleted
186-
- Requires double confirmation for safety
217+
- πŸ“Š Environment health checking
218+
219+
**Environment Operations**:
220+
- **Create Missing**: Automatically creates missing environments based on configuration
221+
- **Bulk Configuration**: Update multiple environment settings simultaneously
222+
- **Export/Import Settings**: Backup and restore environment configurations
223+
- **Interactive Creation/Deletion**: Manual environment management
224+
225+
**Flexible Configuration**:
226+
- **Configurable Count**: Set any number of environments (not limited to 24)
227+
- **Custom Naming**: Define prefix, suffix format (e.g., `region_01`, `hour_00`)
228+
- **Variable Management**: Automatically create environment-specific variables
229+
- **Naming Patterns**: Support for various naming conventions via config.yaml
230+
231+
### βš™οΈ Configuration Management
232+
233+
#### YAML Configuration
234+
The CLI now uses a comprehensive YAML configuration system (`config.yaml`):
235+
236+
**Configuration Sections**:
237+
- **Connection**: Default hostname, port, credentials, SSL settings
238+
- **Environments**: Count, naming conventions, variable creation
239+
- **Workflows**: Default timeouts, date offsets, wait settings
240+
- **Rates**: Default values, CSV export formats
241+
- **API**: Timeout, retry settings, pagination
242+
- **Logging**: Debug levels, request logging
243+
- **Paths**: Directory locations for CSV, logs, environments
244+
245+
**Interactive Configuration**:
246+
- **Show Configuration**: View current settings
247+
- **Edit Configuration**: Modify settings through interactive prompts
248+
- **Reload Configuration**: Refresh from config.yaml
249+
- **Save Configuration**: Persist changes to file
250+
251+
**Example Configuration**:
252+
```yaml
253+
environments:
254+
count: 24
255+
naming:
256+
prefix: "hour_"
257+
suffix_format: "{:02d}"
258+
variables:
259+
- name: "hour"
260+
value_format: "{:02d}"
261+
encrypted: false
262+
```
187263
188264
### πŸ”§ Advanced Features
189265
266+
#### Enhanced Menu System
267+
- **Topic-Based Navigation**: Organized by Rate, Workflow, Environment, and Configuration
268+
- **Streamlined Interface**: Simplified menu structure with clear categorization
269+
- **Context-Sensitive Options**: Menu items adapt based on current state
270+
- **Progress Indicators**: Visual feedback for long-running operations
190271
#### API Debugging
191272
Built-in tools for troubleshooting:
192273
- **Endpoint Testing**: Check v1/v2 API availability
193274
- **Dump Endpoint Testing**: Verify data export functionality
194275
- **Environment Creation Testing**: Debug environment issues
195276
- **SSL Configuration**: Handle certificate problems
277+
- **Configuration Validation**: Verify settings and connectivity
196278
197279
#### Data Caching
198280
Optimized performance features:
@@ -211,41 +293,60 @@ Comprehensive error management:
211293
212294
```
213295
cli/
214-
β”œβ”€β”€ csv/ # CSV files for rate import
215-
β”œβ”€β”€ environments/ # Environment configurations
216-
β”œβ”€β”€ workflows/ # Workflow templates
296+
β”œβ”€β”€ config.yaml # Main configuration file
297+
β”œβ”€β”€ csv/ # CSV files for rate import
298+
β”œβ”€β”€ environments/ # Environment configurations
299+
β”œβ”€β”€ workflows/ # Workflow templates
217300
β”œβ”€β”€ exivity_cli/
218-
β”‚ β”œβ”€β”€ main.py # Main entry point
301+
β”‚ β”œβ”€β”€ __init__.py # Package initialization
302+
β”‚ β”œβ”€β”€ main.py # Main entry point
303+
β”‚ β”œβ”€β”€ config.py # Configuration management
219304
β”‚ β”œβ”€β”€ api/
220-
β”‚ β”‚ β”œβ”€β”€ client.py # API client with all endpoints
221-
β”‚ β”‚ └── debug.py # Debug and testing tools
305+
β”‚ β”‚ β”œβ”€β”€ client.py # API client with all endpoints
306+
β”‚ β”‚ └── debug.py # Debug and testing tools
222307
β”‚ └── modules/
223308
β”‚ β”œβ”€β”€ rate_management.py # Rate operations
224309
β”‚ β”œβ”€β”€ workflow_management.py # Workflow operations
225310
β”‚ └── environment_management.py # Environment operations
226-
β”œβ”€β”€ exivity-cli.py # Standalone script
227-
β”œβ”€β”€ run_cli.py # Development runner
228-
└── README.md # This file
311+
β”œβ”€β”€ setup.py # Package installation
312+
β”œβ”€β”€ exivity-cli.py # Standalone script
313+
β”œβ”€β”€ run_cli.py # Development runner
314+
└── README.md # This file
229315
```
230316

231317
### 🎯 Best Practices
232318

233319
#### Rate Management
234320
- **Validate First**: Always use CSV validation before importing
235-
- **Backup Data**: Export existing rates before major changes
321+
- **Export Before Changes**: Use rate export to backup existing data
236322
- **Test Indexation**: Try account-specific indexation on small accounts first
237323
- **Monitor Progress**: Watch batch processing for any failures
324+
- **Use Configuration**: Set default values in config.yaml for consistency
238325

239326
#### Workflow Management
240-
- **Environment Check**: Verify all 24 environments exist before workflow creation
327+
- **Environment Check**: Verify all configured environments exist before workflow creation
328+
- **Configure Defaults**: Use config.yaml to set standard timeout and date offset values
241329
- **Date Offsets**: Use consistent offsets across all steps
242330
- **Step Order**: Plan extract β†’ transform β†’ report sequence
243331
- **Testing**: Test workflows on single environment first
244332

333+
#### Environment Management
334+
- **Configure Naming**: Use config.yaml to define consistent naming patterns
335+
- **Health Checks**: Regularly verify environment status
336+
- **Backup Settings**: Export environment configurations before major changes
337+
- **Variable Management**: Use automatic variable creation for consistency
338+
339+
#### Configuration Management
340+
- **YAML-First**: Configure defaults in config.yaml rather than entering repeatedly
341+
- **Version Control**: Keep config.yaml in version control for team consistency
342+
- **Environment-Specific**: Use different config files for dev/staging/production
343+
- **Validation**: Use the configuration menu to verify settings
344+
245345
#### File Management
246-
- **CSV Organization**: Keep CSV files in the `csv/` folder
346+
- **CSV Organization**: Keep CSV files in the `csv/` folder (configurable)
247347
- **Naming Convention**: Use descriptive names like `rates_2024_Q4.csv`
248348
- **Encoding**: Save CSV files as UTF-8 with BOM for best compatibility
349+
- **Configuration Files**: Organize environment and workflow templates in respective folders
249350

250351
### 🚨 Troubleshooting
251352

@@ -268,10 +369,16 @@ Check: Username, password, server URL
268369
Solution: Use debug mode to test endpoints
269370
```
270371

372+
**Configuration Issues**:
373+
```
374+
Check: config.yaml syntax, file permissions, default values
375+
Solution: Use configuration menu to validate and edit settings
376+
```
377+
271378
**Environment Creation Failures**:
272379
```
273-
Check: Default environment conflicts
274-
Solution: Use environment debug tools
380+
Check: Environment naming conflicts, default environment issues
381+
Solution: Use environment debug tools and configuration validation
275382
```
276383

277384
#### Debug Mode
@@ -280,22 +387,26 @@ Enable detailed logging:
280387
2. Review API endpoint responses
281388
3. Check payload formats
282389
4. Verify server compatibility
390+
5. Use configuration menu to check settings
283391

284392
#### Performance Tips
285393
- Use batch operations for large datasets
286394
- Enable data caching for repeated operations
287-
- Close and restart CLI if memory usage grows
395+
- Configure appropriate timeout values in config.yaml
288396
- Use account-specific operations when possible
397+
- Leverage YAML configuration to avoid repetitive input
289398

290399
### πŸ“Š Supported Operations Summary
291400

292-
| Feature | Batch Support | Validation | Fallback | Progress Tracking |
293-
|---------|---------------|------------|----------|-------------------|
294-
| CSV Import | βœ… (50/batch) | βœ… | βœ… | βœ… |
295-
| Rate Indexation | βœ… (50/batch) | βœ… | βœ… | βœ… |
296-
| Workflow Creation | βœ… (Atomic) | βœ… | βœ… | βœ… |
297-
| Environment Creation | βœ… | βœ… | βœ… | βœ… |
298-
| Data Export | βœ… | βœ… | βœ… | βœ… |
401+
| Feature | Batch Support | Validation | Fallback | Progress Tracking | Configuration |
402+
|---------|---------------|------------|----------|-------------------|---------------|
403+
| CSV Import | βœ… (50/batch) | βœ… | βœ… | βœ… | βœ… |
404+
| CSV Export | βœ… | βœ… | βœ… | βœ… | βœ… |
405+
| Rate Indexation | βœ… (50/batch) | βœ… | βœ… | βœ… | βœ… |
406+
| Workflow Creation | βœ… (Atomic) | βœ… | βœ… | βœ… | βœ… |
407+
| Environment Creation | βœ… | βœ… | βœ… | βœ… | βœ… |
408+
| Environment Export/Import | βœ… | βœ… | βœ… | βœ… | βœ… |
409+
| Configuration Management | N/A | βœ… | N/A | N/A | βœ… |
299410

300411
### πŸ”„ Version Compatibility
301412

@@ -308,6 +419,12 @@ Enable detailed logging:
308419
- Tested with Exivity 4.x and newer
309420
- Backward compatibility with v1 endpoints
310421
- SSL/TLS support for secure connections
422+
- Configuration-driven defaults for various Exivity versions
423+
424+
**Installation Methods**:
425+
- **Development**: Direct Python execution with dependencies
426+
- **Package**: Install via setup.py for system-wide access
427+
- **Portable**: Standalone script execution
311428

312429
---
313430

@@ -317,6 +434,16 @@ For issues or questions:
317434
1. Check the troubleshooting section above
318435
2. Use built-in debug tools
319436
3. Review API endpoint responses
320-
4. Consult Exivity documentation for API specifics
437+
4. Check configuration settings in config.yaml
438+
5. Consult Exivity documentation for API specifics
439+
440+
**New in Recent Updates**:
441+
- ✨ YAML-based configuration system
442+
- πŸ”§ Interactive configuration management
443+
- πŸ“€ Rate export functionality
444+
- πŸ—οΈ Flexible environment naming and count
445+
- πŸ“‹ Enhanced menu organization
446+
- βš™οΈ Package installation support
447+
- πŸ”„ Improved error handling and validation
321448

322449
**Happy managing! πŸš€**

0 commit comments

Comments
Β (0)