Enables and modifies the maintenance window of an Elasticsearch cluster.

Before you call this operation, note that:

  • Before maintenance is performed, the system sends SMS messages and emails to the contacts listed in your Alibaba Cloud account.
  • On the day of instance maintenance, to ensure the stability of the entire maintenance process, the instance enters the Active state before it can be maintenance window. In this case, you can still access the cluster and perform query operations such as performance monitoring. However, you cannot perform modification operations such as restart and configuration upgrades for the cluster.
  • The instance connection may be disconnected within the available maintenance window. Make sure that the application has a reconnection mechanism.

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/instances/{InstanceId}/actions/modify-maintaintime HTTP/1.1

Request parameters

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

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 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 { "openMaintainTime": true, "maintainStartTime": "03:00Z", "maintainEndTime": "04:00Z" }

The request body parameters. For more information, see the RequestBody section.

RequestBody

You must also specify the following parameters in the RequestBody parameter to specify the maintenance window information.

Parameter

Type

Required

Example

Description

maintainStartTime

String

No

02:00Z

The start time of the maintenance window. Specify the time in the HH:mmZ format. The time must be in UTC.

maintainEndTime

String

No

06:00Z

The end time of the maintenance window. Specify the time in the HH:mmZ format. The time must be displayed in UTC.

openMaintainTime

boolean

Yes

true

Specifies whether to enable the maintenance window feature. Only true is supported, indicating that the feature is enabled.

Examples:


{
    "openMaintainTime": true,
    "maintainStartTime": "03:00Z",
    "maintainEndTime": "04:00Z"
}

Response parameters

Parameter Type Example Description
Result Boolean true

The returned result.

RequestId String 5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1****

The ID of the request.

Examples

Sample requests

POST /openapi/instances/es-cn-n6w1o1x0w001c****/actions/modify-maintaintime?ClientToken=5A2CFF0E-5718-45B5-9D4D-70B3FF**** HTTP/1.1
Host:elasticsearch.aliyuncs.com
Content-Type:application/json
{
    "openMaintainTime": true,
    "maintainStartTime": "03:00Z",
    "maintainEndTime": "04:00Z"
}

Sample success responses

JSON format

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

{
  "Result" : true,
  "RequestId" : "8577468C-D13F-4980-BD71-977F9D82****"
}

Error codes

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