Diagnoses an Elasticsearch cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses only common request headers and does not have operation-specific request headers. For more information, see the "Common request parameters" section of the "Common parameters" topic.

Request syntax

POST /openapi/diagnosis/instances/{InstanceId}/actions/diagnose HTTP/1.1

Request parameters

Parameter Type Position Required Example Description
InstanceId String Path Yes es-cn-n6w1o1x0w001c****

The ID of the instance.

lang String Query No en

Language configuration, support multiple languages:

  • En: english
  • zh: Simplified Chinese
  • zt: Traditional Chinese
ClientToken String Query No 5A2CFF0E-5718-45B5-9D4D-70B3FF****

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length.

String Body No { "indices":[], "type":"ALL", "diagnoseItems":[ "ClusterBulkRejectDiagnostic", "IndexAliasUseDiagnostic" ] }

The information about the diagnostic task. For more information, see the RequestBody section.

RequestBody

You must also specify the following parameters in the RequestBody parameter to specify the diagnostic task information.

Parameter

Type

Required

Example

Description

type

String

Yes

ALL

The type of the diagnostic task. Valid values:

ALL: diagnoses all indexes.

SELECT: diagnoses the selected index.

indices

List<String\>

Yes

["library"]

The list of diagnostic indexes. If type is set to ALL, indices can be set to null ([]).

diagnoseItems

List<String\>

Yes

["ClusterBulkRejectDiagnostic",...]

The diagnostic item.

Response parameters

Parameter Type Example Description
RequestId String 5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1D***

The ID of the request.

Result Object

The returned result.

createTime Long 1535745731000

The timestamp when the diagnostic report was generated.

reportId String trigger__2020-08-17T17:09:02

The ID of the report.

state String RUNNING

The diagnosis status. Valid values: Supported: SUCCESS, FAILED, and RUNNING.

instanceId String es-cn-n6w1o1x0w001c****

The ID of the instance for diagnosis.

diagnoseItems Array of diagnoseItems

Reports the list of diagnostic item information.

item String []

The asynchronous diagnostic task returns a null value. The return value of this field is not available and can be ignored.

Examples

Sample requests

POST /openapi/diagnosis/instances/es-cn-n6w1o1x0w001c****/actions/diagnose?lang=en&ClientToken=5A2CFF0E-5718-45B5-9D4D-70B3FF**** HTTP/1.1
Host:elasticsearch.aliyuncs.com
Content-Type:application/json

 {
    "indices":[],
    "type":"ALL",
    "diagnoseItems":[
        "ClusterBulkRejectDiagnostic",
        "IndexAliasUseDiagnostic",
        "ClusterColorStatusDiagnostic",
        "ClusterDiskResourceDiagnostic",
        "IndexRecoverySlowDiagnostic",
        "IndexReplicaDiagnostic",
        "KibanaIndexToMuchDiagnostic",
        "MasterNodeHighLoadDiagnostic",
        "NodeLeftDiagnostic",
        "NodeLoadDeviationDiagnostic",
        "ClusterComputingResourceDiagnostic",
        "NodeShardsToMuchDiagnostic",
        "IndexRegexpDeleteDiagnostic",
        "IndexSegmentsDiagnostic",
        "IndexShardsDiagnostic",
        "ClusterMinMasterDiagnostic",
        "ClusterStateVersionDiagnostic",
        "ErrorLogDiagnostic",
        "FullGcLogDiagnostic",
        "AutoSnapshotOpenDiagnostic"
    ]
}

Sample success response

JSON format

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

{
  "Result" : {
    "reportId" : "trigger__2020-10-19T16:49:56",
    "instanceId" : "es-cn-n6w1o1x0w001c****",
    "state" : "RUNNING",
    "createTime" : 0,
    "diagnoseItems" : [ ]
  },
  "RequestId" : "1EE5BB1E-7ECE-4CFE-A05A-7F1EE2C4****"
}

Error codes

For a list of error codes, visit the API Error Center.