Esempio n. 1
0
    def pipelines_create(project_uuid):

        pipeline_path = request.json["pipeline_path"]
        pipeline_name = request.json["name"]

        try:
            with TwoPhaseExecutor(db.session) as tpe:
                CreatePipeline(tpe).transaction(project_uuid, pipeline_name,
                                                pipeline_path)
        except Exception as e:
            return jsonify({"message": str(e)}), 409

        return jsonify({"success": True})
Esempio n. 2
0
    def pipelines_create(project_uuid):

        pipeline_path = request.json["pipeline_path"]
        pipeline_name = request.json["name"]

        try:
            with TwoPhaseExecutor(db.session) as tpe:
                CreatePipeline(tpe).transaction(
                    project_uuid, pipeline_name, pipeline_path
                )
        except FileExistsError:
            return (
                jsonify({"message": "A pipeline with the given path already exists."}),
                400,
            )
        except Exception as e:
            return jsonify({"message": str(e)}), 409

        return jsonify({"success": True})