Skip to content

Commit f0d38fb

Browse files
authored
Add health property to Containers model
Signed-off-by: Jay Turner <jay.turner@kayenta.io>
1 parent 84414e3 commit f0d38fb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docker/models/containers.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ def status(self):
6262
return self.attrs['State']['Status']
6363
return self.attrs['State']
6464

65+
@property
66+
def health(self):
67+
"""
68+
The healthcheck status of the container. For example, ``healthy`, or ``unhealthy`.
69+
"""
70+
return self.attrs.get('State', {}).get('Health', {}).get('Status', 'unknown')
71+
6572
@property
6673
def ports(self):
6774
"""

0 commit comments

Comments
 (0)