調(diào)用ListIndexTemplates,查詢索引模板列表。僅適用于日志增強(qiáng)版實(shí)例。

調(diào)試

您可以在OpenAPI Explorer中直接運(yùn)行該接口,免去您計(jì)算簽名的困擾。運(yùn)行成功后,OpenAPI Explorer可以自動(dòng)生成SDK代碼示例。

請(qǐng)求頭

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

請(qǐng)求語法

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

請(qǐng)求參數(shù)

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

實(shí)例ID。

indexTemplate String Query my-template

索引模板名稱。

page Integer Query 5

實(shí)例列表的頁碼。起始值:1,默認(rèn)值:1。

size Integer Query 50

分頁查詢時(shí)設(shè)置的每頁條數(shù)。最大值:100,默認(rèn)值:20。

返回?cái)?shù)據(jù)

名稱 類型 示例值 描述
RequestId String F99407AB-2FA9-489E-A259-40CF6DCC****

請(qǐng)求ID。

Result Array of Result

索引模板列表信息。

dataStream Boolean true

是否開啟數(shù)據(jù)流,參數(shù)取值如下:

  • true:開啟。
  • false(默認(rèn)值):不開啟。
indexTemplate String my-template

索引模版名稱。

ilmPolicy String my_ilm_policy

索引生命周期策略名稱。

priority Integer 100

索引模板優(yōu)先級(jí)。

indexPatterns Array of String console-*

索引模式。

template Object

組件模版。

settings String {\"mydata\":{}}

settings設(shè)置。

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

mappings設(shè)置。

aliases String {\"index.number_of_shards\":\"1\"}

aliases設(shè)置。

示例

請(qǐng)求示例

GET /openapi/instances/es-cn-nif24adwc0082****/index-templates?indexTemplate=my-template&page=5&size=50 HTTP/1.1
Host:elasticsearch.aliyuncs.com
Content-Type:application/json

正常返回示例

JSON格式

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

{
  "RequestId" : "F99407AB-2FA9-489E-A259-40CF6DCC****",
  "Result" : {
    "indexTemplate" : "my-template",
    "indexPatterns" : "console-*",
    "dataStream" : true,
    "priority" : 100,
    "ilmPolicy" : "my_ilm_policy",
    "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\":{}}"
    }
  }
}

錯(cuò)誤碼

訪問錯(cuò)誤中心查看更多錯(cuò)誤碼。