Skip to content

ACLP Alerting get_channles() API changes and Added Enum for 'Status'#645

Open
srbhaakamai wants to merge 4 commits intolinode:devfrom
srbhaakamai:dev
Open

ACLP Alerting get_channles() API changes and Added Enum for 'Status'#645
srbhaakamai wants to merge 4 commits intolinode:devfrom
srbhaakamai:dev

Conversation

@srbhaakamai
Copy link
Contributor

@srbhaakamai srbhaakamai commented Feb 13, 2026

📝 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

@srbhaakamai srbhaakamai requested a review from a team as a code owner February 13, 2026 08:05
@srbhaakamai srbhaakamai requested review from ezilber-akamai and yec-akamai and removed request for a team February 13, 2026 08:05
Copy link

@satkumar-akamai satkumar-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me as per api spec.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AlertsReference and ChannelDetails instead of the previous Alerts structure
  • 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.

class AlertsReference(JSONObject):
"""
Represents a reference to alerts associated with an alert channel.

Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a trailing whitespace after the opening docstring quotes. This should be removed to maintain consistent documentation formatting.

Suggested change

Copilot uses AI. Check for mistakes.
alert = client.load(AlertDefinition, alert_id, service_type)
while (
getattr(alert, "status", None) == "in progress"
getattr(alert, "status", None) == "provisioning"
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The status value has been changed from "in progress" to "provisioning". This change aligns with the PR description indicating an API structure change. However, consider whether an enum for status values should be introduced to avoid hard-coded strings. This would make the code more maintainable and prevent typos.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@yec-akamai yec-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. will the Status enum be added too?

"channel_type": Property(),
"alerts": Property(mutable=False, json_object=Alerts),
"details": Property(mutable=False, json_object=ChannelDetails),
"alerts": Property(mutable=False, json_object=AlertsReference),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can you align the naming in python-sdk and linodego? It will be helpful for future maintenance. I remember in linodego you name the struct as AlertInfo but here is object class is AlertsReference. Can you just pick one naming and use it in both repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants