/**
 * 云服务器控制四层架构API路由配置
 * 根据文档 ARCHIVE/01_Architecture/12_Operation_Agent.md 规范实现
 */

import Router from '@koa/router';
import { 
  executeCommand, 
  getLayerStatus, 
  testLayer, 
  getLayerStats, 
  healthCheck 
} from '../controllers/cloud-control-controller';

const router = new Router({
  prefix: '/api/cloud-control'
});

/**
 * 执行控制命令
 * POST /api/cloud-control/execute
 */
router.post('/execute', executeCommand);

/**
 * 获取所有层级状态
 * GET /api/cloud-control/status
 */
router.get('/status', getLayerStatus);

/**
 * 测试层级连接
 * POST /api/cloud-control/test/:layer
 */
router.post('/test/:layer', testLayer);

/**
 * 获取层级统计信息
 * GET /api/cloud-control/stats
 */
router.get('/stats', getLayerStats);

/**
 * 健康检查
 * GET /api/cloud-control/health
 */
router.get('/health', healthCheck);

export default router;