diff --git a/inventory_provider/routes/jobs.py b/inventory_provider/routes/jobs.py index 618a8e776d5c55d50edee32b29c258636fcff7fb..02e778ab4b0bd8d4b85fc44ae79dd33c663701f8 100644 --- a/inventory_provider/routes/jobs.py +++ b/inventory_provider/routes/jobs.py @@ -1,10 +1,12 @@ from flask import Blueprint, Response, current_app, jsonify from inventory_provider.tasks import worker +from inventory_provider.routes import common routes = Blueprint("inventory-data-job-routes", __name__) @routes.route("/update", methods=['GET', 'POST']) +@common.require_accepts_json def update(): job_ids = worker.launch_refresh_cache_all( current_app.config["INVENTORY_PROVIDER_CONFIG"]) @@ -18,11 +20,13 @@ def update_interface_statuses(): @routes.route("reload-router-config/<equipment_name>", methods=['GET', 'POST']) +@common.require_accepts_json def reload_router_config(equipment_name): result = worker.reload_router_config.delay(equipment_name) return jsonify([result.id]) @routes.route("check-task-status/<task_id>", methods=['GET', 'POST']) +@common.require_accepts_json def check_task_status(task_id): return jsonify(worker.check_task_status(task_id))