diff options
author | Jelle van der Waa <jvanderwaa@redhat.com> | 2021-09-09 17:39:52 +0200 |
---|---|---|
committer | Jelle van der Waa <jvanderwaa@redhat.com> | 2021-09-10 15:15:35 +0200 |
commit | f87f27ddc865c8feee2d5a6c0e2129d6efa9cc22 (patch) | |
tree | 6ef23a30ddf3c1a5ff66a34aae93eb81cc83cc78 /pkg/api | |
parent | 63f6656f8fa79d7f6e01379d7ba0aa4ab3c03b37 (diff) | |
download | podman-f87f27ddc865c8feee2d5a6c0e2129d6efa9cc22.tar.gz podman-f87f27ddc865c8feee2d5a6c0e2129d6efa9cc22.tar.bz2 podman-f87f27ddc865c8feee2d5a6c0e2129d6efa9cc22.zip |
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>
Diffstat (limited to 'pkg/api')
-rw-r--r-- | pkg/api/handlers/swagger/swagger.go | 9 | ||||
-rw-r--r-- | pkg/api/server/register_containers.go | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/pkg/api/handlers/swagger/swagger.go b/pkg/api/handlers/swagger/swagger.go index 2296eea3a..9844839b7 100644 --- a/pkg/api/handlers/swagger/swagger.go +++ b/pkg/api/handlers/swagger/swagger.go @@ -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 + } +} diff --git a/pkg/api/server/register_containers.go b/pkg/api/server/register_containers.go index 2a32966cc..8dcea1301 100644 --- a/pkg/api/server/register_containers.go +++ b/pkg/api/server/register_containers.go @@ -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) |