Returns status of a scan
(taskid)
| 556 | |
| 557 | @get("/scan/<taskid>/status") |
| 558 | def scan_status(taskid): |
| 559 | """ |
| 560 | Returns status of a scan |
| 561 | """ |
| 562 | |
| 563 | if taskid not in DataStore.tasks: |
| 564 | logger.warning("[%s] Invalid task ID provided to scan_status()" % taskid) |
| 565 | return jsonize({"success": False, "message": "Invalid task ID"}) |
| 566 | |
| 567 | if DataStore.tasks[taskid].engine_process() is None: |
| 568 | status = "not running" |
| 569 | else: |
| 570 | status = "terminated" if DataStore.tasks[taskid].engine_has_terminated() is True else "running" |
| 571 | |
| 572 | logger.debug("(%s) Retrieved scan status" % taskid) |
| 573 | return jsonize({ |
| 574 | "success": True, |
| 575 | "status": status, |
| 576 | "returncode": DataStore.tasks[taskid].engine_get_returncode() |
| 577 | }) |
| 578 | |
| 579 | @get("/scan/<taskid>/data") |
| 580 | def scan_data(taskid): |
no test coverage detected
searching dependent graphs…