Queries a list of indexes stored on an Elasticsearch cluster.
The ListInstanceIndices operation is applicable only to Elasticsearch clusters for which Indexing Service is enabled. We recommend that you use an Elasticsearch API to query index information. For more information, see cat indices API.
Debugging
Request headers
This operation does not have operation-specific request headers and uses only common request headers. For more information, see the "Common request headers" section of the "Common parameters" topic.
Request syntax
GET /openapi/instances/{InstanceId}/indices HTTP/1.1
Request parameters
Parameter |
Type |
Position |
Required |
Example |
Description |
InstanceId | String | Path | Yes | es-cn-tl329rbpc0001**** | The ID of the cluster. |
all | Boolean | Query | No | false | Specifies whether to query all indexes. Valid values:
|
name | String | Query | No | log-0001 | The name of the index. Fuzzy match is supported. |
isManaged | Boolean | Query | No | false | Specifies whether to query only hosted indexes. Valid values:
|
isOpenstore | Boolean | Query | No | false | Specifies whether to query only OpenStore indexes in the cold phase. Valid values:
|
page | Integer | Query | No | 1 | The page number. Pages start from page 1. Default value: 1. |
size | Integer | Query | No | 15 | The number of entries per page. Maximum value: 100. Default value: 20. |
Response parameters
Parameter |
Type |
Example |
Description |
RequestId | String | F99407AB-2FA9-489E-A259-40CF6DCC**** | The request ID. |
Headers | Object | The header of the response. |
|
X-Managed-StorageSize | Long | 18093942932 | The total size of hosted indexes. Unit: bytes. |
X-Managed-Count | Integer | 15 | The total number of hosted indexes. |
X-OSS-StorageSize | Long | 9093942932 | The total size of the OpenStore indexes in the cold phase. Unit: bytes. |
X-OSS-Count | Integer | 5 | The total number of OpenStore indexes in the cold phase. |
Result | Array of Result | The indexes. |
|
isManaged | String | false | This parameter is deprecated. |
createTime | String | 2021-01-11T05:49:41.114Z | The time when the index list was queried. |
size | Long | 49298589 | The total storage space occupied by the indexes. Unit: bytes. |
managedStatus | String | closing | The index hosting status. Valid values:
|
name | String | .kibana_task_manager_1 | The name of the index. |
health | String | green | The running status of the index. Valid values:
|
phase | String | warm | The storage lifecycle. Valid values:
Note If this parameter is empty, the index is not hosted. |
ilmExplain | String | { "indices": { ".ds-console-2021.08.18-000002": { "index": ".ds-console-2021.08.18-000002", "managed": true, "policy": "console", "lifecycle_date_millis": 1629277498775, "age": "2.64h", "phase": "hot", "phase_time_millis": 1629277450334, "action": "complete", "action_time_millis": 1629278605586, "step": "complete", "step_time_millis": 1629278605586, "phase_execution": { "policy": "console", "phase_definition": { "min_age": "0s", "actions": { "rollover": { "max_size": "1gb", "max_age": "1d", "max_docs": 10000 }, "set_priority": { "priority": 1000 } } }, "version": 1, "modified_date_in_millis": 1629277370953 } } } } | The full lifecycle status of the index. |
Examples
Sample requests
GET /openapi/instances/es-cn-tl329rbpc0001****/indices?all=false&name=log-0001&isManaged=false&isOpenstore=false&page=1&size=15 HTTP/1.1
Host:elasticsearch.aliyuncs.com
Content-Type:application/json
Sample success responses
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "F99407AB-2FA9-489E-A259-40CF6DCC****",
"Result" : [ {
"name" : ".kibana_task_manager_1",
"health" : "green",
"size" : 4929858933232,
"createTime" : "2021-01-11T05:49:41.114Z",
"managedStatus" : "closing",
"ilmExplain" : "{\n \"indices\": {\n \".kibana_task_manager_1\": {\n \"index\": \".kibana_task_manager_1\",\n \"managed\": false\n }\n }\n}"
}, {
"name" : ".ds-console-2021.08.18-000002",
"health" : "yellow",
"size" : 49298589,
"createTime" : "2021-01-11T05:49:41.114Z",
"managedStatus" : "following",
"phase" : "warm",
"ilmExplain" : "{\n \"indices\": {\n \".ds-console-2021.08.18-000002\": {\n \"index\": \".ds-console-2021.08.18-000002\",\n \"managed\": true,\n \"policy\": \"console\",\n \"lifecycle_date_millis\": 1629277498775,\n \"age\": \"2.64h\",\n \"phase\": \"hot\",\n \"phase_time_millis\": 1629277450334,\n \"action\": \"complete\",\n \"action_time_millis\": 1629278605586,\n \"step\": \"complete\",\n \"step_time_millis\": 1629278605586,\n \"phase_execution\": {\n \"policy\": \"console\",\n \"phase_definition\": {\n \"min_age\": \"0s\",\n \"actions\": {\n \"rollover\": {\n \"max_size\": \"1gb\",\n \"max_age\": \"1d\",\n \"max_docs\": 10000\n },\n \"set_priority\": {\n \"priority\": 1000\n }\n }\n },\n \"version\": 1,\n \"modified_date_in_millis\": 1629277370953\n }\n }\n }\n}"
} ],
"Headers" : {
"X-Managed-Count" : 15,
"X-Managed-StorageSize" : 18093942932,
"X-OSS-Count" : 5,
"X-OSS-StorageSize" : 9093942932
}
}
Error codes
For a list of error codes, see Service error codes.