ACLP Alerting get_channles() API changes and Added Enum for 'Status'#645
ACLP Alerting get_channles() API changes and Added Enum for 'Status'#645srbhaakamai wants to merge 7 commits intolinode:devfrom
Conversation
This reverts commit d40b96c.
satkumar-akamai
left a comment
There was a problem hiding this comment.
Looks good to me as per api spec.
There was a problem hiding this comment.
Pull request overview
This PR updates the AlertChannel model to accommodate a recent API structure change in the ACLP Alerting service's get_channels() endpoint. The changes replace the previous alerts property structure with a new AlertsReference format and add a details property with channel-specific configuration. Additionally, the integration test is updated to use the new "provisioning" status value instead of "in progress".
Changes:
- Updated AlertChannel property definitions to use
AlertsReferenceandChannelDetailsinstead of the previousAlertsstructure - Added three new dataclasses (
EmailDetails,ChannelDetails,AlertsReference) to support the new API response format - Changed status check in integration test from "in progress" to "provisioning"
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| linode_api4/objects/monitor.py | Added new dataclasses for the updated AlertChannel API structure and modified AlertChannel properties to use AlertsReference and ChannelDetails |
| test/integration/models/monitor/test_monitor.py | Updated status value check from "in progress" to "provisioning" in alert readiness polling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
yec-akamai
left a comment
There was a problem hiding this comment.
Looks good. will the Status enum be added too?
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
📝 Description
This is to address ACLP Alerting get_channels() API structure change for Alertchannels which was released recently.
The changes will fix the issues which originated post release.
Also added new enumeration for Status in AlertDefinition.
✔️ How to Test
What are the steps to reproduce the issue or verify the changes?
How do I run the relevant unit/integration tests?
##INTEGRATION TEST
export LINODE_TOKEN=""
export SKIP_E2E_FIREWALL=1
(venv) srbha@blr-mpo40 linode_api4-python % python -m pytest test/integration/models/monitor/test_monitor.py::test_integration_create_get_update_delete_alert_definition -q -s
.
1 passed in 10.28s
##UNIT TEST
python3 -m pytest test/unit -q
441 passed, 34 warnings in 0.93s