github.com/containers/libpod@v1.9.4-0.20220419124438-4284fd425507/pkg/api/server/register_healthcheck.go (about)

     1  package server
     2  
     3  import (
     4  	"net/http"
     5  
     6  	"github.com/containers/libpod/pkg/api/handlers/libpod"
     7  	"github.com/gorilla/mux"
     8  )
     9  
    10  func (s *APIServer) registerHealthCheckHandlers(r *mux.Router) error {
    11  	// swagger:operation GET /libpod/containers/{name:.*}/healthcheck libpod libpodRunHealthCheck
    12  	// ---
    13  	// tags:
    14  	//  - containers
    15  	// summary: Run a container's healthcheck
    16  	// description: Execute the defined healthcheck and return information about the results
    17  	// parameters:
    18  	//  - in: path
    19  	//    name: name:.*
    20  	//    type: string
    21  	//    required: true
    22  	//    description: the name or ID of the container
    23  	// produces:
    24  	// - application/json
    25  	// responses:
    26  	//   200:
    27  	//     $ref: "#/responses/HealthcheckRun"
    28  	//   404:
    29  	//     $ref: "#/responses/NoSuchContainer"
    30  	//   409:
    31  	//     description: container has no healthcheck or is not running
    32  	//   500:
    33  	//     $ref: '#/responses/InternalError'
    34  	r.Handle(VersionedPath("/libpod/containers/{name:.*}/healthcheck"), s.APIHandler(libpod.RunHealthCheck)).Methods(http.MethodGet)
    35  	return nil
    36  }