Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

REST API: Add event ID to list of chaos events #253

Merged
merged 2 commits into from
May 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public Response getChaosEvents(@Context UriInfo uriInfo) throws IOException {
for (Event evt : evts) {
gen.writeStartObject();
gen.writeStringField("monkeyType", evt.monkeyType().name());
gen.writeStringField("eventId", evt.id());
gen.writeStringField("eventType", evt.eventType().name());
gen.writeNumberField("eventTime", evt.eventTime().getTime());
gen.writeStringField("region", evt.region());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ private MonkeyRecorder.Event mkEvent(String instance) {
final MonkeyType monkeyType = ChaosMonkey.Type.CHAOS;
final EventType eventType = ChaosMonkey.EventTypes.CHAOS_TERMINATION;
// SUPPRESS CHECKSTYLE MagicNumber
return new BasicRecorderEvent(monkeyType, eventType, "region", "id", 1330538400000L)
.addField("instanceId", instance).addField("groupType", "ASG").addField("groupName", "testGroup");
return new BasicRecorderEvent(monkeyType, eventType, "region", instance, 1330538400000L)
.addField("groupType", "ASG").addField("groupName", "testGroup");
}

public static class MockTestChaosMonkeyContext extends TestChaosMonkeyContext {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"monkeyType":"CHAOS","eventType":"CHAOS_TERMINATION","eventTime":1330538400000,"region":"region","groupType":"ASG","groupName":"testGroup","instanceId":"i-123456789012345670"},{"monkeyType":"CHAOS","eventType":"CHAOS_TERMINATION","eventTime":1330538400000,"region":"region","groupType":"ASG","groupName":"testGroup","instanceId":"i-123456789012345671"}]
[{"monkeyType":"CHAOS","eventId":"i-123456789012345670","eventType":"CHAOS_TERMINATION","eventTime":1330538400000,"region":"region","groupType":"ASG","groupName":"testGroup"},{"monkeyType":"CHAOS","eventId":"i-123456789012345671","eventType":"CHAOS_TERMINATION","eventTime":1330538400000,"region":"region","groupType":"ASG","groupName":"testGroup"}]