Service status web service with RESTful API
- Get list of services for which status is available
- Get current status of requested service
- (Roadmap) Get historical service status data for date range
- (Roadmap) Plugins for new services
- Structure code as per http://docs.python-guide.org/en/latest/writing/structure/ and the repo structure as per kenneth reitz (next time I'll have to fork it first, but do it manually this time for the learning experience)
- Tests, tests write some tests. Plan to use pytest.
- Initial service is the status-service itself
- Simple GET only service status (ie reqs 1 and 2)
- No fancy stuff like authentication/authorisation, let's just get it working
- Deploy to AWS
- GET /services
- returns JSON:
{
"services": ["status-service","ip-service","time-service"]
}
- GET /services/service-name
- return JSON
{
"service" : "service-name",
"status": "up" | "down",
"datetime": "datetime-string"
}
Error condition, if doesn't exist, return a 404 error.
Since I'll use a TDD approach, and start with unit tests obviously, I'll structure the resource to use at least one function to check itself (eg making sure there's no runtime exceptions) as that's about the only way we can reasonably have a service that reports that it's down! So we'll have a function called isUp() within the resource, and unless it raises an exception, it will return as being Up. I'll have to work out how to test using mocks or whatever on the actual API.