Skip to content

ACLP: Cleanup entity related response fields from alert definition#690

Draft
shkaruna wants to merge 7 commits intolinode:devfrom
shkaruna:cleanup/entity-related-fields
Draft

ACLP: Cleanup entity related response fields from alert definition#690
shkaruna wants to merge 7 commits intolinode:devfrom
shkaruna:cleanup/entity-related-fields

Conversation

@shkaruna
Copy link
Copy Markdown
Contributor

📝 Description

Cleanup entity related response fields from alert definition.
Removed entity_ids and has_more_resources response fields of ACLP alerting APIs.
Updated test cases.

✔️ How to Test

What are the steps to reproduce the issue or verify the changes?
Not applicable

How do I run the relevant unit/integration tests?
Prerequisites:
Clone the repository
Prepare environment (zsh / macOS)

Create and activate venv:
python3 -m venv .venv
source .venv/bin/activate

install deps
python -m pip install --upgrade pip

Install runtime dependencies:
pip3 install requests polling deprecated

Install dev/test extras
pip3 install -e '.[dev,test]'

test deps
pip3 install pytest mock httpretty pytest-rerunfailures

Unit test:

Run all unit tests:
python -m pytest test/unit -q

Run Monitor alert channels unit tests:

python -m pytest test/unit/groups/monitor_api_test.py -q -s
....
4 passed in 0.13s

Integration test:
#if you have PAT token with write access only to Monitor and read for rest of the services for integration
export SKIP_E2E_FIREWALL=1 # optional: skip firewall to use fixture
export LINODE_TOKEN="YOUR_REAL_TOKEN" # required for integration
python -m pytest test/integration/models/monitor/test_monitor.py::test_integration_create_get_update_delete_alert_definition -q -s
.
1 passed in 12.57s

shkaruna added 6 commits April 8, 2026 22:28
Add entities envelope in AlertDefinition. Add list entities GET API method. Add tests.
Remove entity_ids and has_more_resources response fields
parent_id_name = "service_type"
id_attribute = "id"

properties = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I find channel_ids is missing in the properties in previous implemenatation. Can you add it please? It's not in the response struct, but should be updatable just like entity_ids.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks Ye. I have updated the properties.

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.

2 participants