github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/pkg/api/server/register_ping.go (about) 1 package server 2 3 import ( 4 "net/http" 5 6 "github.com/hanks177/podman/v4/pkg/api/handlers/compat" 7 "github.com/gorilla/mux" 8 ) 9 10 func (s *APIServer) registerPingHandlers(r *mux.Router) error { 11 r.Handle("/_ping", s.APIHandler(compat.Ping)).Methods(http.MethodGet, http.MethodHead) 12 r.Handle(VersionedPath("/_ping"), s.APIHandler(compat.Ping)).Methods(http.MethodGet, http.MethodHead) 13 // swagger:operation GET /libpod/_ping libpod SystemPing 14 // --- 15 // summary: Ping service 16 // description: | 17 // Return protocol information in response headers. 18 // `HEAD /libpod/_ping` is also supported. 19 // `/_ping` is available for compatibility with other engines. 20 // The '_ping' endpoints are not versioned. 21 // tags: 22 // - system (compat) 23 // - system 24 // produces: 25 // - text/plain 26 // responses: 27 // 200: 28 // description: Success 29 // schema: 30 // description: OK 31 // type: string 32 // example: "OK" 33 // headers: 34 // API-Version: 35 // type: string 36 // description: Max compatibility API Version the server supports 37 // BuildKit-Version: 38 // type: string 39 // description: Default version of docker image builder 40 // Docker-Experimental: 41 // type: boolean 42 // description: If the server is running with experimental mode enabled, always true 43 // Cache-Control: 44 // type: string 45 // description: always no-cache 46 // Pragma: 47 // type: string 48 // description: always no-cache 49 // Libpod-API-Version: 50 // type: string 51 // description: | 52 // Max Podman API Version the server supports. 53 // Available if service is backed by Podman, therefore may be used to 54 // determine if talking to Podman engine or another engine 55 // Libpod-Buildah-Version: 56 // type: string 57 // description: | 58 // Default version of libpod image builder. 59 // Available if service is backed by Podman, therefore may be used to 60 // determine if talking to Podman engine or another engine 61 // 500: 62 // $ref: "#/responses/internalError" 63 r.Handle("/libpod/_ping", s.APIHandler(compat.Ping)).Methods(http.MethodGet, http.MethodHead) 64 r.Handle(VersionedPath("/libpod/_ping"), s.APIHandler(compat.Ping)).Methods(http.MethodGet, http.MethodHead) 65 return nil 66 }