MCPcopy Index your code
hub / github.com/uber/aresdb / HandleAQL

Method HandleAQL

api/query_handler.go:75–89  ·  view source on GitHub ↗

HandleAQL swagger:route POST /query/aql queryAQL query in AQL Consumes: - application/json - application/hll Produces: - application/json Responses: default: errorResponse 200: aqlResponse 400: aqlResponse

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

73// 200: aqlResponse
74// 400: aqlResponse
75func (handler *QueryHandler) HandleAQL(w http.ResponseWriter, r *http.Request) {
76 // default device to negative value to differentiate 0 from empty
77 aqlRequest := apiCom.AQLRequest{Device: -1}
78
79 if err := apiCom.ReadRequest(r, &aqlRequest); err != nil {
80 apiCom.RespondWithBadRequest(w, err)
81 utils.GetLogger().With(
82 "error", err,
83 "statusCode", http.StatusBadRequest,
84 ).Error("failed to parse query")
85 return
86 }
87
88 handler.handleAQLInternal(aqlRequest, w, r)
89}
90
91func (handler *QueryHandler) handleAQLInternal(aqlRequest apiCom.AQLRequest, w http.ResponseWriter, r *http.Request) {
92 var err error

Callers

nothing calls this directly

Calls 4

handleAQLInternalMethod · 0.95
GetLoggerFunction · 0.92
ErrorMethod · 0.65
WithMethod · 0.65

Tested by

no test coverage detected