mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-09-01 05:07:50 +00:00
As I've mentioned once or twice, hand-maintained swagger docs
are evil. This commit attempts to fix:
* Inconsistent methods (swagger says POST but code signature
says GET)
* Inconsistent capitalization
* Typos ("Mounter", "pood")
* Completely wrong paths (/inspect vs /json)
* Missing .Method() registrations
* Missing /libpod in some /volumes paths
* Incorrect method declaration: /libpod/containers/.../kill
was correct (POST) in swagger but wrong in the code itself
(http.MethodGet). Correct the latter to MethodPost
This is two hours' work, even with a script I have that
tries to cross-check everything.
Swagger docs should not be human-maintained.
Signed-off-by: Ed Santiago <santiago@redhat.com>
39 lines
1 KiB
Go
39 lines
1 KiB
Go
package server
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/containers/libpod/pkg/api/handlers"
|
|
"github.com/gorilla/mux"
|
|
)
|
|
|
|
func (s *APIServer) registerEventsHandlers(r *mux.Router) error {
|
|
// swagger:operation GET /events system getEvents
|
|
// ---
|
|
// tags:
|
|
// - system
|
|
// summary: Returns events filtered on query parameters
|
|
// 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(handlers.GetEvents)).Methods(http.MethodGet)
|
|
return nil
|
|
}
|