Check if credentials exist for a target (used by scan form)
()
| 18462 | return jsonify({'success': False, 'error': str(e)}), 500 |
| 18463 | |
| 18464 | @app.route('/api/automation/orchestrator/start', methods=['POST']) |
| 18465 | def start_orchestrator_automation(): |
| 18466 | """Start the orchestrator thread to enable automation.""" |
| 18467 | try: |
| 18468 | ragnar_instance = getattr(shared_data, 'ragnar_instance', None) |
| 18469 | if not ragnar_instance: |
| 18470 | return jsonify({'success': False, 'error': 'Core Ragnar instance is not initialized yet'}), 503 |
| 18471 | |
| 18472 | if is_orchestrator_running(): |
| 18473 | return jsonify({ |
| 18474 | 'success': True, |
| 18475 | 'message': 'Automation already running', |
| 18476 | 'automation_enabled': True |
| 18477 | }) |
| 18478 | |
| 18479 | ragnar_instance.start_orchestrator() |
| 18480 | automation_enabled = is_orchestrator_running() |
| 18481 | |
| 18482 | broadcast_status_update() |
| 18483 | |
| 18484 | message = 'Automation enabled - orchestrator awake' if automation_enabled else 'Automation start requested - waiting for Wi-Fi' |
| 18485 | return jsonify({ |
| 18486 | 'success': True, |
| 18487 | 'message': message, |
| 18488 | 'automation_enabled': automation_enabled |
nothing calls this directly
no test coverage detected