Version 0.59.5 (January 2026)
Released: January 29, 2026
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).
1. BUG FIXES
Pagination Fix
- Fixed pagination issue when
pageparameter is not already present in the URL - Added logic to properly append
pageparameter with correct separator (?or&) - Improved
APIResponse._check_next()to handle URLs without existing pagination parameters
Error Handling Improvements
- Replaced
sys.exit()calls with proper exception raising in API validation and authentication methods _get_api_token_data(): Now raisesConnectionErrorinstead of callingsys.exit()for proxy and connection errors_get_api_token_data(): Now raisesValueErrorinstead of callingsys.exit(2)for invalid API tokens (401 status)_process_login(): Now raisesConnectionErrorinstead of callingsys.exit()for proxy and connection errors_getself(): Now raisesConnectionErrorfor proxy errors andValueErrorwhen authentication fails and user declines to retry
2. API UPDATES
OpenAPI Specification Update
- Updated to latest Mist OpenAPI specification
- Enhanced alarm search endpoints with additional filtering parameters:
searchOrgAlarms(): Addedgroup,severity,ack_admin_name, andackedparameterssearchSiteAlarms(): Enhanced parameter support
- Updated parameter types and documentation across multiple endpoints
3. FILES MODIFIED
src/mistapi/__api_response.py
- Fixed pagination URL construction to handle missing
pageparameter - Improved
_check_next()method with proper separator detection
src/mistapi/__api_session.py
- Replaced 5
sys.exit()calls with proper exceptions (ConnectionError,ValueError) - Improved error handling to allow proper exception propagation for testing
- Added early return logic to skip token validation when cloud URI is not set
src/mistapi/api/v1/orgs/alarms.py
- Added
group,severity,ack_admin_name, andackedparameters tosearchOrgAlarms() - Updated parameter documentation with enum values
src/mistapi/api/v1/sites/alarms.py
- Enhanced alarm search functionality with updated parameters
src/mistapi/api/v1/orgs/stats.py
- Updated statistics endpoints to match latest API specification
src/mistapi/api/v1/sites/stats.py
- Updated statistics endpoints to match latest API specification
tests/unit/test_api_session.py
- Added
Mockto imports - Fixed
test_initialisation_with_parametersto mockrequests.get - Fixed
test_initialisation_with_env_fileto mockrequests.get - Fixed
test_set_single_api_tokento use correct mock return type - Fixed
test_set_multiple_api_tokensto use correct mock return type
tests/conftest.py
- Updated
basic_sessionfixture to properly mock HTTP requests during token validation
Summary Statistics
- Bug Fixes: 6 (5 sys.exit() calls replaced + 1 pagination fix)
- API Updates: Multiple endpoints updated with new parameters
- Test Improvements: 6 tests fixed
- Total Files Modified: 11
Breaking Changes
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.
ConnectionErroris raised for proxy and connection errorsValueErroris raised for invalid API tokens or failed authentication