|
1 | 1 | # CHANGELOG |
2 | 2 |
|
| 3 | +## Version 0.59.5 (January 2026) |
| 4 | + |
| 5 | +**Released**: January 29, 2026 |
| 6 | + |
| 7 | +This release improves error handling by replacing `sys.exit()` calls with proper exceptions, fixes pagination issues, and updates the API definitions to match the latest OpenAPI specification (2511.1.14). |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +## 1. BUG FIXES |
| 12 | + |
| 13 | +### **Pagination Fix** |
| 14 | +- Fixed pagination issue when `page` parameter is not already present in the URL |
| 15 | +- Added logic to properly append `page` parameter with correct separator (`?` or `&`) |
| 16 | +- Improved `APIResponse._check_next()` to handle URLs without existing pagination parameters |
| 17 | + |
| 18 | +### **Error Handling Improvements** |
| 19 | +- Replaced `sys.exit()` calls with proper exception raising in API validation and authentication methods |
| 20 | +- `_get_api_token_data()`: Now raises `ConnectionError` instead of calling `sys.exit()` for proxy and connection errors |
| 21 | +- `_get_api_token_data()`: Now raises `ValueError` instead of calling `sys.exit(2)` for invalid API tokens (401 status) |
| 22 | +- `_process_login()`: Now raises `ConnectionError` instead of calling `sys.exit()` for proxy and connection errors |
| 23 | +- `_getself()`: Now raises `ConnectionError` for proxy errors and `ValueError` when authentication fails and user declines to retry |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +## 2. API UPDATES |
| 28 | + |
| 29 | +### **OpenAPI Specification Update** |
| 30 | +- Updated to latest Mist OpenAPI specification |
| 31 | +- Enhanced alarm search endpoints with additional filtering parameters: |
| 32 | + - `searchOrgAlarms()`: Added `group`, `severity`, `ack_admin_name`, and `acked` parameters |
| 33 | + - `searchSiteAlarms()`: Enhanced parameter support |
| 34 | +- Updated parameter types and documentation across multiple endpoints |
| 35 | + |
| 36 | +--- |
| 37 | + |
| 38 | +## 3. FILES MODIFIED |
| 39 | + |
| 40 | +### **src/mistapi/__api_response.py** |
| 41 | +- Fixed pagination URL construction to handle missing `page` parameter |
| 42 | +- Improved `_check_next()` method with proper separator detection |
| 43 | + |
| 44 | +### **src/mistapi/__api_session.py** |
| 45 | +- Replaced 5 `sys.exit()` calls with proper exceptions (`ConnectionError`, `ValueError`) |
| 46 | +- Improved error handling to allow proper exception propagation for testing |
| 47 | +- Added early return logic to skip token validation when cloud URI is not set |
| 48 | + |
| 49 | +### **src/mistapi/api/v1/orgs/alarms.py** |
| 50 | +- Added `group`, `severity`, `ack_admin_name`, and `acked` parameters to `searchOrgAlarms()` |
| 51 | +- Updated parameter documentation with enum values |
| 52 | + |
| 53 | +### **src/mistapi/api/v1/sites/alarms.py** |
| 54 | +- Enhanced alarm search functionality with updated parameters |
| 55 | + |
| 56 | +### **src/mistapi/api/v1/orgs/stats.py** |
| 57 | +- Updated statistics endpoints to match latest API specification |
| 58 | + |
| 59 | +### **src/mistapi/api/v1/sites/stats.py** |
| 60 | +- Updated statistics endpoints to match latest API specification |
| 61 | + |
| 62 | +### **tests/unit/test_api_session.py** |
| 63 | +- Added `Mock` to imports |
| 64 | +- Fixed `test_initialisation_with_parameters` to mock `requests.get` |
| 65 | +- Fixed `test_initialisation_with_env_file` to mock `requests.get` |
| 66 | +- Fixed `test_set_single_api_token` to use correct mock return type |
| 67 | +- Fixed `test_set_multiple_api_tokens` to use correct mock return type |
| 68 | + |
| 69 | +### **tests/conftest.py** |
| 70 | +- Updated `basic_session` fixture to properly mock HTTP requests during token validation |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | +## Summary Statistics |
| 75 | + |
| 76 | +- **Bug Fixes**: 6 (5 sys.exit() calls replaced + 1 pagination fix) |
| 77 | +- **API Updates**: Multiple endpoints updated with new parameters |
| 78 | +- **Test Improvements**: 6 tests fixed |
| 79 | +- **Total Files Modified**: 11 |
| 80 | + |
| 81 | +--- |
| 82 | + |
| 83 | +## Breaking Changes |
| 84 | + |
| 85 | +**Potential Breaking Change**: Code that previously relied on `sys.exit()` behavior during authentication failures will now receive exceptions instead. This is a more correct behavior for library code. |
| 86 | + |
| 87 | +- `ConnectionError` is raised for proxy and connection errors |
| 88 | +- `ValueError` is raised for invalid API tokens or failed authentication |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +## Version 0.59.4 (January 2026) |
| 93 | + |
| 94 | +**Released**: January 28, 2026 |
| 95 | + |
| 96 | +This release removes default values from optional parameters across all API functions, improving code clarity and consistency. |
| 97 | + |
| 98 | +--- |
| 99 | + |
| 100 | +## 1. CHANGES |
| 101 | + |
| 102 | +### **API Parameter Defaults Removed** |
| 103 | +- Removed default values from optional parameters across all API endpoint functions |
| 104 | +- All optional parameters now default to `None` instead of using OpenAPI-specified defaults |
| 105 | +- Default values are handled directly by the Mist Cloud API when parameters are omitted |
| 106 | +- Eliminates redundancy and potential inconsistencies between client and server defaults |
| 107 | +- Improves consistency and makes it clearer which parameters are explicitly set by the caller |
| 108 | +- Affects 116 files across the codebase |
| 109 | + |
| 110 | +--- |
| 111 | + |
| 112 | +## 2. FILES MODIFIED |
| 113 | + |
| 114 | +### **API Endpoint Files** (116 files affected) |
| 115 | +- All API endpoint functions updated to use `None` as default for optional parameters |
| 116 | +- Includes files in: |
| 117 | + - `src/mistapi/api/v1/orgs/` (52 files) |
| 118 | + - `src/mistapi/api/v1/sites/` (48 files) |
| 119 | + - `src/mistapi/api/v1/msps/` (7 files) |
| 120 | + - `src/mistapi/api/v1/installer/` (2 files) |
| 121 | + - Other API directories |
| 122 | + |
| 123 | +--- |
| 124 | + |
| 125 | +## Summary Statistics |
| 126 | + |
| 127 | +- **Changes**: Standardized optional parameter defaults |
| 128 | +- **Total Files Modified**: 116 |
| 129 | +- **Lines Changed**: ~856 additions, ~642 deletions |
| 130 | + |
| 131 | +--- |
| 132 | + |
| 133 | +## Breaking Changes |
| 134 | + |
| 135 | +**Breaking Change**: Functions that previously had default values specified from the OpenAPI spec now default to `None`. However, this should not affect behavior as the Mist Cloud API applies the same default values server-side when parameters are omitted. |
| 136 | + |
| 137 | +If you were explicitly relying on seeing the default values in the Python function signature, you will now need to refer to the Mist API documentation for default values. |
| 138 | + |
| 139 | +Example: |
| 140 | +```python |
| 141 | +# Before 0.59.4 (if API spec had duration="1d" as default) |
| 142 | +searchOrgAlarms(session, org_id) # duration defaulted to "1d" in Python |
| 143 | + |
| 144 | +# After 0.59.4 |
| 145 | +searchOrgAlarms(session, org_id) # duration=None sent, Mist Cloud applies "1d" default |
| 146 | +searchOrgAlarms(session, org_id, duration="1d") # Explicit is also fine |
| 147 | +``` |
| 148 | + |
| 149 | +**Note**: The actual API behavior remains unchanged - the Mist Cloud handles default values consistently. |
| 150 | + |
| 151 | +--- |
| 152 | + |
3 | 153 | ## Version 0.59.3 (December 2024) |
4 | 154 |
|
5 | 155 | **Released**: December 26, 2024 |
|
0 commit comments