remove get drainstatus api

This commit is contained in:
yanmingfan
2018-06-21 17:36:05 +08:00
parent cf3b66555b
commit 7bdda2c9d6
2 changed files with 21 additions and 43 deletions

View File

@@ -38,10 +38,6 @@ func Register(ws *restful.WebService, subPath string) {
ws.Route(ws.POST(subPath+"/{nodename}/drainage").To(handleDrainNode).Filter(route.RouteLogging)).
Consumes(restful.MIME_JSON, restful.MIME_XML).
Produces(restful.MIME_JSON)
ws.Route(ws.GET(subPath+"/{nodename}/drainage").To(handleDrainStatus).Filter(route.RouteLogging)).
Consumes(restful.MIME_JSON, restful.MIME_XML).
Produces(restful.MIME_JSON)
}
func MakeRequest(node string, ch chan<- metrics.NodeMetrics) {
@@ -94,20 +90,3 @@ func handleDrainNode(request *restful.Request, response *restful.Response) {
}
}
func handleDrainStatus(request *restful.Request, response *restful.Response) {
nodeName := request.PathParameter("nodename")
result, err := metrics.DrainStatus(nodeName)
if err != nil {
response.WriteHeaderAndEntity(http.StatusInternalServerError, constants.MessageResponse{Message: err.Error()})
} else {
response.WriteAsJson(result)
}
}