Add health property to Containers model

Signed-off-by: Jay Turner <jay.turner@kayenta.io>
This commit is contained in:
Jay Turner 2023-06-27 12:51:40 +01:00 committed by GitHub
parent 84414e343e
commit f0d38fb7f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -62,6 +62,13 @@ class Container(Model):
return self.attrs['State']['Status']
return self.attrs['State']
@property
def health(self):
"""
The healthcheck status of the container. For example, ``healthy`, or ``unhealthy`.
"""
return self.attrs.get('State', {}).get('Health', {}).get('Status', 'unknown')
@property
def ports(self):
"""