All Products
Search
Document Center

Dedicated Host:DescribePlanMaintenanceWindows

Last Updated:Apr 04, 2026

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

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

Indicates whether the maintenance window is enabled.

true

RegionId

string

Yes

The ID of the region where the instance is located. Call the DescribeRegions operation to retrieve 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 token used to retrieve the next page of results. To continue the query, set this to the NextToken value from the previous response.

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:

  • Tag

  • ResourceGroup

  • Instance

  • AliUid

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: yyyy-MM-ddTHH:mm:ssZ.

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: 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 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 target resources for the maintenance window.

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

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.