You can call this operation to UpdateAdminPassword the password of the elastic account of the specified Elasticsearch instance.

When you call this operation, take note of the following limits:

If the instance is in the Activating, Invalid, or Inactive state, the information cannot be updated.

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

PATCH|POST /openapi/instances/{InstanceId}/admin-pwd HTTP/1.1

Request parameters

Parameter Type Location Required Remarks Description
InstanceId String Path Yes es-cn-nif1q9o8r0008****

The ID of the ECS 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 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.

Object Body No

The request body parameters.

esAdminPassword String Body No es_password

Specifies the updated password.

Note The password must be 8 to 32 characters in length and must contain three characters: uppercase letters, lowercase letters, and special characters:! @#$%^&*()_+-=.

Response parameters

Element Type Example Description
RequestId String 0FA05123-745C-42FD-A69B-AFF48EF9****

The ID of the request.

Result Boolean true

Indicates whether the password was updated. Valid values:

  • true: The call was successful.
  • false: The call failed.

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 responses

JSON format

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

{
  "Result" : true,
  "RequestId" : "0FA05123-745C-42FD-A69B-AFF48EF9****"
}

Error code

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