feat: add ACLP monitor list entities method#923
Merged
yec-akamai merged 2 commits intolinode:mainfrom Apr 9, 2026
Merged
Conversation
Contributor
Author
|
@satkumar-akamai : Please review |
bcbc126 to
1aaff02
Compare
1aaff02 to
10b45df
Compare
satkumar-akamai
approved these changes
Apr 7, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for listing entities associated with an ACLP monitor alert definition and updates the alert definition model/tests to reflect new API fields.
Changes:
- Extended
AlertDefinitionto includescope,regions, and anentitiesenvelope. - Added a new client method to fetch the paginated entities list for an alert definition.
- Updated unit tests, integration tests, and integration fixtures to match the new/updated API shapes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| monitor_alert_definitions.go | Adds new scope/entities types & fields and introduces an entities-list client method. |
| test/unit/monitor_alert_definitions_test.go | Updates mocked API payloads and assertions; adds a unit test for listing entities. |
| test/integration/monitor_alert_definitions_test.go | Adds a (currently skipped) integration test stub for listing alert definition entities. |
| test/integration/fixtures/TestMonitorAlertDefinition.yaml | Updates recorded fixture interactions/responses for monitor alert definition integration coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
10b45df to
dcb1300
Compare
yec-akamai
reviewed
Apr 7, 2026
Contributor
yec-akamai
left a comment
There was a problem hiding this comment.
Unit test passed. will run integration test once API in prod
dcb1300 to
2e6efe5
Compare
2e6efe5 to
532472a
Compare
dawiddzhafarov
approved these changes
Apr 8, 2026
e86b98d to
831e457
Compare
yec-akamai
reviewed
Apr 8, 2026
Contributor
yec-akamai
left a comment
There was a problem hiding this comment.
Can you address the conflict before merging?
Add entity envelope in AlertDefinition GET, POST and PUT API responses. Add new method to list entities. Update tests.
831e457 to
68a5ffc
Compare
…clp-list-entities
yec-akamai
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
API: GET /monitor/services/{service_type}/alert-definitions/{id}/entitiesJIRA: DPS-41869
✔️ 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
Go 1.19+ installed
Valid Linode API token with monitor permissions
Export LINODE_TOKEN environment variable for integration tests
Unit tests:
make test-unit
go test -v ./test/unit/... -run MonitorAlertDefinition
Output:
=== RUN TestCreateMonitorAlertDefinition
--- PASS: TestCreateMonitorAlertDefinition (0.00s)
=== RUN TestCreateMonitorAlertDefinitionWithIdempotency
--- PASS: TestCreateMonitorAlertDefinitionWithIdempotency (0.00s)
=== RUN TestGetMonitorAlertDefinition
--- PASS: TestGetMonitorAlertDefinition (0.00s)
=== RUN TestListMonitorAlertDefinitions
--- PASS: TestListMonitorAlertDefinitions (0.00s)
=== RUN TestUpdateMonitorAlertDefinition
--- PASS: TestUpdateMonitorAlertDefinition (0.00s)
=== RUN TestUpdateMonitorAlertDefinition_LabelOnly
--- PASS: TestUpdateMonitorAlertDefinition_LabelOnly (0.00s)
=== RUN TestDeleteMonitorAlertDefinition
--- PASS: TestDeleteMonitorAlertDefinition (0.00s)
=== RUN TestListMonitorAlertDefinitionEntities
--- PASS: TestListMonitorAlertDefinitionEntities (0.00s)
PASS
ok github.com/linode/linodego/test/unit (cached)
Integration tests:
Verified with Production PAT & devcloud PAT.
Play:
make test-int
make test-int TEST_ARGS='-run "Alert"'
cd test && make test-int TEST_TIMEOUT=5h
make[1]: Entering directory '/home/shkaruna/sdk/linodego/test'
2026/04/08 12:08:47 [INFO] LINODE_FIXTURE_MODE play will be used for tests
2026/04/08 12:08:47 [INFO] Fixture mode play - Test Linode Cloud Firewall not created
=== RUN TestMonitorAlertDefinition_smoke
--- PASS: TestMonitorAlertDefinition_smoke (0.00s)
=== RUN TestMonitorAlertDefinitions_List
--- PASS: TestMonitorAlertDefinitions_List (0.00s)
=== RUN TestMonitorAlertChannels_List
--- PASS: TestMonitorAlertChannels_List (0.00s)
=== RUN TestMonitorAlertDefinition_CreateWithIdempotency
--- PASS: TestMonitorAlertDefinition_CreateWithIdempotency (0.00s)
=== RUN TestMonitorAlertDefinitionEntities_List
--- PASS: TestMonitorAlertDefinitionEntities_List (0.00s)
PASS
ok github.com/linode/linodego/test/integration 0.015s
make[1]: Leaving directory '/home/shkaruna/sdk/linodego/test'
Record
export LINODE_TOKEN="Linode API token"
ENABLE_CLOUD_FW=false make TEST_ARGS='-run "Alert"' fixtures