dockercloud

This commit is contained in:
tifayuki 2016-01-14 13:12:51 +01:00
commit 2d9586a8a1
41 changed files with 2701 additions and 2 deletions

23
dockercloud/api/action.py Normal file
View file

@ -0,0 +1,23 @@
from __future__ import absolute_import
from .base import Immutable, StreamingLog
class Action(Immutable):
subsystem = 'audit'
endpoint = "/action"
@classmethod
def _pk_key(cls):
return 'uuid'
def logs(self, tail, follow, log_handler=StreamingLog.default_log_handler):
logs = StreamingLog(self.subsystem, self.endpoint, self.pk, tail, follow)
logs.on_message(log_handler)
logs.run_forever()
def cancel(self):
return self._perform_action("cancel")
def retry(self):
return self._perform_action("retry")