Querying maintenance windows
Operation description
Queries the configured maintenance policy, which includes two main attributes:
Maintenance window: A user-specified time period reserved for O&M.
Maintenance action: The user-specified policy for handling 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 instance is located. Call the |
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 token used to retrieve the next page of results. To continue the query, set this to the |
AAAAAdDWBF2 |
| MaxResults |
integer |
No |
The number of entries per page. Valid values: 1–100. Default: 10. |
10 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The data returned. |
||
| TotalCount |
integer |
The total number of entries that match the query conditions. This parameter is optional and is 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> |
The target type. The valid values are as follows:
|
||
| 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 uses the ISO 8601 format: |
2025-04-11T02:20:41Z |
| ModifiedTime |
string |
The time when the maintenance window was last modified. The time is in UTC and uses the ISO 8601 format: |
2025-02-22 10:14:28 +0800 |
| TimePeriod |
object |
The recurrence schedule of the maintenance window. |
|
| PeriodUnit |
string |
The recurrence frequency of the maintenance window. Valid values: |
Year |
| RangeList |
array<object> |
The UTC time ranges for the maintenance window's recurrence schedule. |
|
|
object |
|||
| StartTime |
string |
The start time of the maintenance window. |
Monday,22:00 |
| EndTime |
string |
The end time of the maintenance window. |
Monday,22:00 |
| TargetResource |
object |
The target resources for the maintenance window. |
|
| Scope |
string |
The resource type that the maintenance window applies to. Valid values: |
Tag |
| ResourceGroupId |
string |
The ID of the resource group that the maintenance window applies to. |
rg-aek2qxeteo7fr6y |
| Tags |
array<object> |
The tags that the maintenance window applies to. |
|
|
object |
|||
| Key |
string |
The tag key. |
tagKey |
| Value |
string |
The tag value. |
tagValue |
| NextToken |
string |
The pagination token to use in the next request to retrieve the next page of results. |
AAAAAdDWBF2 |
| MaxResults |
integer |
The number of entries per page. The value can be from 10 to 100. Default value: 10. |
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.