Aclp logs support by sjer-akamai · Pull Request #686 · linode/linode_api4-python · GitHub
Skip to content

Aclp logs support#686

Open
sjer-akamai wants to merge 30 commits intolinode:devfrom
sjer-akamai:ACLP-logs-support
Open

Aclp logs support#686
sjer-akamai wants to merge 30 commits intolinode:devfrom
sjer-akamai:ACLP-logs-support

Conversation

@sjer-akamai
Copy link
Copy Markdown

📝 Description

Adds support for monitor logs functionality
What does this PR do and why is this change necessary?

  1. Adds full SDK support for monitor Logs API. This includes both the destinations and streams. This is a new feature not yet supported in the SDK.
  2. Adds unit tests for newly implemented features.
  3. Adds integration tests for newly implemented features.
  4. Integration tests include safeguards based around the limitations of API.
    • The feature is currently in limited availability, these integration tests are skipped if the feature is not available for the account running tests.
    • Logs Stream functionality is limited to one stream per account. For this reason Logs stream tests will automatically skip if there's a stream existing on the account.
    • Full e2e test for streams require a stream to complete provisioning - based on experience during development this can take up to an hour. Similarly to what's already present for database related tests, an environment variable (run_aclp_logs_stream_tests) needs to be set as true or yes to enable testing the Stream portion of the API.
  5. github workflow files were updated to include the run_aclp_logs_stream_tests environment variable.

Notes:

  • Techdocs for stream POST and PUT requests mention destinations being "One or more unique identifiers for the sync points that will receive logs data." This differs from the actual API implementation: streams currently support only a single destination, and the API expects a single-element list in the request. This was confirmed with the team developing the ACLP Logs API, and a documentation update was requested.

✔️ How to Test

How do I run the relevant unit/integration tests?
Unit tests:

  1. Follow usual installation/setup steps
  2. run pytest test/unit to run all unit tests, or:
  3. run pytest test/unit/objects/monitor_test.py to run only monitor related tests

Integration tests:

  1. setup your linode token:
    • export LINODE_TOKEN="YOUR_REAL_TOKEN"
  2. set environment variable to enable Logs Stream tests. This step is optional - if the variable is not set only destination related tests will run.
    • export RUN_ACLP_LOGS_STREAM_TESTS=true
  3. run test suite:
    • make TEST_CASE=test_monitor_logs test-int

Notes:

  • Integration tests will be skipped if account has no aclp_logs account capability
  • Stream integration tests will be skipped if another Logs stream is present on the account

@sjer-akamai sjer-akamai requested review from a team as code owners April 23, 2026 11:25
@sjer-akamai sjer-akamai removed the request for review from a team April 23, 2026 11:25
@sjer-akamai sjer-akamai requested review from mawilk90 and yec-akamai and removed request for a team April 23, 2026 11:25
@yec-akamai yec-akamai requested a review from Copilot April 23, 2026 19:14
Copy link
Copy Markdown
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

Adds first-class SDK support for the Monitor Logs API (Destinations + Streams), including object models, Monitor group helpers, and accompanying unit/integration test coverage with CI workflow knobs for long-running stream provisioning.

Changes:

  • Introduces LogsDestination* and LogsStream* objects (including history + destination update support) in linode_api4/objects/monitor.py.
  • Adds MonitorGroup.destinations(), destination_create(), streams(), and stream_create() in linode_api4/groups/monitor.py.
  • Adds unit tests, integration tests (with capability + env-var gating), fixtures, and updates e2e workflows to pass RUN_ACLP_LOGS_STREAM_TESTS.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
linode_api4/objects/monitor.py Adds logs destination/stream models, enums, and history/update helpers.
linode_api4/groups/monitor.py Adds Monitor group methods to list/create destinations and streams.
test/unit/objects/monitor_test.py Adds unit tests validating serialization/deserialization and endpoints for logs APIs.
test/integration/models/monitor/test_monitor_logs.py Adds integration coverage for destinations and streams with skip safeguards.
test/fixtures/monitor_streams_destinations.json Adds fixture for listing destinations.
test/fixtures/monitor_streams_destinations_1_history.json Adds fixture for destination history.
test/fixtures/monitor_streams.json Adds fixture for listing streams.
test/fixtures/monitor_streams_1_history.json Adds fixture for stream history.
.github/workflows/e2e-test.yml Adds workflow_dispatch input and passes env var to integration test runner.
.github/workflows/e2e-test-pr.yml Adds workflow_dispatch input and passes env var to integration test runner for PR runs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/e2e-test.yml Outdated
Comment thread linode_api4/objects/monitor.py
Comment thread linode_api4/objects/monitor.py Outdated
sjer-akamai and others added 3 commits April 24, 2026 08:19
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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