summaryrefslogtreecommitdiff
path: root/ick2/controllerapi.py
diff options
context:
space:
mode:
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 = {