調用UpdateComponentIndex,更新Elasticsearch的組合模板。

詳細信息請參見通過OpenStore實現海量數據存儲。

調試

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

請求頭

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

請求語法

PUT /openapi/instances/{InstanceId}/component-index/{name} HTTP/1.1

請求參數

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

實例ID。

name String Path component-openstore-index-template

模板名稱。

Object Body

RequestBody參數。

template Object Body

組合模板信息。

settings Map Body { "index.number_of_replicas": 0 }

模板settings配置。

mappings Map Body { "properties": { "@timestamp": { "type": "date" } } }

模板mappings配置。

aliases Map Body {}

模板別名配置。

_meta Map Body { "description": "set number of shards to one" }

元數據,用于存儲備注等信息。

返回數據

名稱 類型 示例值 描述
requestId String F99407AB-2FA9-489E-A259-40CF6DCC47D9

請求ID。

示例

請求示例

PUT /openapi/instances/es-cn-t57p81n7ai89v****/component-index/component-openstore-index-template HTTP/1.1
Host:elasticsearch.aliyuncs.com
Content-Type:application/json
{
	"template": {
		"settings": {
			"index.number_of_replicas": 0
		},
		"mappings": {
			"properties": {
				"@timestamp": {
					"type": "date"
				}
			}
		},
		"aliases": {}
	},
  "_meta": {
      "description": "set number of shards to one"
  }
}

正常返回示例

JSON格式

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

{
  "RequestId" : "F99407AB-2FA9-489E-A259-40CF6DCC47D9"
}

錯誤碼

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