New

The executive guide to generative AI

Read more

更新连接器管道 API

编辑

此功能为 Beta 版,可能会发生更改。其设计和代码不如官方 GA 功能成熟,因此按原样提供,不提供任何担保。Beta 功能不受官方 GA 功能的支持 SLA 约束。

更新连接器的 pipeline 配置。

创建新连接器时,摄取管道的配置将使用默认设置进行填充。

要开始使用连接器 API,请查看我们的教程

请求

编辑

PUT _connector/<connector_id>/_pipeline

先决条件

编辑
  • 要使用自管理连接器同步数据,您需要在您自己的基础设施上部署 Elastic 连接器服务。此服务在 Elastic Cloud 上自动为 Elastic 托管连接器运行。
  • connector_id 参数应引用现有连接器。

路径参数

编辑
<connector_id>
(必需,字符串)

请求正文

编辑
pipeline
(必需,对象)连接器的管道配置。该管道确定在摄取到 Elasticsearch 期间如何处理数据。

管道配置必须包含以下属性

  • extract_binary_content(必需,布尔值)一个标志,指示在摄取期间是否提取二进制内容。
  • name(必需,字符串)摄取管道的名称。
  • reduce_whitespace(必需,布尔值)一个标志,指示是否减少摄取内容中的额外空格。
  • run_ml_inference(必需,布尔值)一个标志,指示是否对摄取的内容运行机器学习推理。

响应代码

编辑
200
连接器的 pipeline 字段已成功更新。
400
未提供 connector_id 或请求负载格式不正确。
404(缺少资源)
找不到与 connector_id 匹配的连接器。

示例

编辑

以下示例更新 ID 为 my-connector 的连接器的 pipeline 属性

resp = client.connector.update_pipeline(
    connector_id="my-connector",
    pipeline={
        "extract_binary_content": True,
        "name": "my-connector-pipeline",
        "reduce_whitespace": True,
        "run_ml_inference": True
    },
)
print(resp)
response = client.connector.update_pipeline(
  connector_id: 'my-connector',
  body: {
    pipeline: {
      extract_binary_content: true,
      name: 'my-connector-pipeline',
      reduce_whitespace: true,
      run_ml_inference: true
    }
  }
)
puts response
const response = await client.connector.updatePipeline({
  connector_id: "my-connector",
  pipeline: {
    extract_binary_content: true,
    name: "my-connector-pipeline",
    reduce_whitespace: true,
    run_ml_inference: true,
  },
});
console.log(response);
PUT _connector/my-connector/_pipeline
{
    "pipeline": {
        "extract_binary_content": true,
        "name": "my-connector-pipeline",
        "reduce_whitespace": true,
        "run_ml_inference": true
    }
}
{
    "result": "updated"
}
Was this helpful?
Feedback