// delete a task func deleteAlert(res http.ResponseWriter, req *http.Request) { // BUG(glinton) ids are not unique enough for the same stat to be used with different tag sets // todo: make id more unique, for use with same stat, multiple tags taskId := req.URL.Query().Get(":id") err := kapacitor.DeleteTask(taskId) if err != nil { writeBody(apiError{ErrorString: err.Error()}, res, http.StatusBadRequest, req) return } writeBody(apiMsg{"Success"}, res, http.StatusOK, req) }
func TestDeleteTask(t *testing.T) { err := kapacitor.DeleteTask(stat) if err != nil { t.Errorf("Failed to delete task - %v", err) } }