Skip to content

Commit

Permalink
Add event reason to /nodes/v2 API
Browse files Browse the repository at this point in the history
  • Loading branch information
freva committed Dec 9, 2024
1 parent 610b2e6 commit 7b50dc3
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ private void toSlime(Collection<History.Event> events, Cursor array) {
object.setString("event", event.type().name());
object.setLong("at", event.at().toEpochMilli());
object.setString("agent", event.agent().name());
event.reason().ifPresent(reason -> object.setString("reason", reason));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
{
"event": "failed",
"at": 123,
"agent": "operator"
"agent": "operator",
"reason": "MockNodeRepository"
},
{
"event": "deprovisioned",
Expand All @@ -76,7 +77,8 @@
{
"event": "failed",
"at": 123,
"agent": "operator"
"agent": "operator",
"reason": "MockNodeRepository"
},
{
"event": "deprovisioned",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
{
"event": "wantToFail",
"at": 123,
"agent": "operator"
"agent": "operator",
"reason": "Failed through the nodes/v2 API"
},
{
"event": "rebooted",
Expand Down Expand Up @@ -135,7 +136,8 @@
{
"event": "wantToFail",
"at": 123,
"agent": "operator"
"agent": "operator",
"reason": "Failed through the nodes/v2 API"
},
{
"event": "rebooted",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
{
"event": "failed",
"at": 123,
"agent": "system"
"agent": "system",
"reason": "MockNodeRepository"
}
],
"log": [
Expand All @@ -70,7 +71,8 @@
{
"event": "failed",
"at": 123,
"agent": "system"
"agent": "system",
"reason": "MockNodeRepository"
}
],
"ipAddresses": ["::5:1", "127.0.5.1"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
{
"event": "failed",
"at": 123,
"agent": "system"
"agent": "system",
"reason": "MockNodeRepository"
}
],
"log": [
Expand All @@ -72,7 +73,8 @@
{
"event": "failed",
"at": 123,
"agent": "system"
"agent": "system",
"reason": "MockNodeRepository"
}
],
"ipAddresses": ["::5:1", "127.0.5.1"],
Expand Down

0 comments on commit 7b50dc3

Please sign in to comment.