Files
docker-stacks/tests/utils/get_container_health.py
2025-02-21 17:46:43 +00:00

11 lines
384 B
Python

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import docker
from docker.models.containers import Container
def get_health(container: Container) -> str:
api_client = docker.APIClient()
inspect_results = api_client.inspect_container(container.name)
return inspect_results["State"]["Health"]["Status"] # type: ignore