summaryrefslogtreecommitdiff
path: root/ick2/apibase.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-07-23 15:54:14 +0300
committerLars Wirzenius <liw@liw.fi>2018-07-23 15:54:14 +0300
commit12e22b32e6023e06769761788738cd6dc5a9cea3 (patch)
treee6271afa501a88aaa184d1eb7198881a6881877b /ick2/apibase.py
parentcd94b9bb79ef7793ee0e828d04774607621eca3e (diff)
downloadick2-12e22b32e6023e06769761788738cd6dc5a9cea3.tar.gz
Change: allow projects, pipelines, etc, have a foo/bar/baz syntax
Diffstat (limited to 'ick2/apibase.py')
-rw-r--r--ick2/apibase.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ick2/apibase.py b/ick2/apibase.py
index 9e3eaff..b629f68 100644
--- a/ick2/apibase.py
+++ b/ick2/apibase.py
@@ -23,6 +23,7 @@ class APIbase:
self._trans = ick2.TransactionalState(state)
def get_routes(self, path):
+ resource_path = '{}/<name:re:[^/+][^/]*?(/[^/+][^/]*?)*>'.format(path)
return [
{
'method': 'POST',
@@ -36,17 +37,17 @@ class APIbase:
},
{
'method': 'GET',
- 'path': '{}/<name>'.format(path),
+ 'path': resource_path,
'callback': self.GET(self.show),
},
{
'method': 'PUT',
- 'path': '{}/<name>'.format(path),
+ 'path': resource_path,
'callback': self.PUT(self.update),
},
{
'method': 'DELETE',
- 'path': '{}/<name>'.format(path),
+ 'path': resource_path,
'callback': self.DELETE(self.delete),
},
]