All Products
Search
Document Center

Elastic Compute Service:DescribePlanMaintenanceWindows

Last Updated:Jun 15, 2026

Queries O&M windows.

Operation description

Queries the configured maintenance policies. Each policy contains two maintenance properties:

  • Maintenance time window: A time period you specify during which O&M operations are performed.

  • Maintenance action: The instance down handling policy you specify.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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

Specifies whether the window is enabled or disabled.

true

RegionId

string

Yes

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

cn-hangzhou

PlanWindowId

string

No

The ID of the O&M window.

pw-bp1jarob1aup7yvlrdt6

PlanWindowName

string

No

The name of the O&M window.

WIndowName

TargetResourceGroupId

string

No

The ID of the resource group to which the O&M window applies.

rg-d85g5yocioezmdrll

TargetResourceTags

object

No

The tags to which the O&M window applies.

Value

string

No

The value of the tag to which the window applies.

tagValue

Key

string

No

The key of the tag to which the window applies.

tagKey

NextToken

string

No

The pagination token. Set this parameter to the NextToken value returned in the previous API call.

AAAAAdDWBF2

MaxResults

integer

No

The number of entries per page for a paged query. Maximum value: 100. Default value: If the value is not specified or is less than 10, the default value is 10. If the value is greater than 100, the default value is 100.

10

Response elements

Element

Type

Description

Example

object

Schema of Response

TotalCount

integer

The total number of entries that match the query conditions. This parameter is optional and may not be returned by default.

1

RequestId

string

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

PlanMaintenanceWindowList

array<object>

The creation time.

array<object>

The target type. Valid values:

  • Tag

  • ResourceGroup

  • Instance

  • AliUid.

PlanWindowId

string

The ID of the O&M window.

pw-bp1bqkbjb7h4j8zqzwvp

PlanWindowName

string

The name of the O&M window.

WindowName

Enable

boolean

Indicates whether the O&M window is enabled.

true

SupportMaintenanceAction

string

The supported maintenance actions.

Reboot

CreateTime

string

The time when the O&M window was created.

The time follows the ISO 8601 standard in UTC. Format: yyyy-MM-ddTHH:mm:ssZ.

2025-04-11T02:20:41Z

ModifiedTime

string

The time when the O&M window was last modified.

The time follows the ISO 8601 standard in UTC. Format: yyyy-MM-ddTHH:mm:ssZ.

2025-02-22 10:14:28 +0800

TimePeriod

object

The recurrence cycle of the window.

PeriodUnit

string

The recurrence frequency of the maintenance window. Valid values: Daily and Weekly.

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 resources to which the O&M window applies.

Scope

string

The resource type that the maintenance window applies to. Valid values: Tag, ResourceGroup, Instance, and AliUid.

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

MinMaintenanceInterval

integer

NextToken

string

The query token returned by this call.

AAAAAdDWBF2

MaxResults

integer

The number of entries per page for a paged query. Maximum value: 100. Default value: If the value is not specified or is less than 10, the default value is 10. If the value is greater than 100, the default value is 100.

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.