summaryrefslogtreecommitdiff
path: root/ick2/controllerapi.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-11-05 14:59:31 +0100
committerLars Wirzenius <liw@liw.fi>2017-11-05 14:59:31 +0100
commitffece483e11075b20dc6bf0b691aa636d25092a6 (patch)
tree7cda04636478f3c4ee3653cdae7d32baa36d039a /ick2/controllerapi.py
parentf49ebd90e1d16b51da1523c9767c387e59771b41 (diff)
downloadick2-ffece483e11075b20dc6bf0b691aa636d25092a6.tar.gz
Add: GET /projects/foo/builds
Diffstat (limited to 'ick2/controllerapi.py')
-rw-r--r--ick2/controllerapi.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/ick2/controllerapi.py b/ick2/controllerapi.py
index 63daa94..4f2872b 100644
--- a/ick2/controllerapi.py
+++ b/ick2/controllerapi.py
@@ -231,12 +231,18 @@ class ProjectAPI(ResourceApiBase):
def get_pipeline_routes(self, path): # pragma: no cover
pipeline_path = '{}/<project>/pipelines/<pipeline>'.format(path)
+ builds_path = '{}/<project>/builds'.format(path)
return [
{
'method': 'GET',
'path': pipeline_path,
'callback': self.GET(self.get_pipeline),
},
+ {
+ 'method': 'GET',
+ 'path': builds_path,
+ 'callback': self.GET(self.get_builds),
+ },
]
def get_pipeline(self, project, pipeline):
@@ -248,6 +254,13 @@ class ProjectAPI(ResourceApiBase):
}
raise ick2.NotFound()
+ def get_builds(self, project):
+ p = self._state.get_resource(self._type_name, project)
+ return {
+ 'project': project,
+ 'builds': p.get('builds', []),
+ }
+
def response(status_code, body, headers): # pragma: no cover
obj = {