Repository navigation
Feature/redfish clear logs - #310
amd-ansonyim wants to merge 5 commits into
Conversation
Adds opt-in post-collection log clearing to RedfishEndpointCollector via a new clear_log_uris collection arg. Each URI is POSTed with an empty body after all GETs succeed. Failures downgrade the result to WARNING without affecting the collected data. New utility module nodescraper/connection/redfish/redfish_clear_log.py provides discovery (discover_clear_log_endpoints) and execution (clear_redfish_logs) following ARC's RedfishTool pattern: - Skips OverWritePolicy=NeverOverWrites stores - Continues on individual failures - Includes BMC response body in error messages for diagnosis Base layer additions: - RedfishPostResult model (mirrors RedfishGetResult) - RedfishDataCollector._run_redfish_post() helper New collection_args fields: - clear_log_uris: list[str] - explicit ClearLog action URIs to POST to Result message format: Collected N endpoint(s)[; cleared M log store(s)][; K log store(s) failed to clear] Tests: 43 new unit tests across test_redfish_clear_log.py and test_redfish_endpoint_collector.py.
| le=3600, | ||
| description="Max seconds to wait for each CollectDiagnosticData task.", | ||
| ) | ||
| clear_logs_after_collection: bool = Field( |
There was a problem hiding this comment.
A couple of behavior changes are needed for this functionality: clear_logs_after_collection runs after any successful collection, but the AMC path then clears every ClearLog store under the configured managers and systems, including stores that were not collected and collections that failed in the same run. The OEM path does the same for its log service when only one diagnostic type succeeds. Clear only the log service whose collection fully succeeded.
There was a problem hiding this comment.
Switched AMC collector to only clear successful log pulls.
OEM will discuss internally
| path = endpoint.path | ||
| try: | ||
| resp = conn.post(path, json={}) | ||
| success = resp.ok |
There was a problem hiding this comment.
FYI i think OK is a 202 which is accepted not completed or finished (204 or 200) i think this needs some rework
There was a problem hiding this comment.
Switched to accept 200, 202, 204
Summary
LogService.ClearLogon event-type services (EventLog, FaultLog, Journal) clears accumulated entries — effective for deduplicationLogService.ClearLogon dump/diagnostic services (DiagLogs, Dump, Manager) clears bundle entry references; the nextCollectDiagnosticDataproduces a fresh dump from current system stateTest plan
pytest test/unitpytest test/functional(if applicable)pre-commit run --all-filesChecklist