調用CreatePipelines,創(chuàng)建Logstash管道。

調試

您可以在OpenAPI Explorer中直接運行該接口,免去您計算簽名的困擾。運行成功后,OpenAPI Explorer可以自動生成SDK代碼示例。

請求頭

該接口使用公共請求頭,無特殊請求頭。請參見公共請求參數(shù)文檔。

請求語法

POST /openapi/logstashes/{InstanceId}/pipelines HTTP/1.1

請求參數(shù)

名稱 類型 位置 是否必選 示例值 描述
InstanceId String Path ls-cn-oew1qbgl****

Logstash實例ID。

trigger Boolean Query false

是否保存并部署管道。可選值:

  • true:保存并部署
  • false(默認):僅保存
ClientToken String Query 5A2CFF0E-5718-45B5-9D4D-70B3FF****

用于保證請求的冪等性。由客戶端生成該參數(shù)值,要保證在不同請求間唯一,最大不超過64個ASCII字符。

Array Body

請求體參數(shù),用來指定管道信息,更多詳細信息請參見logstash.yml

pipelineId String Body pipeline-test

管道ID。

description String Body this is a test

管道描述。

config String Body input { } filter { } output { }

管道具體配置。

workers Integer Body 2

管道工作線程數(shù)。默認值:實例的CPU核數(shù)。

batchSize Integer Body 125

管道批大小。默認值:125。

batchDelay Integer Body 50

管道批延遲。單位:毫秒,默認值:50。

queueType String Body MEMORY

隊列類型。可選值:

  • MEMORY:基于內存的傳統(tǒng)隊列。
  • PERSISTED:基于磁盤的ACKed隊列(持久隊列)。
queueMaxBytes Integer Body 1024

隊列的總容量(以字節(jié)數(shù)表示)。單位:MB,默認值:1024。

queueCheckPointWrites Integer Body 1024

隊列檢查點寫入數(shù)。默認值:1024。

返回數(shù)據(jù)

名稱 類型 示例值 描述
Result Boolean true

管道是否創(chuàng)建成功:

  • true:創(chuàng)建成功
  • false:創(chuàng)建失敗
RequestId String 5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1****

請求ID。

示例

請求示例

POST /openapi/logstashes/ls-cn-oew1qbgl****/pipelines?trigger=false&ClientToken=5A2CFF0E-5718-45B5-9D4D-70B3FF**** HTTP/1.1
Host:elasticsearch.aliyuncs.com
Content-Type:application/json

[ {
  "pipelineId" : "pipeline-test",
  "description" : "this is a test",
  "config" : "input { } filter { } output { }",
  "workers" : 2,
  "batchSize" : 125,
  "batchDelay" : 50,
  "queueType" : "MEMORY",
  "queueMaxBytes" : 1024,
  "queueCheckPointWrites" : 1024
} ]

正常返回示例

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Result" : true,
  "RequestId" : "732A60FB-1899-4466-83D2-E96DA455****"
}

錯誤碼

訪問錯誤中心查看更多錯誤碼。