新增 api/platform/ 子包(对齐 api/sealai/ 结构): - platform_api: list_platforms(DataLink Platform 列表) - easo_client: EasoClient + get_easo_client()(EASO Bearer JWT 认证) - workflow_api: list_workflows / get_workflow_stats / get_workflow_charge - schemas: Platform / Workflow* 模型(从全局 schemas.py 独立出来) 新增 services/platform/ 子包: - list_platforms / list_platforms_cmd - list_workflows / get_workflow_stats / get_workflow_charge 及 _cmd 变体 全局 api/schemas.py 清理 platform/workflow 相关模型,只保留通用结构。 未实现子模块(entity/page/card/variable/log)在各层以 README 预留。
17 lines
567 B
Python
17 lines
567 B
Python
"""自建应用(DataLink Platform)API 调用封装"""
|
||
|
||
from typing import List
|
||
|
||
from ekb_cli.api import EkbClient
|
||
from ekb_cli.api.platform.schemas import Platform
|
||
|
||
|
||
def list_platforms(client: EkbClient) -> List[Platform]:
|
||
"""获取企业下所有启用的自建应用。
|
||
|
||
对应接口:GET /api/v2/datalink/platform/search?scope=enable
|
||
响应结构:{"items": [...]}(非 EkbResponse 包装)
|
||
"""
|
||
raw = client.get("/v2/datalink/platform/search", scope="enable")
|
||
return [Platform.model_validate(item) for item in raw.get("items", [])]
|