Add /containers/stats response to API docs

Include the response schema for a succesful request in the
/containers/stats API documentation

Additionally remove http 409 from /libpod/containers/stats docs, the
documentation was copied from the deprecated stats endpoint, when a
container is unavailabe the endpoint returns an empty list and no 409.

Signed-off-by: Jelle van der Waa <jvanderwaa@redhat.com>
This commit is contained in:
Jelle van der Waa
2021-09-09 17:39:52 +02:00
parent 63f6656f8f
commit f87f27ddc8
2 changed files with 10 additions and 3 deletions

View File

@ -176,3 +176,12 @@ type swagInspectPodResponse struct {
define.InspectPodData
}
}
// Get stats for one or more containers
// swagger:response ContainerStats
type swagContainerStatsResponse struct {
// in:body
Body struct {
define.ContainerStats
}
}

View File

@ -1124,11 +1124,9 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// - application/json
// responses:
// 200:
// description: no error
// $ref: "#/responses/ContainerStats"
// 404:
// $ref: "#/responses/NoSuchContainer"
// 409:
// $ref: "#/responses/ConflictError"
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/stats"), s.APIHandler(libpod.StatsContainer)).Methods(http.MethodGet)