Beispiel #1
0
    def post(self):
        args = parser.parse_args()
        pipeline = Pipeline.find(args['pipeline_id'])

        if pipeline.is_blocked():
            return {
                'message':
                'Creating new jobs for active pipeline is unavailable'
            }, 422

        job = Job(args['name'], args['worker_class'], args['pipeline_id'])
        job.assign_attributes(args)
        job.save()
        job.save_relations(args)
        return job, 201
Beispiel #2
0
    def post(self):
        args = parser.parse_args()
        pipeline = Pipeline.find(args['pipeline_id'])

        if pipeline.is_blocked():
            return {
                'message':
                'Creating new jobs for active pipeline is unavailable'
            }, 422

        job = Job(args['name'], args['worker_class'], args['pipeline_id'])
        job.assign_attributes(args)
        job.save()
        job.save_relations(args)
        tracker = insight.GAProvider()
        tracker.track_event(category='jobs',
                            action='create',
                            label=args['worker_class'])
        return job, 201