def post(self):
        example = {}
        example['example_input'] = {
            'process': {
                'plugins': '[STRING] | NULL',
                'filter': '{STRING : STRING} | NULL'
            }
        }
        example['note'] = (
            'filter is optional key : value pair of plugin parameters '
            'to filter')

        definition = request.get_json(force=True)

        if (not definition or 'process' not in definition
                or not definition['process']):
            abort(400, **example)

        if 'plugins' in definition['process']:
            plugins = definition['process']['plugins']
        else:
            plugins = None

        if 'filter' in definition['process']:
            filter = definition['process']['filter']
        else:
            filter = None

        # If plugins and filter are empty, report bad request
        if not plugins and not filter:
            example['message'] = 'Plugin names or filter have to be set'
            abort(400, **example)

        # Validate input
        if plugins and not isinstance(plugins, list):
            example['message'] = 'Element plugins have to be list'
            abort(400, **example)

        if filter and not isinstance(filter, dict):
            example['message'] = 'Element filter have to be dictionary'
            abort(400, **example)

        try:
            id = smokerd.pluginmgr.add_process(plugins, filter)
        except Exception as e:
            abort(500, message=e.message)

        return print_in_progress(id)
dataset/ETHPy150Open gooddata/smoker/smoker/server/restserver.py/Processes.post/original