qbee-agent
qbee-agent copied to clipboard
Add report command to send arbitrary reports from agent
This PR adds a new report command line argument that allows sending arbitrary reports from the qbee agent to the backend system.
New Command Usage
# Send a report with all parameters
qbee-agent report --severity INFO --text "System startup completed" --bundle "system-monitor" --labels "startup,system"
# Using short flags
qbee-agent report -s WARN -t "Disk usage approaching limit" -b "disk-monitor" -l "warning,disk"
# Without optional labels
qbee-agent report --severity ERR --text "Database connection failed" --bundle "db-monitor"
Command Flags
--severity, -s(required): Report severity level - acceptsINFO,WARN,ERR, orCRIT--text, -t(required): Text summary of the report--bundle, -b(required): Bundle name associated with the report--labels, -l(optional): Comma-separated labels for categorization
Implementation Details
The implementation leverages existing report infrastructure:
- Reuses the existing
Reportstruct fromapp/configuration/report.go - Utilizes the existing
/v1/org/device/auth/reportAPI endpoint - Follows the same command pattern as other agent commands
Changes Made
- New:
app/cmd/report.go- Complete report command implementation with validation - Modified:
app/cmd/main.go- Register the new report command - Modified:
app/configuration/service.go- Add publicSendReportmethod to expose existing functionality
The implementation includes proper validation for required flags and severity values, with clear error messages for invalid input.
Fixes #98.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.