This PR adds support for fetching [rules](https://prometheus.io/docs/prometheus/latest/querying/api/#rules) via the `/api/v1/rules` endpoint using the API client. Currently, the API client exposes no way to do this and it would be nice to have for external systems that wish to retrieve this information.
400 and 422 are documented error codes from Prometheus, so we should
attempt to parse the error returned for both of them.
Needed to change a test that was requiring the old behaviour - made it
use 500 instead of 400.
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit creates a new package to hold the prometheus
v1 API interface. This interface will contain all the funcionality
exposed by Prometheus v1 HTTP API.
The underlying http client is kept on the api package since it
may be reused across diferent API versions and also by the Alertmanager
api package (to come.)