You can call this operation to modify the maintenance attributes of an instance.

Description

The operation is used to modify the maintenance policy of an instance, which contains the following two maintenance attributes:

Note The maintenance window is a function to be extended and cannot be used for the moment.
  • Maintenance window: the time period that you specify for O&M.
  • Maintenance action: the policy that you specify in respond to instance shutdown.

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 parameters

Parameter Type Required Example Description
Action String No ModifyInstanceMaintenanceAttributes

The operation that you want to perform. For API requests using the HTTP and HTTPS methods, this parameter is required. Set the value to ModifyInstanceMaintenanceAttributes.

RegionId String Yes cn-hangzhou

The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list.

InstanceId.N RepeatList No i-bp67acfmxazb4ph***

The IDs of N instances. Valid values of N: 1 to 100.

MaintenanceWindow.N.StartTime String No 02:00:00

The start time of the Nth maintenance window. The valid values of this parameter must be integer hours. Both minute and second must be set to 00. Valid values of N: 1.

Note This parameter is a function to be extended and cannot be used for the moment.
MaintenanceWindow.N.EndTime String No 18:00:00

The end time of the Nth maintenance window. The valid values of this parameter must be integer hours. Both minute and second must be set to 00. The parameters MaintenanceWindow.N.StartTime and MaintenanceWindow.N.EndTime must be specified at the same time, and the value of MaintenanceWindow.N.EndTime must be 1 to 23 hours later than the value of MaintenanceWindow.N.StartTime. Valid values of N: 1.

Note This parameter is a function to be extended and cannot be used for the moment.
ActionOnMaintenance String No AutoRecover

The maintenance action. Valid values:

  • Stop: shutdown.
  • AutoRecover: auto recovery.
  • AutoRedeploy: Data is migrated in case of shutdown, which may cause the damage of the data disk.

Response parameters

Parameter Type Example Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

Examples

Sample requests

https://ecs.aliyuncs.com?Action=ModifyInstanceMaintenanceAttributes
&InstanceId.1=i-bp67acfmxazb4ph***
&ActionOnMaintenance=AutoRecover
&<Common request parameters>

Sample success responses

XML format

<ModifyInstanceMaintenanceAttributesResponse>    
    <RequestId>E69FF3CC-94DD-42EF-8836-F33C45EDF9945ED</RequestId>
<ModifyInstanceMaintenanceAttributesResponse>

JSON format

{
    "RequestId": "E69FF3CC-94DD-42EF-8836-F33C45EDF9945ED"
}

Error codes

HTTP status code Error code Error message Description
404 InvalidInstanceId.NotFound %s The error message returned because the specified instance does not exist. Check the value specified for the InstanceId parameter.
403 InvalidParameter %s The error message returned because the specified parameter value is invalid.
403 OperationDenied.NotInWhiteList %s The error message returned because no whitelist is specified, which cause the operation to be denied.

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