diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-10-16 19:00:20 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-10-16 19:00:20 +0300 |
commit | 0238440bc56c7658feb658614644dd2223a86838 (patch) | |
tree | 9cf997dfa72a96ed50a154f343c1022e4444dc2e /ick2/controllerapi.py | |
parent | 9ea6166068fd33b5fb3cec532ca14564c9b8673f (diff) | |
download | ick2-0238440bc56c7658feb658614644dd2223a86838.tar.gz |
Add: /workers endpoint
Diffstat (limited to 'ick2/controllerapi.py')
-rw-r--r-- | ick2/controllerapi.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ick2/controllerapi.py b/ick2/controllerapi.py index aa0871b..6d25a7d 100644 --- a/ick2/controllerapi.py +++ b/ick2/controllerapi.py @@ -34,6 +34,7 @@ class ControllerAPI: apis = { '/version': VersionAPI, '/projects': ProjectAPI, + '/workers': WorkerAPI, } routes = [] @@ -208,6 +209,15 @@ class ProjectAPI(SubAPI): return resource['project'] +class WorkerAPI(SubAPI): # pragma: no cover + + def __init__(self, state): + super().__init__('workers', state) + + def get_resource_name(self, resource): + return resource['worker'] + + def response(status_code, body, headers): # pragma: no cover obj = { 'status': status_code, |