Aclp logs support#686
Conversation
…ard if stream already exists
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…coped fixture for deterministic execution
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
b2de6cd to
cdf2c04
Compare
|
Added missing signature to the commit, CI fails on lint because of PR title. Should I change it to something specific? |
Just added label to your PR to pass the CI |
a3e0e27 to
d0a00ff
Compare
d0a00ff to
0d07f53
Compare
8ac29af to
b53635e
Compare
| "version": Property(), | ||
| } | ||
|
|
||
| def update_destinations(self, destinations: List[int]): |
There was a problem hiding this comment.
I wonder why is it necessary to have a separate function to update destinations? You can just mark it as a mutable property, and we can handle it as other updatable field.
There was a problem hiding this comment.
It boils down to the API being asymmetric for the destination update - the request takes only a (single element) list of destination ids as opposed to a whole destination object in general. Marking the field as mutable would make the whole LogsStreamDestination mutable and serialized for requests which would fail on API end. I think this was a cleaner solution than having a mutable property and then overriding the save and _serialize - with the mutable property user could call something like stream.destinations[0].label = "new_label" call stream.save() and expect the destination to be modified, but it'll be silently ignored. This version seems to match the actual API capabilities
yec-akamai
left a comment
There was a problem hiding this comment.
Tested and works well locally, nice work!
📝 Description
Adds support for monitor logs functionality
What does this PR do and why is this change necessary?
run_aclp_logs_stream_tests) needs to be set astrueoryesto enable testing the Stream portion of the API.run_aclp_logs_stream_testsenvironment variable.Notes:
✔️ How to Test
How do I run the relevant unit/integration tests?
Unit tests:
pytest test/unitto run all unit tests, or:pytest test/unit/objects/monitor_test.pyto run only monitor related testsIntegration tests:
export LINODE_TOKEN="YOUR_REAL_TOKEN"export RUN_ACLP_LOGS_STREAM_TESTS=truemake TEST_CASE=test_monitor_logs test-intNotes:
Akamai Cloud Pulse Logsaccount capability