summaryrefslogtreecommitdiff
path: root/ick2/projectapi.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-11-19 20:37:56 +0100
committerLars Wirzenius <liw@liw.fi>2017-11-19 20:37:56 +0100
commit999ebc79587ac0e4d12f674e7e8adc09256f525e (patch)
treeba7bf473d758710d835b5cb3e99e51a4aa54d92b /ick2/projectapi.py
parent408a2620b31d61891de0cae78d9e76d60e00b0d8 (diff)
downloadick2-999ebc79587ac0e4d12f674e7e8adc09256f525e.tar.gz
Add: a temporary authz-less trigger endpoint for pipelines
This will be necessary until we have a trigger service.
Diffstat (limited to 'ick2/projectapi.py')
-rw-r--r--ick2/projectapi.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/ick2/projectapi.py b/ick2/projectapi.py
index 71fe5ee..89cad8f 100644
--- a/ick2/projectapi.py
+++ b/ick2/projectapi.py
@@ -40,6 +40,12 @@ class ProjectAPI(ick2.ResourceApiBase):
'path': pipeline_path,
'callback': self.PUT(self.set_pipeline_callback),
},
+ {
+ 'needs-authorization': False,
+ 'method': 'GET',
+ 'path': pipeline_path + '/+trigger',
+ 'callback': self.GET(self.trigger_pipeline),
+ },
]
def get_pipeline(self, project, pipeline):
@@ -71,3 +77,8 @@ class ProjectAPI(ick2.ResourceApiBase):
self._state.update_resource(self._type_name, project, p)
return {'status': state}
raise ick2.NotFound()
+
+ # This needs to go away as it is not protected. Once an IDP is
+ # added.
+ def trigger_pipeline(self, project, pipeline): # pragma: no cover
+ return self.set_pipeline('triggered', project, pipeline)