I am trying to fetch container status using the docker remote API. v1.26
I am making /tasks api call to fetch the list of tasks for a node. Is there a way to get the container status from the GET /tasks json which maps to the "Health":{"Status":"healthy" returned when making /containers/json ?
I am basically looking for a health check equivalent of what /container provides in /tasks api
From this source: https://docs.docker.com/engine/api/v1.26/#operation/ContainerInspect
I think you can get the information you want by using:
In the json returned there are a lot of things, maybe the following is what you are searching for:
edit:
from the
GET /tasks
example, I see 2 different cases:State: running
State: shutdown