Queries the maintenance attributes of instances.
Usage notes
You can call this operation to query the specified maintenance policy of an instance, which contains the following major maintenance attributes:
- Maintenance window: the time period that you specify for maintenance.
- Maintenance action: the action that you specify in response to instance shutdown.
Debugging
Request parameters
Parameter |
Type |
Required |
Example |
Description |
Action | String | Yes | DescribeInstanceMaintenanceAttributes | The operation that you want to perform. Set the value to DescribeInstanceMaintenanceAttributes. |
RegionId | String | Yes | cn-hangzhou | The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list. |
PageNumber | Long | No | 1 | The page number. Pages start from page 1. Default value: 1. |
PageSize | Long | No | 10 | The number of entries per page. Valid values: 1 to 100. Default value: 10. |
InstanceId.N | String | No | i-bp67acfmxazb4p**** | The ID of instance N. |
Response parameters
Parameter |
Type |
Example |
Description |
PageSize | Integer | 10 | The number of entries per page. |
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E | The ID of the request. |
PageNumber | Integer | 1 | The page number. |
TotalCount | Integer | 100 | The total number of queried maintenance attributes. |
MaintenanceAttributes | Array of MaintenanceAttribute | The maintenance attributes. |
|
MaintenanceAttribute | |||
NotifyOnMaintenance | Boolean | false | Indicates whether an event notification was sent before maintenance. |
InstanceId | String | i-bp67acfmxazb4p**** | The ID of the instance. |
MaintenanceWindows | Array of MaintenanceWindow | The maintenance windows. |
|
MaintenanceWindow | |||
EndTime | String | 18:00:00 | The end time of the maintenance window. |
StartTime | String | 02:00:00 | The start time of the maintenance window. |
ActionOnMaintenance | Object | The attributes of the maintenance action of the instance. |
|
DefaultValue | String | AutoRecover | The default maintenance action. |
Value | String | Stop | The current maintenance action. Valid values:
|
SupportedValues | Array of String | Stop | The supported maintenance action. |
Examples
Sample requests
https://ecs.aliyuncs.com?Action=DescribeInstanceMaintenanceAttributes
&InstanceId.1=i-bp67acfmxazb4p****
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeInstanceMaintenanceAttributesResponse>
<RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
<PageNumber>1</PageNumber>
<PageSize>10</PageSize>
<TotalCount>100</TotalCount>
<InstanceMaintenanceAttributes>
<InstanceMaintenanceAttribute>
<InstanceId>i-bp67acfmxazb4ph***</InstanceId>
<NotifyOnMaintenance>false</NotifyOnMaintenance>
<MaintenanceWindows >
<MaintenanceWindow>
<StartTime>02:00:00</StartTime>
<EndTime>18:00:00</EndTime>
</MaintenanceWindow>
</MaintenanceWindows >
<ActionOnMaintenance>
<Value>Stop</Value>
<DefaultValue>AutoRecover</DefaultValue>
<SupportedValues>
<SupportedValue>Stop</SupportedValue>
<SupportedValue>AutoRecover</SupportedValue>
</SupportedValues>
</ActionOnMaintenance>
</InstanceMaintenanceAttribute>
</InstanceMaintenanceAttributes>
</DescribeInstanceMaintenanceAttributesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"PageNumber" : 1,
"PageSize" : 10,
"TotalCount" : 100,
"InstanceMaintenanceAttributes" : {
"InstanceMaintenanceAttribute" : [ {
"InstanceId" : "i-bp67acfmxazb4ph***",
"NotifyOnMaintenance" : false,
"MaintenanceWindows " : {
"MaintenanceWindow" : [ {
"StartTime" : "02:00:00",
"EndTime" : "18:00:00"
} ]
},
"ActionOnMaintenance" : {
"Value" : "Stop",
"DefaultValue" : "AutoRecover",
"SupportedValues" : {
"SupportedValue" : [ "Stop", "AutoRecover" ]
}
}
} ]
}
}
Error codes
HTTP status code |
Error code |
Error message |
Description |
400 | MissingParameter | %s | A required parameter is not specified. |
403 | InvalidParameter | %s | Invalid parameter value. |
403 | InstanceIdLimitExceeded | %s | More than 100 instance IDs are specified. |
403 | OperationDenied.NotInWhiteList | %s | You are not authorized to perform this operation. Try again after you are authorized. |
404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | The instance is not found. Check whether the specified instance ID is valid. |
For a list of error codes, see Service error codes.