mirror of
https://github.com/moghtech/komodo.git
synced 2026-03-09 07:13:36 -05:00
[PR #386] [MERGED] Adding a read API endpoint to get container states similar to GetDeploymentsSummary but for all containers that Komodo can see. #730
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/moghtech/komodo/pull/386
Author: @alexshore
Created: 3/28/2025
Status: ✅ Merged
Merged: 3/29/2025
Merged by: @mbecker20
Base:
1.17.1← Head:main📝 Commits (7)
1b6f2f8added GetDockerContainersSummary endpoint in rust apic7b9b78typescript stuff0bca0a5more autogenned typescript stufff9c75cffixed comments to be in line with actual behaviourc47863ffixed ReadResponse for GetDockerContainersSummary73f7e89I64 -> u32 for response types9db8273more accurate error context📊 Changes
7 files changed (+118 additions, -1 deletions)
View changed files
📝
bin/core/src/api/read/mod.rs(+1 -0)📝
bin/core/src/api/read/server.rs(+42 -1)📝
client/core/rs/src/api/read/server.rs(+29 -0)📝
client/core/ts/src/responses.ts(+1 -0)📝
client/core/ts/src/types.ts(+22 -0)📝
frontend/public/client/responses.d.ts(+1 -0)📝
frontend/public/client/types.d.ts(+22 -0)📄 Description
I wanted to create a custom homepage widget for Komodo so I could just see what was running/stopped and a total count but an endpoint like
GetDeploymentsSummaryandGetStacksSummarydidn't exist for all containers.At first, I just made a separate python API (https://github.com/alexshore/komodo-containers-api) but thought this could be a good way to up my contributions to open source software so heres my attempt at contributing a
GetDockerContainersSummaryendpoint :)I'm not too fussed as what counts as what category. For my use-case it's helpful for there really to just be 2 final "states" that the docker containers are categorised into (i.e. just Stopped and Running) but thats a bit more specific to my use-case than to Komodo so right now they're split into Stopped, Running, Unknown and Unhealthy but that can be changed.
I also wasn't sure where in the file to put the new code so I just put it all next to
ListAllDockerContainersas it performs a similar function.Hope this is all good and doesn't need too many more changes! Thanks for your help in discord too :)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.