Link Search Menu Expand Document Documentation Menu

获取控制器

2.12 版本引入

使用此 API 通过模型 ID 检索模型的控制器信息。

端点

GET /_plugins/_ml/controllers/<model_id>

路径参数

下表列出了可用的路径参数。

参数 数据类型 描述
model_id 字符串 要检索其控制器的模型的模型 ID。

请求示例

GET /_plugins/_ml/controllers/T_S-cY0BKCJ3ot9qr0aP

示例响应

{
  "model_id": "T_S-cY0BKCJ3ot9qr0aP",
  "user_rate_limiter": {
    "user1": {
      "limit": "4",
      "unit": "MINUTES"
    },
    "user2": {
      "limit": "4",
      "unit": "MINUTES"
    }
  }
}

如果模型没有定义控制器,OpenSearch 将返回错误

{
  "error": {
    "root_cause": [
      {
        "type": "status_exception",
        "reason": "Failed to find model controller with the provided model ID: T_S-cY0BKCJ3ot9qr0aP"
      }
    ],
    "type": "status_exception",
    "reason": "Failed to find model controller with the provided model ID: T_S-cY0BKCJ3ot9qr0aP"
  },
  "status": 404
}

响应正文字段

有关响应字段描述,请参阅创建控制器 API 请求字段

所需权限

如果您使用安全插件,请确保您拥有相应的权限:cluster:admin/opensearch/ml/controllers/get

剩余 350 字符

有问题?

想贡献吗?