diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-11-18 20:45:15 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-11-18 20:45:15 +0100 |
commit | 5f26bbcc37eb4bf78c1ab1e231a55ec98f2e3d4e (patch) | |
tree | c28dba330343abb0b055a1523096558cd23c0c20 /ick2/controllerapi.py | |
parent | ab4060f964f4ec55d0bf671aa85c3f99af9fa21a (diff) | |
download | ick2-5f26bbcc37eb4bf78c1ab1e231a55ec98f2e3d4e.tar.gz |
Refactor: move LogAPI to its own module
Diffstat (limited to 'ick2/controllerapi.py')
-rw-r--r-- | ick2/controllerapi.py | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/ick2/controllerapi.py b/ick2/controllerapi.py index 433d3d0..5d5e86d 100644 --- a/ick2/controllerapi.py +++ b/ick2/controllerapi.py @@ -31,7 +31,7 @@ class ControllerAPI: apis = { '/version': ick2.VersionAPI, '/builds': ick2.BuildsAPI, - '/logs': LogAPI, + '/logs': ick2.LogAPI, '/projects': ProjectAPI, '/work': WorkAPI, '/workers': ick2.WorkerAPI, @@ -46,26 +46,6 @@ class ControllerAPI: return routes -class LogAPI(ick2.ResourceApiBase): # pragma: no cover - - def __init__(self, state): - super().__init__('log', state) - - def get_resource_name(self, resource): - return resource['log'] - - def create(self, body): # pragma: no cover - raise ick2.MethodNotAllowed('Creating builds directly is not allowed') - - def update(self, body, name): # pragma: no cover - raise ick2.MethodNotAllowed('Updating builds directly is not allowed') - - def show(self, name): - log = self._state.get_resource('log', str(name)) - ick2.log.log('info', msg_text='Returning log', log=log) - return log['log'] - - class ProjectAPI(ick2.ResourceApiBase): def __init__(self, state): |