Query maintenance windows
Operation description
A configured maintenance policy includes two main attributes.
Maintenance window: A user-specified time period during which O&M can be performed.
Maintenance action: A user-specified policy that determines how to handle instance downtime.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DescribePlanMaintenanceWindows |
list |
*All Resource
|
None | None |
Request syntax
GET HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Enable |
boolean |
No |
Indicates whether the maintenance window is enabled. |
true |
| RegionId |
string |
Yes |
The ID of the region where the ECS instance is located. You can call the DescribeRegions operation to query the latest list of Alibaba Cloud regions. |
cn-hangzhou |
| PlanWindowId |
string |
No |
The ID of the maintenance window. |
pw-bp1jarob1aup7yvlrdt6 |
| PlanWindowName |
string |
No |
The name of the maintenance window. |
WIndowName |
| TargetResourceGroupId |
string |
No |
The ID of the resource group to which the maintenance window applies. |
rg-d85g5yocioezmdrll |
| TargetResourceTags |
object |
No |
The tags of the resources to which the maintenance window applies. |
|
| Value |
string |
No |
The value of the tag. |
tagValue |
| Key |
string |
No |
The key of the tag. |
tagKey |
| NextToken |
string |
No |
The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the last query as the value of NextToken. |
AAAAAdDWBF2 |
| MaxResults |
integer |
No |
The number of entries to return on each page. Valid values: 1 to 100. Default value: 10. |
10 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response object. |
||
| TotalCount |
integer |
The total number of entries that match the query. This parameter is optional and not returned by default. |
1 |
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
| PlanMaintenanceWindowList |
array<object> |
A list of maintenance windows. |
|
|
array<object> |
|
||
| PlanWindowId |
string |
The ID of the maintenance window. |
pw-bp1bqkbjb7h4j8zqzwvp |
| PlanWindowName |
string |
The name of the maintenance window. |
WindowName |
| Enable |
boolean |
Indicates whether the maintenance window is enabled. |
true |
| SupportMaintenanceAction |
string |
The supported maintenance action. |
Reboot |
| CreateTime |
string |
The creation time of the maintenance window. The time is in UTC and follows the ISO 8601 standard, formatted as yyyy-MM-ddTHH:mm:ssZ. |
2025-04-11T02:20:41Z |
| ModifiedTime |
string |
The modification time of the maintenance window. The time is in UTC and follows the ISO 8601 standard, formatted as yyyy-MM-ddTHH:mm:ssZ. |
2025-02-22 10:14:28 +0800 |
| TimePeriod |
object |
The recurrence schedule of the maintenance window. |
|
| PeriodUnit |
string |
The recurrence frequency. Valid values: Daily and Weekly. |
Year |
| RangeList |
array<object> |
The recurring UTC time ranges for the maintenance window. |
|
|
object |
|||
| StartTime |
string |
The start time of the time range. |
Monday,22:00 |
| EndTime |
string |
The end time of the time range. |
Monday,22:00 |
| TargetResource |
object |
The resources targeted by the maintenance window. |
|
| Scope |
string |
The scope of the target resources. Valid values: Tag, ResourceGroup, Instance, and AliUid. |
Tag |
| ResourceGroupId |
string |
The ID of the target resource group. |
rg-aek2qxeteo7fr6y |
| Tags |
array<object> |
The target tags. |
|
|
object |
|||
| Key |
string |
The tag key. |
tagKey |
| Value |
string |
The tag value. |
tagValue |
| NextToken |
string |
The token to retrieve the next page of results. |
AAAAAdDWBF2 |
| MaxResults |
integer |
The number of entries to return per page. The default value is 10, and the maximum value is 100. If you omit this parameter or specify a value less than 10, the default value is used. If you specify a value greater than 100, the maximum value is used. |
10 |
Examples
Success response
JSON format
{
"TotalCount": 1,
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
"PlanMaintenanceWindowList": [
{
"PlanWindowId": "pw-bp1bqkbjb7h4j8zqzwvp",
"PlanWindowName": "WindowName",
"Enable": true,
"SupportMaintenanceAction": "Reboot",
"CreateTime": "2025-04-11T02:20:41Z",
"ModifiedTime": "2025-02-22 10:14:28 +0800",
"TimePeriod": {
"PeriodUnit": "Year",
"RangeList": [
{
"StartTime": "Monday,22:00",
"EndTime": "Monday,22:00"
}
]
},
"TargetResource": {
"Scope": "Tag",
"ResourceGroupId": "rg-aek2qxeteo7fr6y",
"Tags": [
{
"Key": "tagKey",
"Value": "tagValue"
}
]
}
}
],
"NextToken": "AAAAAdDWBF2",
"MaxResults": 10
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 500 | InternalError | Internal error. | |
| 403 | AccessForbidden | User not authorized to operate on the specified resource. | You are not authorized to use the specified resource. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.