Skip to content

Commit

Permalink
Added API for event types
Browse files Browse the repository at this point in the history
  • Loading branch information
Digant C Kasundra committed May 22, 2015
1 parent 9f282cf commit bc25cfe
Show file tree
Hide file tree
Showing 5 changed files with 594 additions and 19 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,18 @@ To get event types, use `/api/v1/eventtypes/`
}
```

To get an individual event_type, use `/api/v1/eventtypes/[id]/`

```
{
id: int,
category: string,
state: string,
description: string,
events: [],
fates: []
}
### Events ###
To get events, use `/api/v1/events/`
Expand Down
5 changes: 4 additions & 1 deletion bin/hermes
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ def list_host_events(args):
logging.error("Could not find hostname %s", args.hostname)
return

events = host.get_latest_events().limit(args.limit).all()
events = (
host.get_latest_events().limit(args.limit)
.from_self().order_by(Event.timestamp).all()
)

print "EVENTS FOR {}:".format(host.hostname)
for event in events:
Expand Down

0 comments on commit bc25cfe

Please sign in to comment.