Adds pause and unpause-commands
Signed-off-by: Frank Sachsenheim <funkyfuture@riseup.net>
This commit is contained in:
parent
59d024f4f2
commit
227584b864
10 changed files with 147 additions and 4 deletions
|
|
@ -100,6 +100,8 @@ class Container(object):
|
|||
|
||||
@property
|
||||
def human_readable_state(self):
|
||||
if self.is_paused:
|
||||
return 'Paused'
|
||||
if self.is_running:
|
||||
return 'Ghost' if self.get('State.Ghost') else 'Up'
|
||||
else:
|
||||
|
|
@ -119,6 +121,10 @@ class Container(object):
|
|||
def is_running(self):
|
||||
return self.get('State.Running')
|
||||
|
||||
@property
|
||||
def is_paused(self):
|
||||
return self.get('State.Paused')
|
||||
|
||||
def get(self, key):
|
||||
"""Return a value from the container or None if the value is not set.
|
||||
|
||||
|
|
@ -142,6 +148,12 @@ class Container(object):
|
|||
def stop(self, **options):
|
||||
return self.client.stop(self.id, **options)
|
||||
|
||||
def pause(self, **options):
|
||||
return self.client.pause(self.id, **options)
|
||||
|
||||
def unpause(self, **options):
|
||||
return self.client.unpause(self.id, **options)
|
||||
|
||||
def kill(self, **options):
|
||||
return self.client.kill(self.id, **options)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue