跳转至

ops

feishu.integrations.ops

OpsBundle

运营健康聚合 bundle,汇总按请求者身份收窄的只读状态。

源代码位于: feishu/integrations/ops.py
Python
class OpsBundle:
    r"""运营健康聚合 bundle,汇总按请求者身份收窄的只读状态。"""

    def register(self, registry: ToolRegistry, context: BundleContext) -> None:
        registry.add(
            Tool(
                name="get_operational_health",
                description="汇总按请求者身份收窄的只读状态,判断平台运营状态是否健康。",
                input_schema={
                    "type": "object",
                    "properties": {
                        "max_jobs": {"type": "integer", "description": "最多返回多少个 Slurm 作业样本,默认 20。"},
                        "max_unhealthy_nodes": {
                            "type": "integer",
                            "description": "最多返回多少个异常节点样本,默认 20。",
                        },
                    },
                    "additionalProperties": False,
                },
                handler=lambda max_jobs=20, max_unhealthy_nodes=20: _get_operational_health(
                    context,
                    max_jobs=max_jobs,
                    max_unhealthy_nodes=max_unhealthy_nodes,
                ),
            )
        )