diff --git a/command/agent/acl_endpoint.go b/command/agent/acl_endpoint.go index 07e0016eb..52db96fec 100644 --- a/command/agent/acl_endpoint.go +++ b/command/agent/acl_endpoint.go @@ -19,7 +19,7 @@ func aclDisabled(resp http.ResponseWriter, req *http.Request) (interface{}, erro return nil, nil } -func (s *HTTPServer) ACLDelete(resp http.ResponseWriter, req *http.Request) (interface{}, error) { +func (s *HTTPServer) ACLDestroy(resp http.ResponseWriter, req *http.Request) (interface{}, error) { args := structs.ACLRequest{ Datacenter: s.agent.config.ACLDatacenter, Op: structs.ACLDelete, @@ -27,7 +27,7 @@ func (s *HTTPServer) ACLDelete(resp http.ResponseWriter, req *http.Request) (int s.parseToken(req, &args.Token) // Pull out the acl id - args.ACL.ID = strings.TrimPrefix(req.URL.Path, "/v1/acl/delete/") + args.ACL.ID = strings.TrimPrefix(req.URL.Path, "/v1/acl/destroy/") if args.ACL.ID == "" { resp.WriteHeader(400) resp.Write([]byte("Missing ACL")) diff --git a/command/agent/acl_endpoint_test.go b/command/agent/acl_endpoint_test.go index 2ed53f760..9db7971b4 100644 --- a/command/agent/acl_endpoint_test.go +++ b/command/agent/acl_endpoint_test.go @@ -62,12 +62,12 @@ func TestACLUpdate(t *testing.T) { }) } -func TestACLDelete(t *testing.T) { +func TestACLDestroy(t *testing.T) { httpTest(t, func(srv *HTTPServer) { id := makeTestACL(t, srv) - req, err := http.NewRequest("PUT", "/v1/session/delete/"+id, nil) + req, err := http.NewRequest("PUT", "/v1/session/destroy/"+id, nil) resp := httptest.NewRecorder() - obj, err := srv.ACLDelete(resp, req) + obj, err := srv.ACLDestroy(resp, req) if err != nil { t.Fatalf("err: %v", err) } diff --git a/command/agent/http.go b/command/agent/http.go index 905428f95..43b8019e9 100644 --- a/command/agent/http.go +++ b/command/agent/http.go @@ -102,14 +102,14 @@ func (s *HTTPServer) registerHandlers(enableDebug bool) { if s.agent.config.ACLDatacenter != "" { s.mux.HandleFunc("/v1/acl/create", s.wrap(s.ACLCreate)) s.mux.HandleFunc("/v1/acl/update", s.wrap(s.ACLUpdate)) - s.mux.HandleFunc("/v1/acl/delete/", s.wrap(s.ACLDelete)) + s.mux.HandleFunc("/v1/acl/destroy/", s.wrap(s.ACLDestroy)) s.mux.HandleFunc("/v1/acl/info/", s.wrap(s.ACLGet)) s.mux.HandleFunc("/v1/acl/clone/", s.wrap(s.ACLClone)) s.mux.HandleFunc("/v1/acl/list", s.wrap(s.ACLList)) } else { s.mux.HandleFunc("/v1/acl/create", s.wrap(aclDisabled)) s.mux.HandleFunc("/v1/acl/update", s.wrap(aclDisabled)) - s.mux.HandleFunc("/v1/acl/delete/", s.wrap(aclDisabled)) + s.mux.HandleFunc("/v1/acl/destroy/", s.wrap(aclDisabled)) s.mux.HandleFunc("/v1/acl/info/", s.wrap(aclDisabled)) s.mux.HandleFunc("/v1/acl/clone/", s.wrap(aclDisabled)) s.mux.HandleFunc("/v1/acl/list", s.wrap(aclDisabled))