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 committed 2021-09-10 15:15:35 +02:00
1 parent 63f6656f8f
commit f87f27ddc8
2 files changed
+10 -3

No files matched your search

+9
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
}
}
+1 -3
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)