bolshakov / stoplight-admin

A simple administration interface for the stoplight gem.
http://bolshakov.github.io/stoplight-admin
MIT License
18 stars 18 forks source link

Add a json interface to retrieve the light statuses #12

Closed rogierslag closed 8 years ago

rogierslag commented 9 years ago

Small addition, but useful for automatic monitoring of our infrastructure. This allows us to poll using an HTTP api, instead of fiddling with Redis directly.

In this case I opted for the following format since it easier for most clients to consume compared to the nested approach, whereas it gives all information in one call

{
    "stats": {
        "count_red": 0,
        "count_yellow": 0,
        "count_green": 1,
        "percent_red": 0,
        "percent_yellow": 0,
        "percent_green": 100
    },
    "lights": [
        {
            "name": "ElasticSearch",
            "color": "green",
            "failures": [],
            "locked": false
        }
    ]
}
tfausak commented 8 years ago

Sorry! I just saw this pull request. For some reason I did not receive a notification.

This looks like a good addition. I think this could be a good first step toward doing all of the user interface with something like React. Regardless, this is something stoplight-admin should probably provide. Thanks!

tfausak commented 8 years ago

Released in v0.3.0.