@@ -4,23 +4,32 @@ A comprehensive command-line interface for managing Exivity operations including
4
4
5
5
## Features
6
6
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
11
12
- ** Batch Operations** : Efficient bulk processing with atomic operations
12
13
- ** Data Validation** : Comprehensive validation against system data
14
+ - ** Export Operations** : Export rates and environment settings to CSV/JSON
13
15
14
16
## Installation
15
17
16
18
1 . ** Install Dependencies** :
17
19
``` bash
18
- pip install requests questionary
20
+ pip install requests questionary PyYAML
19
21
```
20
22
21
- 2 . ** Run the CLI** :
23
+ 2 . ** Install Package** (Optional):
24
+ ``` bash
25
+ pip install -e .
26
+ ```
27
+
28
+ 3 . ** Run the CLI** :
22
29
``` bash
23
30
python -m exivity_cli.main
31
+ # OR (if installed as package)
32
+ exivity-cli
24
33
# OR
25
34
python exivity-cli.py
26
35
# OR
@@ -30,8 +39,9 @@ A comprehensive command-line interface for managing Exivity operations including
30
39
## Quick Start
31
40
32
41
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
34
43
3 . ** Follow Prompts** : Use the interactive menus to perform operations
44
+ 4 . ** Configure Settings** : Use the Configuration menu to customize defaults and behavior
35
45
36
46
---
37
47
@@ -43,8 +53,10 @@ A comprehensive command-line interface for managing Exivity operations including
43
53
When you start the CLI, you'll be prompted for:
44
54
- ** Base URL** : Your Exivity server URL (e.g., ` https://localhost ` )
45
55
- ** 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.
48
60
49
61
### π° Rate Management
50
62
@@ -56,6 +68,21 @@ View comprehensive system statistics:
56
68
- Rate distribution by account
57
69
- Date ranges of existing rates
58
70
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
+
59
86
#### CSV Rate Import
60
87
61
88
** Supported CSV Format** :
@@ -130,13 +157,19 @@ Verify if specific rate revisions exist:
130
157
### βοΈ Workflow Management
131
158
132
159
#### Hourly Workflow Creation
133
- Create workflows that run across all 24 hourly environments:
160
+ Create workflows that run across configurable environments:
134
161
135
162
** Process** :
136
163
1 . Enter workflow name and description
137
164
2 . Handle existing workflows (delete/recreate option)
138
165
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
140
173
141
174
** Step Types** :
142
175
@@ -159,6 +192,7 @@ Create workflows that run across all 24 hourly environments:
159
192
** Example Workflow** :
160
193
```
161
194
Workflow: Daily Processing
195
+ Configuration: 24 environments (hour_00-hour_23)
162
196
Steps:
163
197
1. Extract: "DataSource" script
164
198
2. Transform: "ProcessData" script
@@ -167,32 +201,80 @@ Steps:
167
201
Result: 48 total steps (2 Γ 24 environments)
168
202
```
169
203
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
+
170
210
#### Environment Management
171
211
172
- ** Hourly Environments Status** :
173
- View status of hour_00-hour_23 environments:
212
+ ** Environment Status** :
213
+ View status of configured environments:
174
214
- β
Existing environments with IDs
175
215
- β Missing environments
176
216
- π 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
+ ` ` `
187
263
188
264
### π§ Advanced Features
189
265
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
190
271
#### API Debugging
191
272
Built-in tools for troubleshooting:
192
273
- **Endpoint Testing**: Check v1/v2 API availability
193
274
- **Dump Endpoint Testing**: Verify data export functionality
194
275
- **Environment Creation Testing**: Debug environment issues
195
276
- **SSL Configuration**: Handle certificate problems
277
+ - **Configuration Validation**: Verify settings and connectivity
196
278
197
279
#### Data Caching
198
280
Optimized performance features:
@@ -211,41 +293,60 @@ Comprehensive error management:
211
293
212
294
` ` `
213
295
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
217
300
βββ exivity_cli/
218
- β βββ main.py # Main entry point
301
+ β βββ __init__.py # Package initialization
302
+ β βββ main.py # Main entry point
303
+ β βββ config.py # Configuration management
219
304
β βββ 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
222
307
β βββ modules/
223
308
β βββ rate_management.py # Rate operations
224
309
β βββ workflow_management.py # Workflow operations
225
310
β βββ 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
229
315
```
230
316
231
317
### π― Best Practices
232
318
233
319
#### Rate Management
234
320
- ** 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
236
322
- ** Test Indexation** : Try account-specific indexation on small accounts first
237
323
- ** Monitor Progress** : Watch batch processing for any failures
324
+ - ** Use Configuration** : Set default values in config.yaml for consistency
238
325
239
326
#### 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
241
329
- ** Date Offsets** : Use consistent offsets across all steps
242
330
- ** Step Order** : Plan extract β transform β report sequence
243
331
- ** Testing** : Test workflows on single environment first
244
332
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
+
245
345
#### File Management
246
- - ** CSV Organization** : Keep CSV files in the ` csv/ ` folder
346
+ - ** CSV Organization** : Keep CSV files in the ` csv/ ` folder (configurable)
247
347
- ** Naming Convention** : Use descriptive names like ` rates_2024_Q4.csv `
248
348
- ** Encoding** : Save CSV files as UTF-8 with BOM for best compatibility
349
+ - ** Configuration Files** : Organize environment and workflow templates in respective folders
249
350
250
351
### π¨ Troubleshooting
251
352
@@ -268,10 +369,16 @@ Check: Username, password, server URL
268
369
Solution: Use debug mode to test endpoints
269
370
```
270
371
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
+
271
378
** Environment Creation Failures** :
272
379
```
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
275
382
```
276
383
277
384
#### Debug Mode
@@ -280,22 +387,26 @@ Enable detailed logging:
280
387
2 . Review API endpoint responses
281
388
3 . Check payload formats
282
389
4 . Verify server compatibility
390
+ 5 . Use configuration menu to check settings
283
391
284
392
#### Performance Tips
285
393
- Use batch operations for large datasets
286
394
- Enable data caching for repeated operations
287
- - Close and restart CLI if memory usage grows
395
+ - Configure appropriate timeout values in config.yaml
288
396
- Use account-specific operations when possible
397
+ - Leverage YAML configuration to avoid repetitive input
289
398
290
399
### π Supported Operations Summary
291
400
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 | β
|
299
410
300
411
### π Version Compatibility
301
412
@@ -308,6 +419,12 @@ Enable detailed logging:
308
419
- Tested with Exivity 4.x and newer
309
420
- Backward compatibility with v1 endpoints
310
421
- 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
311
428
312
429
---
313
430
@@ -317,6 +434,16 @@ For issues or questions:
317
434
1 . Check the troubleshooting section above
318
435
2 . Use built-in debug tools
319
436
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
321
448
322
449
** Happy managing! π**
0 commit comments