open-horizon / anax

Horizon agent control system
https://open-horizon.github.io/docs/anax/docs/
Apache License 2.0
72 stars 99 forks source link

Add agent APIs/CLIs for deleting eventlog entry from agent database #3996

Open LiilyZhang opened 5 months ago

LiilyZhang commented 5 months ago

We need to add an agent API (and CLI) for deleting the eventlog entry from the agent's database. This allow user to prune the agent database which has been running for long time.

Agent API: DELETE /eventlog?timestamp=<timestamp>&severity=<severity_level>: timestamp: will delete all the eventlog entry before the given timestamp. severity: if specified, only delete entries with given severity level (info, warning, error)

DELETE /eventlog/prune: will delete all the eventlog entries for previous registrations

CLI: hzn eventlog delete -t <timestamp> -s <severity_level> hzn eventlog prune