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. For more information, see Common request headers.

Request syntax

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

Request parameters

Element Type Location Required Example Description
InstanceId String Path Yes es-cn-n6w1o1x0w001c****

The ID of the instance.

lang String Query No en

Gets the language of the report. The default is the browser language, which supports:

  • en: English
  • zh: Simplified Chinese
  • zt: Traditional Chinese
  • es: Spanish
  • FR: French
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 the value is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

Object Body No

The information about the diagnostic task.

indices Array of String Body No ["library"]

The list of diagnostic indexes. If the type parameter is set to ALL, you can set the indices parameter to null.

diagnoseItems Array of String Body No ["ClusterBulkRejectDiagnostic",...]

The diagnostic items. For more information, see the returned results of the ListDiagnosisItems.

type String Body No ALL

The type of the diagnostic task. Valid values:

  • ALL: All indexes are diagnosed.
  • SELECT: diagnoses the selected index.

Response parameters

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

The ID of the request.

Result Object

The returned data.

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 diagnostic instance.

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 responses

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 code

For a list of error codes, see Service error codes.