日本熟妇hd丰满老熟妇,中文字幕一区二区三区在线不卡 ,亚洲成片在线观看,免费女同在线一区二区

CreateIndexTemplate

調用CreateIndexTemplate,創建集群索引模板,可用于索引模版的組件化設置。僅適用于日志增強版實例。

調試

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

請求頭

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

請求語法

POST /openapi/instances/{InstanceId}/index-templates HTTP/1.1

請求參數

名稱

類型

位置

是否必選

示例值

描述

InstanceId String Path es-cn-n6w24n9u900am****

實例ID。

ClientToken String Query E1136AE9-4E49-4585-9358-6FDD2A6D****

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

Object Body

請求體參數,用來指定待創建的集群索引模板的信息。

indexTemplate String Body index-template

索引模版名稱。

indexPatterns Array of String Body ["schema1*","schema2*"]

索引匹配模式正則。

dataStream Boolean Body false

是否開啟數據流。可選值:

  • true:開啟
  • false(默認):不開啟
priority Integer Body 30

集群索引模板的優先級。值越大,優先級越高。

ilmPolicy String Body policy-1

生命周期策略名稱。

template Object Body

模版設置,詳細信息請參見官方Multiple Component Templates文檔

settings String Body {\"index.number_of_shards\":\"1\"}

settings設置。

mappings String Body {\"properties\":{\"created_at\":{\"format\":\"EEE MMM dd HH:mm:ss Z yyyy\",\"type\":\"date\"},\"host_name\":{\"type\":\"keyword\"}}}

mappings設置。

aliases String Body {\"mydata\":{}}

aliases設置。

返回數據

名稱

類型

示例值

描述

Result String index-template

返回創建集群索引模板的名稱。

RequestId String F99407AB-2FA9-489E-A259-40CF6DCC****

請求ID。

示例

請求示例

POST /openapi/instances/es-cn-n6w24n9u900am****/index-templates?ClientToken=E1136AE9-4E49-4585-9358-6FDD2A6D**** HTTP/1.1
Host:elasticsearch.aliyuncs.com
Content-Type:application/json

{
    "indexTemplate": "index-template", 
    "indexPatterns": [
        "schema1*", 
        "schema2*"
    ], 
    "dataStream": true, 
    "priority": 30, 
    "ilmPolicy": "policy-1", 
    "template": {
        "settings": "{\"index.number_of_shards\":\"1\"}", 
        "mappings": "{\"properties\":{\"created_at\":{\"format\":\"EEE MMM dd HH:mm:ss Z yyyy\",\"type\":\"date\"},\"host_name\":{\"type\":\"keyword\"}}}", 
        "aliases": "{\"mydata\":{}}"
    }
}

正常返回示例

JSON格式

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

{
  "RequestId" : "F99407AB-2FA9-489E-A259-40CF6DCC****",
  "Result" : "index-template"
}

錯誤碼

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