mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-09 19:15:58 +08:00
Add endpoint for inspecting the MDM command queue (#895)
This commit is contained in:
@@ -11,6 +11,7 @@ type Endpoints struct {
|
||||
NewCommandEndpoint endpoint.Endpoint
|
||||
NewRawCommandEndpoint endpoint.Endpoint
|
||||
ClearQueueEndpoint endpoint.Endpoint
|
||||
ViewQueueEndpoint endpoint.Endpoint
|
||||
}
|
||||
|
||||
func MakeServerEndpoints(s Service, outer endpoint.Middleware, others ...endpoint.Middleware) Endpoints {
|
||||
@@ -18,10 +19,19 @@ func MakeServerEndpoints(s Service, outer endpoint.Middleware, others ...endpoin
|
||||
NewCommandEndpoint: endpoint.Chain(outer, others...)(MakeNewCommandEndpoint(s)),
|
||||
NewRawCommandEndpoint: endpoint.Chain(outer, others...)(MakeNewRawCommandEndpoint(s)),
|
||||
ClearQueueEndpoint: endpoint.Chain(outer, others...)(MakeClearQueueEndpoint(s)),
|
||||
ViewQueueEndpoint: endpoint.Chain(outer, others...)(MakeViewQueueEndpoint(s)),
|
||||
}
|
||||
}
|
||||
|
||||
func RegisterHTTPHandlers(r *mux.Router, e Endpoints, options ...httptransport.ServerOption) {
|
||||
// GET /v1/commands/udid View device queue.
|
||||
r.Methods("GET").Path("/v1/commands/{udid}").Handler(httptransport.NewServer(
|
||||
e.ViewQueueEndpoint,
|
||||
decodeViewQueueRequest,
|
||||
httputil.EncodeJSONResponse,
|
||||
options...,
|
||||
))
|
||||
|
||||
// POST /v1/commands Add new MDM Command to device queue.
|
||||
r.Methods("POST").Path("/v1/commands").Handler(httptransport.NewServer(
|
||||
e.NewCommandEndpoint,
|
||||
|
||||
Reference in New Issue
Block a user