A simple status page that displays the current system status and a status history (inspired by GitHub Status).
$ git clone git://github.com/anolson/simple_status.git
$ cd simple_status
$ bundle
$ bundle exec rake db:setup
$ bundle exec rails s
$ bundle exec guard
Get the current status.
Request
$ curl http://localhost:3000/api/current_status \
-u <api_key>:
Response
{
"state": "up",
"last_updated": "2013-06-12T02:29:00Z"
}
Update the current status with a message. Valid states are either up
or down
.
Request
$ curl http://localhost:3000/api/current_status \
-X PUT \
-d state=up \
-d "message[body]=All systems go"
-u <api_key>:
Response
{
"state": "up",
"last_updated": "2013-06-12T02:29:00Z"
}
Simply update the current status last_updated
.
Request
$ curl http://localhost:3000/api/current_status/touch \
-X PUT
-u <api_key>:
Response
{
"state": "up",
"last_updated": "2013-06-12T02:40:27Z"
}
Request
$ curl http://localhost:3000/api/messages \
-X POST \
-d "message[body]=Still performing db maintenance"
-u <api_key>:
Response
{
"body": "Still performing db maintenance",
"created_at": "2013-06-12T03:32:08Z",
"state": "down"
}
Request
$ curl http://localhost:3000/api/messages \
-u <api_key>:
Response
[
{
"body": "Still performing db maintenance",
"created_at": "2013-06-12T03:32:08Z",
"state": "down"
}
]