Skip to content

Feature/redfish clear logs - #310

Open
amd-ansonyim wants to merge 4 commits into
developmentfrom
feature/redfish_clear_logs
Open

amd-ansonyim wants to merge 4 commits into
developmentfrom
feature/redfish_clear_logs

Conversation

@amd-ansonyim

Copy link
Copy Markdown
Collaborator

Summary

  • OOB Redfish collectors currently pull log data but do not clear the log stores afterward. This means subsequent pulls collect the same data. This PR adds opt-in, post-collection clearing via LogService.ClearLog to all three OOB Redfish plugins (RedfishEndpointPlugin, RedfishOemDiagPlugin, AmcRedfishDiagPlugin).
  • Updated PLUGIN_DOC (note: AmcRedfishDiagPlugin is absent from PLUGIN_DOC.md — pre-existing limitation of the doc generator [the plugin inherits from DataPlugin directly rather than OOBandDataPlugin, so the OOB discovery loop does not find it])
  • LogService.ClearLog on event-type services (EventLog, FaultLog, Journal) clears accumulated entries — effective for deduplication
  • LogService.ClearLog on dump/diagnostic services (DiagLogs, Dump, Manager) clears bundle entry references; the next CollectDiagnosticData produces a fresh dump from current system state

Test plan

  • pytest test/unit
  • pytest test/functional (if applicable)
  • pre-commit run --all-files

Checklist

  • Added/updated tests (or explained why not)
  • Updated docs/README if behavior changed
  • No secrets or credentials committed

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.
@github-actions github-actions Bot added documentation Improvements or additions to documentation tests framework plugins-ooband labels Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation framework plugins-ooband tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant