summaryrefslogtreecommitdiff
path: root/pkg/api/server/register_events.go
blob: b0f403709aafd60a8f658c12d98934ea71bc2376 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package server

import (
	"net/http"

	"github.com/containers/libpod/pkg/api/handlers/compat"
	"github.com/gorilla/mux"
)

func (s *APIServer) registerEventsHandlers(r *mux.Router) error {
	// swagger:operation GET /events system getEvents
	// ---
	// tags:
	//   - system (compat)
	// summary: Get events
	// description: Returns events filtered on query parameters
	// produces:
	// - application/json
	// parameters:
	// - name: since
	//   type: string
	//   in: query
	//   description: start streaming events from this time
	// - name: until
	//   type: string
	//   in: query
	//   description: stop streaming events later than this
	// - name: filters
	//   type: string
	//   in: query
	//   description: JSON encoded map[string][]string of constraints
	// responses:
	//   200:
	//     description: returns a string of json data describing an event
	//   500:
	//     "$ref": "#/responses/InternalError"
	r.Handle(VersionedPath("/events"), s.APIHandler(compat.GetEvents)).Methods(http.MethodGet)
	// Added non version path to URI to support docker non versioned paths
	r.Handle("/events", s.APIHandler(compat.GetEvents)).Methods(http.MethodGet)
	// swagger:operation GET /libpod/events system libpodGetEvents
	// ---
	// tags:
	//   - system
	// summary: Get events
	// description: Returns events filtered on query parameters
	// produces:
	// - application/json
	// parameters:
	// - name: since
	//   type: string
	//   in: query
	//   description: start streaming events from this time
	// - name: until
	//   type: string
	//   in: query
	//   description: stop streaming events later than this
	// - name: filters
	//   type: string
	//   in: query
	//   description: JSON encoded map[string][]string of constraints
	// responses:
	//   200:
	//     description: returns a string of json data describing an event
	//   500:
	//     "$ref": "#/responses/InternalError"
	r.Handle(VersionedPath("/events"), s.APIHandler(compat.GetEvents)).Methods(http.MethodGet)
	return nil
}