diff options
Diffstat (limited to 'ick2/pipelineapi.py')
-rw-r--r-- | ick2/pipelineapi.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ick2/pipelineapi.py b/ick2/pipelineapi.py index 22db2b8..da774d4 100644 --- a/ick2/pipelineapi.py +++ b/ick2/pipelineapi.py @@ -23,3 +23,21 @@ class PipelineAPI(ick2.ResourceApiBase): def get_resource_name(self, resource): return resource.get('pipeline') + + def create(self, body, **kwargs): + resource = self.mangle_new_resource(body) + + actions = resource.get('actions', []) + for action in actions: + where = action.get('where') + if where is None: + raise NoWhere(action) + + return super().create(body, **kwargs) + + +class NoWhere(Exception): + + def __init__(self, action): + super().__init__( + 'Every action MUST specify a "where": {}'.format(action)) |