Set value of option(s) for a certain task ID
(taskid)
| 476 | |
| 477 | @post("/option/<taskid>/set") |
| 478 | def option_set(taskid): |
| 479 | """ |
| 480 | Set value of option(s) for a certain task ID |
| 481 | """ |
| 482 | |
| 483 | if taskid not in DataStore.tasks: |
| 484 | logger.warning("[%s] Invalid task ID provided to option_set()" % taskid) |
| 485 | return jsonize({"success": False, "message": "Invalid task ID"}) |
| 486 | |
| 487 | if request.json is None: |
| 488 | logger.warning("[%s] Invalid JSON options provided to option_set()" % taskid) |
| 489 | return jsonize({"success": False, "message": "Invalid JSON options"}) |
| 490 | |
| 491 | for option, value in request.json.items(): |
| 492 | DataStore.tasks[taskid].set_option(option, value) |
| 493 | |
| 494 | logger.debug("(%s) Requested to set options" % taskid) |
| 495 | return jsonize({"success": True}) |
| 496 | |
| 497 | # Handle scans |
| 498 | @post("/scan/<taskid>/start") |
nothing calls this directly
no test coverage detected
searching dependent graphs…