podman-py
podman-py copied to clipboard
No support for fetching stats of all containers
Current Scenario
podman-py
currently does not directly provide any means to fetch the stats of all containers.
But this is allowed in as per the Podman REST API.
Note that the containers
parameter can take in multiple IDs or no ID to return data for all containers.
The current method that uses this API Container.stats
does not allow such actions.
Proposed Solution
I propose to add an additional stats
method under ContainerManager
that would optionally take in cointainer_ids and stream the results.
Shall I go ahead and make a PR for this with the required changes or are there any other ways to implement this that would be considered better?
@RazCrimson was this solved with your PR? (#237), or are there more bits to chase here?
No, it not done. @TomSweeneyRedHat
My earlier PR was on Container.stats
(stats for one container), but this issue is for a new but similar method under ContainerManager
to stream stats for all containers.
Would it be fine to raise a PR to add that?
Also something else I noticed after I created this issue is that, there is no support to stream pod stats. PodManager.stats
seems to be returning immediately (just one single response).
The latest podman docs mentions that it supports live streaming for pod stats but the API endpoint doesn't accept any stream
params. Not sure if that is an inconsistency with the documentation. Will check and update here.
Thanks for the clarification @RazCrimson . FWIW, PR's are always gratefully accepted!
@RazCrimson thank yo for your contributions! Did your PRs address this issue or is there still some work left?