github.com/containers/podman/v2@v2.2.2-0.20210501105131-c1e07d070c4c/pkg/api/server/register_events.go (about) 1 package server 2 3 import ( 4 "net/http" 5 6 "github.com/containers/podman/v2/pkg/api/handlers/compat" 7 "github.com/gorilla/mux" 8 ) 9 10 func (s *APIServer) registerEventsHandlers(r *mux.Router) error { 11 // swagger:operation GET /events system getEvents 12 // --- 13 // tags: 14 // - system (compat) 15 // summary: Get events 16 // description: Returns events filtered on query parameters 17 // produces: 18 // - application/json 19 // parameters: 20 // - name: since 21 // type: string 22 // in: query 23 // description: start streaming events from this time 24 // - name: until 25 // type: string 26 // in: query 27 // description: stop streaming events later than this 28 // - name: filters 29 // type: string 30 // in: query 31 // description: JSON encoded map[string][]string of constraints 32 // responses: 33 // 200: 34 // description: returns a string of json data describing an event 35 // 500: 36 // "$ref": "#/responses/InternalError" 37 r.Handle(VersionedPath("/events"), s.APIHandler(compat.GetEvents)).Methods(http.MethodGet) 38 // Added non version path to URI to support docker non versioned paths 39 r.Handle("/events", s.APIHandler(compat.GetEvents)).Methods(http.MethodGet) 40 // swagger:operation GET /libpod/events system libpodGetEvents 41 // --- 42 // tags: 43 // - system 44 // summary: Get events 45 // description: Returns events filtered on query parameters 46 // produces: 47 // - application/json 48 // parameters: 49 // - name: since 50 // type: string 51 // in: query 52 // description: start streaming events from this time 53 // - name: until 54 // type: string 55 // in: query 56 // description: stop streaming events later than this 57 // - name: filters 58 // type: string 59 // in: query 60 // description: JSON encoded map[string][]string of constraints 61 // - name: stream 62 // type: boolean 63 // in: query 64 // default: true 65 // description: when false, do not follow events 66 // responses: 67 // 200: 68 // description: returns a string of json data describing an event 69 // 500: 70 // "$ref": "#/responses/InternalError" 71 r.Handle(VersionedPath("/libpod/events"), s.APIHandler(compat.GetEvents)).Methods(http.MethodGet) 72 return nil 73 }