Skip to content

Commit

Permalink
Added a parameter to the fetch-logs endpoint for specifying past dura…
Browse files Browse the repository at this point in the history
…tions.
  • Loading branch information
eriq-augustine committed Mar 5, 2024
1 parent c4e4c5d commit efcfa90
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
4 changes: 4 additions & 0 deletions autograder/api/admin/fetchlogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
'If supplied, only return log records after this datetime (as an RFC3339 string).',
required = False),

autograder.api.config.APIParam('past',
'If supplied, only return log records in this duration (using "h", "m", or "s" suffixes) (e.g., "24h", "10m", or "1h10m10s").',
required = False),

autograder.api.config.APIParam('assignment-id',
'If supplied, only return log records for this assignment.',
required = False),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"output": {
"success": false,
"error-messages": [
"Unknown assignment given for 'assignment' componet of log query ('ZZZ')."
"Unknown assignment given for 'assignment' component of log query ('ZZZ')."
],
"results": null
}
Expand Down
15 changes: 15 additions & 0 deletions tests/api/data/test_admin_fetch_logs_past_empty.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"endpoint": "admin/fetch/logs",
"arguments": {
"course": "course-without-source",
"level": "ERROR",
"past": "24h"
},
"output-modifier": "clean_output_logs",
"output": {
"success": true,
"error-messages": null,
"results": [
]
}
}

0 comments on commit efcfa90

Please sign in to comment.