fix: auto-fix code issues (cron)

- 修复未定义名称 (F821): 添加缺失的导入
  - ExportEntity, ExportRelation, ExportTranscript
  - WorkflowManager, PluginManager, OpsManager
  - urllib.parse
- 修复裸异常捕获: except: → except Exception:
- 删除 __pycache__ 缓存文件
- 格式化代码 (PEP8)

自动化修复: 23个问题
剩余需手动处理: 104个行长度问题 (E501)
This commit is contained in:
AutoFix Bot
2026-03-01 21:14:19 +08:00
parent e46c938b40
commit cdf0e80851
53 changed files with 358 additions and 17 deletions

View File

@@ -34,6 +34,11 @@ from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse, PlainTextResponse, StreamingResponse
from fastapi.staticfiles import StaticFiles
from pydantic import BaseModel, Field
from export_manager import ExportEntity
from export_manager import ExportRelation
from export_manager import ExportTranscript
from ops_manager import OpsManager
from plugin_manager import PluginManager
# Configure logger
logger = logging.getLogger(__name__)
@@ -563,6 +568,7 @@ async def rate_limit_middleware(request: Request, call_next):
return response
# 添加限流中间件
app.middleware("http")(rate_limit_middleware)
@@ -645,6 +651,7 @@ class RateLimitStatus(BaseModel):
reset_time: int
window: str
# 原有模型(保留)
@@ -713,6 +720,7 @@ class GlossaryTermCreate(BaseModel):
term: str
pronunciation: str | None = ""
# ==================== Phase 7: Workflow Pydantic Models ====================
@@ -914,6 +922,7 @@ def get_doc_processor() -> "DocumentProcessor | None":
# Phase 7 Task 4: Collaboration Manager singleton
_collaboration_manager: "CollaborationManager | None" = None
# Forward declaration for type hints
class CollaborationManager:
pass
@@ -926,6 +935,7 @@ def get_collab_manager() -> "CollaborationManager | None":
_collaboration_manager = get_collaboration_manager(db)
return _collaboration_manager
# Phase 2: Entity Edit API
@@ -997,6 +1007,7 @@ async def merge_entities_endpoint(
},
}
# Phase 2: Relation Edit API
@@ -1063,6 +1074,7 @@ async def update_relation(relation_id: str, relation: RelationCreate, _=Depends(
"success": True,
}
# Phase 2: Transcript Edit API
@@ -1103,6 +1115,7 @@ async def update_transcript(
"success": True,
}
# Phase 2: Manual Entity Creation
@@ -1290,6 +1303,7 @@ def align_entity(project_id: str, name: str, db, definition: str = "") -> Option
return None
# API Endpoints
@@ -1427,6 +1441,7 @@ async def upload_audio(project_id: str, file: UploadFile = File(...), _=Depends(
created_at=datetime.now().isoformat(),
)
# Phase 3: Document Upload API
@@ -1549,6 +1564,7 @@ async def upload_document(project_id: str, file: UploadFile = File(...), _=Depen
"created_at": datetime.now().isoformat(),
}
# Phase 3: Knowledge Base API
@@ -1644,6 +1660,7 @@ async def get_knowledge_base(project_id: str, _=Depends(verify_api_key)):
],
}
# Phase 3: Glossary API
@@ -1686,6 +1703,7 @@ async def delete_glossary_term(term_id: str, _=Depends(verify_api_key)):
db.delete_glossary_term(term_id)
return {"success": True}
# Phase 3: Entity Alignment API
@@ -1816,6 +1834,7 @@ async def get_entity_mentions(entity_id: str, _=Depends(verify_api_key)):
for m in mentions
]
# Health check - Legacy endpoint (deprecated, use /api/v1/health)
@@ -1838,6 +1857,7 @@ async def legacy_health_check():
"plugin_manager_available": PLUGIN_MANAGER_AVAILABLE,
}
# ==================== Phase 4: Agent 助手 API ====================
@@ -2027,6 +2047,7 @@ async def agent_suggest(project_id: str, _=Depends(verify_api_key)):
return {"suggestions": []}
# ==================== Phase 4: 知识溯源 API ====================
@@ -2106,6 +2127,7 @@ async def get_entity_evolution(entity_id: str, _=Depends(verify_api_key)):
],
}
# ==================== Phase 4: 实体管理增强 API ====================
@@ -2121,6 +2143,7 @@ async def search_entities(project_id: str, q: str, _=Depends(verify_api_key)):
{"id": e.id, "name": e.name, "type": e.type, "definition": e.definition} for e in entities
]
# ==================== Phase 5: 时间线视图 API ====================
@@ -2183,6 +2206,7 @@ async def get_entity_timeline(entity_id: str, _=Depends(verify_api_key)):
"total_count": len(timeline),
}
# ==================== Phase 5: 知识推理与问答增强 API ====================
@@ -2336,6 +2360,7 @@ async def project_summary(project_id: str, req: SummaryRequest, _=Depends(verify
return {"project_id": project_id, "summary_type": req.summary_type, **summary**summary}
# ==================== Phase 5: 实体属性扩展 API ====================
@@ -2372,6 +2397,7 @@ class EntityAttributeBatchSet(BaseModel):
attributes: list[EntityAttributeSet]
change_reason: str | None = ""
# 属性模板管理 API
@@ -2488,6 +2514,7 @@ async def delete_attribute_template_endpoint(template_id: str, _=Depends(verify_
return {"success": True, "message": f"Template {template_id} deleted"}
# 实体属性值管理 API
@@ -2675,6 +2702,7 @@ async def delete_entity_attribute_endpoint(
return {"success": True, "message": "Attribute deleted"}
# 属性历史 API
@@ -2728,6 +2756,7 @@ async def get_template_history_endpoint(
for h in history
]
# 属性筛选搜索 API
@@ -2766,6 +2795,7 @@ async def search_entities_by_attributes_endpoint(
for e in entities
]
# ==================== 导出功能 API ====================
@@ -3213,6 +3243,7 @@ async def export_transcript_markdown_endpoint(transcript_id: str, _=Depends(veri
},
)
# ==================== Neo4j Graph Database API ====================
@@ -3470,6 +3501,7 @@ async def get_subgraph(request: GraphQueryRequest, _=Depends(verify_api_key)):
subgraph = manager.get_subgraph(request.entity_ids, request.depth)
return subgraph
# ==================== Phase 6: API Key Management Endpoints ====================
@@ -3729,6 +3761,7 @@ async def get_rate_limit_status(request: Request, _=Depends(verify_api_key)):
limit=limit, remaining=info.remaining, reset_time=info.reset_time, window="minute"
)
# ==================== Phase 6: System Endpoints ====================
@@ -3767,6 +3800,7 @@ async def system_status():
return status
# ==================== Phase 7: Workflow Automation Endpoints ====================
# Workflow Manager singleton
@@ -4065,6 +4099,7 @@ async def get_workflow_stats_endpoint(workflow_id: str, days: int = 30, _=Depend
return WorkflowStatsResponse(**stats)
# ==================== Phase 7: Webhook Endpoints ====================
@@ -4251,6 +4286,7 @@ async def test_webhook_endpoint(webhook_id: str, _=Depends(verify_api_key)):
else:
raise HTTPException(status_code=400, detail="Webhook test failed")
# ==================== Phase 7: Multimodal Support Endpoints ====================
# Pydantic Models for Multimodal API
@@ -5124,6 +5160,7 @@ async def suggest_multimodal_merges_endpoint(project_id: str, _=Depends(verify_a
],
}
# ==================== Phase 7: Multimodal Support API ====================
@@ -5163,6 +5200,7 @@ class MultimodalProfileResponse(BaseModel):
entity_id: str
entity_name: str
# ==================== Phase 7 Task 7: Plugin Management Pydantic Models ====================
@@ -5342,6 +5380,7 @@ def get_plugin_manager_instance() -> "PluginManager | None":
_plugin_manager_instance = get_plugin_manager(db)
return _plugin_manager_instance
# ==================== Phase 7 Task 7: Plugin Management Endpoints ====================
@@ -5490,6 +5529,7 @@ async def delete_plugin_endpoint(plugin_id: str, _=Depends(verify_api_key)):
return {"success": True, "message": "Plugin deleted successfully"}
# ==================== Phase 7 Task 7: Chrome Extension Endpoints ====================
@@ -5621,6 +5661,7 @@ async def chrome_import_webpage_endpoint(request: ChromeExtensionImportRequest):
return result
# ==================== Phase 7 Task 7: Bot Endpoints ====================
@@ -5813,6 +5854,7 @@ async def send_bot_message_endpoint(
return {"success": success, "message": "Message sent" if success else "Failed to send message"}
# ==================== Phase 7 Task 7: Integration Endpoints ====================
@@ -5997,6 +6039,7 @@ async def trigger_integration_endpoint(
"message": "Triggered successfully" if success else "Trigger failed",
}
# ==================== Phase 7 Task 7: WebDAV Endpoints ====================
@@ -6168,6 +6211,7 @@ async def get_openapi():
tags=app.openapi_tags,
)
# Serve frontend - MUST be last to not override API routes
app.mount("/", StaticFiles(directory="frontend", html=True), name="frontend")
@@ -6375,6 +6419,7 @@ async def regenerate_plugin_key(plugin_id: str, api_key: str = Depends(verify_ap
return {"success": True, "api_key": new_key}
# ==================== Chrome Extension API ====================
@@ -6449,6 +6494,7 @@ URL: {request.url}
message="Content saved successfully",
)
# ==================== Bot API ====================
@@ -6517,6 +6563,7 @@ async def list_bot_sessions(
for s in sessions
]
# ==================== Webhook Integration API ====================
@@ -6636,6 +6683,7 @@ async def receive_webhook(
return {"success": True, "endpoint_id": endpoint.id, "received_at": datetime.now().isoformat()}
# ==================== WebDAV API ====================
@@ -6759,6 +6807,7 @@ async def trigger_webdav_sync(sync_id: str, api_key: str = Depends(verify_api_ke
return {"success": True, "sync_id": sync_id, "status": "running", "message": "Sync started"}
# ==================== Plugin Activity Logs ====================
@@ -6789,6 +6838,7 @@ async def get_plugin_logs(
]
}
# ==================== Phase 7 Task 3: Security & Compliance API ====================
# Pydantic models for security API
@@ -6905,6 +6955,7 @@ class AccessRequestResponse(BaseModel):
expires_at: str | None = None
created_at: str
# ==================== Audit Logs API ====================
@@ -6970,6 +7021,7 @@ async def get_audit_stats(
return AuditStatsResponse(**stats)
# ==================== Encryption API ====================
@@ -7057,6 +7109,7 @@ async def get_encryption_config(project_id: str, api_key: str = Depends(verify_a
updated_at=config.updated_at,
)
# ==================== Data Masking API ====================
@@ -7232,6 +7285,7 @@ async def apply_masking(
original_text=request.text, masked_text=masked_text, applied_rules=applied_rules
)
# ==================== Data Access Policy API ====================
@@ -7330,6 +7384,7 @@ async def check_access_permission(
return {"allowed": allowed, "reason": reason if not allowed else None}
# ==================== Access Request API ====================
@@ -7429,6 +7484,7 @@ async def reject_access_request(
created_at=access_request.created_at,
)
# ==========================================
# Phase 7 Task 4: 协作与共享 API
# ==========================================
@@ -7476,6 +7532,7 @@ class TeamMemberInvite(BaseModel):
class TeamMemberRoleUpdate(BaseModel):
role: str
# ----- 项目分享 -----
@@ -7615,6 +7672,7 @@ async def revoke_share_link(share_id: str, revoked_by: str = "current_user"):
return {"success": True, "message": "Share link revoked"}
# ----- 评论和批注 -----
@@ -7752,6 +7810,7 @@ async def delete_comment(comment_id: str, deleted_by: str = "current_user"):
return {"success": True, "message": "Comment deleted"}
# ----- 变更历史 -----
@@ -7845,6 +7904,7 @@ async def revert_change(record_id: str, reverted_by: str = "current_user"):
return {"success": True, "message": "Change reverted"}
# ----- 团队成员 -----
@@ -7956,6 +8016,7 @@ async def check_project_permissions(project_id: str, user_id: str = "current_use
return {"has_access": True, "role": user_member.role, "permissions": user_member.permissions}
# ==================== Phase 7 Task 6: Advanced Search & Discovery ====================
@@ -8144,6 +8205,7 @@ async def index_project_for_search(project_id: str, _=Depends(verify_api_key)):
else:
raise HTTPException(status_code=500, detail="Failed to index project")
# ==================== Phase 7 Task 8: Performance & Scaling ====================
@@ -8329,6 +8391,7 @@ async def list_shards(_=Depends(verify_api_key)):
],
}
# ============================================
# Phase 8: Multi-Tenant SaaS APIs
# ============================================
@@ -8370,6 +8433,7 @@ class InviteMemberRequest(BaseModel):
class UpdateMemberRequest(BaseModel):
role: str | None = None
# Tenant Management APIs
@@ -8481,6 +8545,7 @@ async def delete_tenant(tenant_id: str, _=Depends(verify_api_key)):
return {"message": "Tenant deleted successfully"}
# Domain Management APIs
@@ -8566,6 +8631,7 @@ async def remove_domain(tenant_id: str, domain_id: str, _=Depends(verify_api_key
return {"message": "Domain removed successfully"}
# Branding APIs
@@ -8641,6 +8707,7 @@ async def get_branding_css(tenant_id: str):
return PlainTextResponse(content=css, media_type="text/css")
# Member Management APIs
@@ -8730,6 +8797,7 @@ async def remove_member(tenant_id: str, member_id: str, _=Depends(verify_api_key
return {"message": "Member removed successfully"}
# Usage & Limits APIs
@@ -8762,6 +8830,7 @@ async def check_resource_limit(tenant_id: str, resource_type: str, _=Depends(ver
"usage_percentage": round(current / limit * 100, 2) if limit > 0 else 0,
}
# Public tenant resolution API (for custom domains)
@@ -8837,6 +8906,7 @@ async def detailed_health_check():
return health
# ==================== Phase 8: Multi-Tenant SaaS API ====================
# Pydantic Models for Tenant API
@@ -8960,6 +9030,7 @@ class TenantStatsResponse(BaseModel):
api_calls_today: int
api_calls_month: int
# Tenant API Endpoints
@@ -9077,6 +9148,7 @@ async def delete_tenant_endpoint(tenant_id: str, _=Depends(verify_api_key)):
return {"success": True, "message": f"Tenant {tenant_id} deleted"}
# Tenant Domain API
@@ -9165,6 +9237,7 @@ async def remove_tenant_domain_endpoint(tenant_id: str, domain_id: str, _=Depend
return {"success": True, "message": "Domain removed successfully"}
# Tenant Branding API
@@ -9217,6 +9290,7 @@ async def get_tenant_theme_css_endpoint(tenant_id: str):
return PlainTextResponse(content=branding.get_theme_css(), media_type="text/css")
# Tenant Member API
@@ -9340,6 +9414,7 @@ async def remove_tenant_member_endpoint(
except ValueError as e:
raise HTTPException(status_code=403, detail=str(e))
# Tenant Role API
@@ -9425,6 +9500,7 @@ async def list_tenant_permissions_endpoint(_=Depends(verify_api_key)):
"permissions": [{"id": k, "name": v} for k, v in tenant_manager.PERMISSION_NAMES.items()]
}
# Tenant Resolution API
@@ -9462,6 +9538,7 @@ async def get_tenant_context_endpoint(tenant_id: str, _=Depends(verify_api_key))
return context
# ============================================
# Phase 8 Task 2: Subscription & Billing APIs
# ============================================
@@ -9518,6 +9595,7 @@ class CreateCheckoutSessionRequest(BaseModel):
success_url: str = Field(..., description="支付成功回调URL")
cancel_url: str = Field(..., description="支付取消回调URL")
# Subscription Plan APIs
@@ -9578,6 +9656,7 @@ async def get_subscription_plan(plan_id: str, _=Depends(verify_api_key)):
"created_at": plan.created_at.isoformat(),
}
# Subscription APIs
@@ -9716,6 +9795,7 @@ async def cancel_subscription(
except (RuntimeError, ValueError, TypeError) as e:
raise HTTPException(status_code=400, detail=str(e))
# Usage APIs
@@ -9765,6 +9845,7 @@ async def get_usage_summary(
return summary
# Payment APIs
@@ -9831,6 +9912,7 @@ async def get_payment(tenant_id: str, payment_id: str, _=Depends(verify_api_key)
"created_at": payment.created_at.isoformat(),
}
# Invoice APIs
@@ -9901,6 +9983,7 @@ async def get_invoice(tenant_id: str, invoice_id: str, _=Depends(verify_api_key)
"created_at": invoice.created_at.isoformat(),
}
# Refund APIs
@@ -10015,6 +10098,7 @@ async def process_refund(
else:
raise HTTPException(status_code=400, detail="Invalid action")
# Billing History API
@@ -10055,6 +10139,7 @@ async def get_billing_history(
"total": len(history),
}
# Payment Provider Integration APIs
@@ -10127,6 +10212,7 @@ async def create_wechat_order(
except (RuntimeError, ValueError, TypeError) as e:
raise HTTPException(status_code=400, detail=str(e))
# Webhook Handlers
@@ -10180,6 +10266,7 @@ async def wechat_webhook(request: Request):
else:
raise HTTPException(status_code=400, detail="Webhook processing failed")
# ==================== Phase 8: Enterprise Features API ====================
# Pydantic Models for Enterprise
@@ -10284,6 +10371,7 @@ class RetentionPolicyUpdate(BaseModel):
archive_encryption: bool | None = None
is_active: bool | None = None
# SSO/SAML APIs
@@ -10465,6 +10553,7 @@ async def get_sso_metadata_endpoint(
"slo_url": f"{base_url}/api/v1/sso/saml/{tenant_id}/slo",
}
# SCIM APIs
@@ -10600,6 +10689,7 @@ async def list_scim_users_endpoint(
"total": len(users),
}
# Audit Log Export APIs
@@ -10740,6 +10830,7 @@ async def download_audit_export_endpoint(
"expires_at": export.expires_at.isoformat() if export.expires_at else None,
}
# Data Retention Policy APIs
@@ -10950,6 +11041,7 @@ async def list_retention_jobs_endpoint(
"total": len(jobs),
}
# ============================================
# Phase 8 Task 7: Globalization & Localization API
# ============================================
@@ -11015,6 +11107,7 @@ class ConvertTimezoneRequest(BaseModel):
from_tz: str = Field(..., description="源时区")
to_tz: str = Field(..., description="目标时区")
# Translation APIs
@@ -11145,6 +11238,7 @@ async def list_translations(
"total": len(translations),
}
# Language APIs
@@ -11205,6 +11299,7 @@ async def get_language(code: str):
"calendar_type": lang.calendar_type,
}
# Data Center APIs
@@ -11331,6 +11426,7 @@ async def set_tenant_data_center(
"created_at": mapping.created_at.isoformat(),
}
# Payment Method APIs
@@ -11381,6 +11477,7 @@ async def get_localized_payment_methods(
return {"country_code": country_code, "language": language, "payment_methods": methods}
# Country APIs
@@ -11442,6 +11539,7 @@ async def get_country(code: str):
"vat_rate": country.vat_rate,
}
# Localization Settings APIs
@@ -11538,6 +11636,7 @@ async def update_localization_settings(
"updated_at": settings.updated_at.isoformat(),
}
# Formatting APIs
@@ -11661,6 +11760,7 @@ async def get_calendar_info(
return info
# ============================================
# Phase 8 Task 4: AI 能力增强 API
# ============================================
@@ -11734,6 +11834,7 @@ class PredictionFeedbackRequest(BaseModel):
actual_value: str
is_correct: bool
# 自定义模型管理 API
@@ -11909,6 +12010,7 @@ async def predict_with_custom_model(request: PredictRequest):
except ValueError as e:
raise HTTPException(status_code=400, detail=str(e))
# 多模态分析 API
@@ -11973,6 +12075,7 @@ async def list_multimodal_analyses(
]
}
# 知识图谱 RAG API
@@ -12063,6 +12166,7 @@ async def query_kg_rag(
except ValueError as e:
raise HTTPException(status_code=400, detail=str(e))
# 智能摘要 API
@@ -12113,6 +12217,7 @@ async def list_smart_summaries(
# 这里需要从数据库查询,暂时返回空列表
return {"summaries": []}
# 预测模型 API
@@ -12302,6 +12407,7 @@ async def update_prediction_feedback(request: PredictionFeedbackRequest):
return {"status": "success", "message": "Feedback updated"}
# ==================== Phase 8 Task 5: Growth & Analytics Endpoints ====================
# Pydantic Models for Growth API
@@ -12418,6 +12524,7 @@ def get_growth_manager_instance() -> "GrowthManager | None":
_growth_manager = GrowthManager()
return _growth_manager
# ==================== 用户行为分析 API ====================
@@ -12514,6 +12621,7 @@ async def get_user_profile(tenant_id: str, user_id: str):
"engagement_score": profile.engagement_score,
}
# ==================== 转化漏斗 API ====================
@@ -12592,6 +12700,7 @@ async def calculate_retention(
return retention
# ==================== A/B 测试 API ====================
@@ -12782,6 +12891,7 @@ async def stop_experiment_endpoint(experiment_id: str):
"end_date": experiment.end_date.isoformat() if experiment.end_date else None,
}
# ==================== 邮件营销 API ====================
@@ -12959,6 +13069,7 @@ async def create_automation_workflow_endpoint(request: CreateAutomationWorkflowR
"created_at": workflow.created_at,
}
# ==================== 推荐系统 API ====================
@@ -13101,6 +13212,7 @@ async def check_team_incentive_eligibility(tenant_id: str, current_tier: str, te
]
}
# Serve frontend - MUST be last to not override API routes
# ============================================
@@ -13269,6 +13381,7 @@ def get_developer_ecosystem_manager_instance() -> "DeveloperEcosystemManager | N
_developer_ecosystem_manager = DeveloperEcosystemManager()
return _developer_ecosystem_manager
# ==================== SDK Release & Management API ====================
@@ -13481,6 +13594,7 @@ async def add_sdk_version_endpoint(sdk_id: str, request: SDKVersionCreate):
"created_at": version.created_at,
}
# ==================== Template Market API ====================
@@ -13733,6 +13847,7 @@ async def get_template_reviews_endpoint(
]
}
# ==================== Plugin Market API ====================
@@ -13985,6 +14100,7 @@ async def get_plugin_reviews_endpoint(
]
}
# ==================== Developer Revenue Sharing API ====================
@@ -14033,6 +14149,7 @@ async def get_developer_revenue_summary_endpoint(developer_id: str):
return summary
# ==================== Developer Profile & Management API ====================
@@ -14167,6 +14284,7 @@ async def update_developer_stats_endpoint(developer_id: str):
return {"success": True, "message": "Developer stats updated"}
# ==================== Code Examples API ====================
@@ -14284,6 +14402,7 @@ async def copy_code_example_endpoint(example_id: str):
return {"success": True, "message": "Code copied"}
# ==================== API Documentation API ====================
@@ -14331,6 +14450,7 @@ async def get_api_documentation_endpoint(doc_id: str):
"generated_by": doc.generated_by,
}
# ==================== Developer Portal API ====================
@@ -14422,6 +14542,7 @@ async def get_portal_config_endpoint(config_id: str):
"is_active": config.is_active,
}
# ==================== Phase 8 Task 8: Operations & Monitoring Endpoints ====================
# Ops Manager singleton
@@ -14434,6 +14555,7 @@ def get_ops_manager_instance() -> "OpsManager | None":
_ops_manager = get_ops_manager()
return _ops_manager
# Pydantic Models for Ops API
@@ -14562,6 +14684,7 @@ class BackupJobCreate(BaseModel):
compression_enabled: bool = Field(default=True, description="是否压缩")
storage_location: str | None = Field(default=None, description="存储位置")
# Alert Rules API
@@ -14737,6 +14860,7 @@ async def delete_alert_rule_endpoint(rule_id: str, _=Depends(verify_api_key)):
return {"success": True, "message": "Alert rule deleted"}
# Alert Channels API
@@ -14819,6 +14943,7 @@ async def test_alert_channel_endpoint(channel_id: str, _=Depends(verify_api_key)
else:
raise HTTPException(status_code=400, detail="Failed to send test alert")
# Alerts API
@@ -14893,6 +15018,7 @@ async def resolve_alert_endpoint(alert_id: str, _=Depends(verify_api_key)):
return {"success": True, "message": "Alert resolved"}
# Resource Metrics API
@@ -14960,6 +15086,7 @@ async def get_resource_metrics_endpoint(
for m in metrics
]
# Capacity Planning API
@@ -15026,6 +15153,7 @@ async def list_capacity_plans_endpoint(tenant_id: str, _=Depends(verify_api_key)
for plan in plans
]
# Auto Scaling API
@@ -15120,6 +15248,7 @@ async def list_scaling_events_endpoint(
for event in events
]
# Health Check API
@@ -15205,6 +15334,7 @@ async def execute_health_check_endpoint(check_id: str, _=Depends(verify_api_key)
"checked_at": result.checked_at,
}
# Backup API
@@ -15311,6 +15441,7 @@ async def list_backup_records_endpoint(
for record in records
]
# Cost Optimization API
@@ -15447,5 +15578,6 @@ async def apply_cost_optimization_suggestion_endpoint(
},
}
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)