Call ValidateConnection to verify the connectivity of Elasticsearch instance providing x-pack monitoring in the monitoring alarm configuration of the Logstash instance.
Debugging
Request header
This operation uses only common request headers. For more information, see Common parameters.
Request syntax
POST /openapi/logstashes/[InstanceId]/validate-connection HTTPS|HTTP
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
InstanceId | String | Yes | ls-cn-oew1qbgl**** |
The ID of the Logstash instance. |
ClientToken | String | No | 5A2CFF0E-5718-45B5-9D4D-70B3FF**** |
A unique token generated by the client to guarantee the idempotency of the request. The value of this parameter is generated by the client and is unique among different requests. The maximum length is 64 ASCII characters. |
RequestBody
Enter the following parameters in RequestBody to specify the Elasticsearch instance to be connected.
Parameter |
Type |
Required |
Example |
Description |
---|---|---|---|---|
endpoints |
List<String\> |
Yes |
["http://es-cn-n6w1o1x0w001c****.elasticsearch.aliyuncs.com:9200"] |
The access address of the X-Pack instance that the Elasticsearch provides for monitoring. |
userName |
String |
Yes |
elastic |
Username of the Elasticsearch instance. |
password |
String |
Yes |
xxx |
Password of the Elasticsearch instance. |
Sample code:
{
"endpoints": [
"http://es-cn-n6w1o1x0w001c****.elasticsearch.aliyuncs.com:9200"
],
"userName": "elastic",
"password": "xxxx"
}
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1D*** |
The ID of the request. |
Result | Boolean | true |
Returned results:
|
Examples
Sample requests
POST /openapi/logstashes/ls-cn-oew1qbgl****/validate-connection HTTP/1.1
common request header
{
"endpoints": [
"http://es-cn-n6w1o1x0w001c****.elasticsearch.aliyuncs.com:9200"
],
"userName": "elastic",
"password": "xxxx"
}
Sample success responses
JSON
Syntax
{
"Result": true,
"RequestId": "D5B41051-FE06-4986-9D87-3779E627****"
}
Error codes
For a list of error codes, visit the API Error Center.