add api-paas-failwhale

for use when we don't want API to serve any traffic, but paas is still
running. It's a simple nginx_buildpack app that is pushed separately,
and then two makefile commands that toggle the routes (and also
stop/start the nginx app).

For all endpoints/methods it returns a 503, with the response body.

```
{
    "status_code": 503,
    "errors": [
        {
            "error": "PlannedMaintenanceError",
            "message": "We’re performing some essential updates. Notify will be back shortly. Please check https://status.notifications.service.gov.uk/ for more details"
        }
    ]
}
```

NB: If you hit `/` it'll still return 404 - as this is defined in the
paas-proxy instance on aws.
This commit is contained in:
Leo Hemsted
2020-05-11 18:53:52 +01:00
parent 2f8947afde
commit 51511450a2
4 changed files with 93 additions and 0 deletions

27
paas-failwhale/README.md Normal file
View File

@@ -0,0 +1,27 @@
### What is it?
This is a simple static error page to present to API users in case of a (planned) downtime.
It is deployed as an individual app and remains dormant until a route is assigned to it.
It returns a 503 error code and a standard json response for all routes.
### How do I use it?
It should already be deployed, but if not (or if you need to make changes to the nginx config) you can deploy it by running
cf push notify-api-failwhale
To enable it you need to run
make <environment> enable-failwhale
and to disable it
make <environment> disable-failwhale
Where `<environment>` is any of
- preview
- staging
- production