Adjust the documentation. Rename endpoint to recalculate-caches

This commit is contained in:
Travis 2017-10-11 10:56:30 -05:00
parent 5418dc152e
commit a7ec49c6ad
No known key found for this signature in database
GPG key ID: 7F08008DFD9314C9
3 changed files with 7 additions and 5 deletions

View file

@ -414,12 +414,14 @@ Response:
### Recalculate Caches
`POST /recalculatecaches`
`POST /recalculate-caches`
Recalculates the caches on demand. The cache is recalculated every 10
secondes by default. This endpoint can be used to recalculate the cache
seconds by default. This endpoint can be used to recalculate the cache
before the 10 second interval. This should probably only be used in
integration tests and not in a typical production workflow.
integration tests and not in a typical production workflow. Note that
in a multi-node cluster, the cache is only recalculated on the node
that receives the request.
Response: `204 No Content`

View file

@ -134,7 +134,7 @@ func NewRouter(handler *Handler) *mux.Router {
router.HandleFunc("/slices/max", handler.handleGetSliceMax).Methods("GET")
router.HandleFunc("/status", handler.handleGetStatus).Methods("GET")
router.HandleFunc("/version", handler.handleGetVersion).Methods("GET")
router.HandleFunc("/recalculatecaches", handler.handleRecalculateCaches).Methods("POST")
router.HandleFunc("/recalculate-caches", handler.handleRecalculateCaches).Methods("POST")
// TODO: Apply MethodNotAllowed statuses to all endpoints.
// Ideally this would be automatic, as described in this (wontfix) ticket:

View file

@ -1792,7 +1792,7 @@ func TestHandler_RecalculateCaches(t *testing.T) {
h.Cluster = test.NewCluster(1)
w := httptest.NewRecorder()
h.ServeHTTP(w, test.MustNewHTTPRequest("POST", "/recalculatecaches", nil))
h.ServeHTTP(w, test.MustNewHTTPRequest("POST", "/recalculate-caches", nil))
if w.Code != http.StatusNoContent {
t.Fatalf("unexpected status code: %d", w.Code)
}