You can call the UpdateAdminPassword to update the password of the elastic account of a specified Elasticsearch instance.
Note If an instance is in the activating, invalid, or inactive state, you cannot call the UpdateAdminPassword operation to update the instance information.
Debugging
Request headers
This operation uses only common request headers. For more information, see Common request headers.
Request syntax
PATCH|POST /openapi/instances/{InstanceId}/admin-pwd HTTP/1.1
Request parameters
Parameter | Type | Position | Required | Example | Description |
---|---|---|---|---|---|
InstanceId | String | Path | Yes | es-cn-nif1q9o8r0008**** | The ID of the instance. |
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 token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. |
Object | Body | No | The request body. |
||
esAdminPassword | String | Body | No | es_password | Specifies the updated password. Note
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 0FA05123-745C-42FD-A69B-AFF48EF9**** | The request ID. |
Result | Boolean | true | Whether the password is updated successfully:
|
Examples
Sample requests
PATCH /openapi/instances/es-cn-nif1q9o8r0008****/admin-pwd?clientToken=5A2CFF0E-5718-45B5-9D4D-70B3FF**** HTTP/1.1
Host:elasticsearch.aliyuncs.com
Content-Type:application/json
{
"esAdminPassword" : "es_password"
}
Sample success response
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"Result" : true,
"RequestId" : "0FA05123-745C-42FD-A69B-AFF48EF9****"
}
Error codes
For a list of error codes, see Service error codes.