32 lines
665 B
Python
32 lines
665 B
Python
#!/usr/bin/env python3
|
|
from flask import request, jsonify, current_app, abort, Response
|
|
from flask_classful import FlaskView, route
|
|
|
|
from utils import json_required
|
|
|
|
from marshmallow.exceptions import ValidationError
|
|
|
|
from schemas import JobSchema
|
|
|
|
|
|
class JobView(FlaskView):
|
|
job_schema = JobSchema(many=False)
|
|
jobs_schema = JobSchema(many=True, exclude=['controllers'])
|
|
|
|
def index(self):
|
|
# List all jobs
|
|
pass
|
|
|
|
def get(self, _id: str):
|
|
# Get info about a job
|
|
pass
|
|
|
|
@json_required
|
|
def post(self):
|
|
# Start (schedule) a job
|
|
pass
|
|
|
|
def delete(self, _id: str):
|
|
# stop a job
|
|
pass
|