alter components function
This commit is contained in:
@@ -30,11 +30,6 @@ func Register(ws *restful.WebService, subPath string) {
|
||||
ws.Route(ws.GET(subPath).To(handleGetComponents).Filter(route.RouteLogging)).
|
||||
Consumes(restful.MIME_JSON, restful.MIME_XML).
|
||||
Produces(restful.MIME_JSON)
|
||||
|
||||
ws.Route(ws.GET(subPath+"/{namespace}").To(handleGetComponentsByNamespace).Filter(route.RouteLogging)).
|
||||
Consumes(restful.MIME_JSON, restful.MIME_XML).
|
||||
Produces(restful.MIME_JSON)
|
||||
|
||||
}
|
||||
|
||||
//get all components
|
||||
@@ -54,22 +49,3 @@ func handleGetComponents(request *restful.Request, response *restful.Response) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//get components from ns
|
||||
|
||||
func handleGetComponentsByNamespace(request *restful.Request, response *restful.Response) {
|
||||
|
||||
ns := request.PathParameter("namespace")
|
||||
|
||||
result, err := models.GetComponentsByNamespace(ns)
|
||||
if err != nil {
|
||||
|
||||
response.WriteHeaderAndEntity(http.StatusInternalServerError, constants.MessageResponse{Message: err.Error()})
|
||||
|
||||
} else {
|
||||
|
||||
response.WriteAsJson(result)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user