All Products
Search
Document Center

Elastic Compute Service:ModifyPlanMaintenanceWindow

Last Updated:Oct 12, 2026

Updates an O&M window.

Operation description

Modifies the attributes of an O&M window. If the TargetResource parameter is set to associated ECS instances and a hardware risk at the underlying layer requires scheduled O&M for mitigation, the execution time of the scheduled O&M is determined by the interval specified in the TimePeriod parameter. When the execution time of the O&M event arrives, the platform automatically performs the corresponding O&M operations based on the event type.

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:ModifyPlanMaintenanceWindow

update

*All Resource

*

None None

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

PlanWindowId

string

Yes

The ID of the O&M window to be modified. This parameter is required.

pw-bp1au1w8v8a1yer65g5k

PlanWindowName

string

No

The name of the O&M window. Leave this parameter empty if you do not need to modify it.

WIndowName

Enable

boolean

No

Specifies whether to enable or disable the window. Leave this parameter empty if you do not need to modify it.

false

SupportMaintenanceAction

string

No

The supported O&M actions. Leave this parameter empty if you do not need to modify it.

Valid values:

  • Redeploy :

    Redeploy.

  • PerformanceImpact :

    Performance impact.

  • Reboot :

    Restart.

Reboot

RegionId

string

Yes

The region ID. This parameter is required for Alibaba Cloud SDK routing. However, setting any region ID for this operation makes no difference. The O&M window takes effect on all ECS instances across the network that meet the resource filtering conditions.

cn-hangzhou

TimePeriod

object

No

The recurrence cycle of the window. Leave this parameter empty if you do not need to modify it.

PeriodUnit

string

No

The type of the cycle. Valid values: Daily and Weekly.

Year

RangeList

array<object>

No

The time ranges of the O&M window recurrence cycle in the UTC time zone.

object

No

StartTime

string

No

The start time of the O&M window.

  • If PeriodUnit is set to Weekly, the format is Monday,22:00. You can replace Monday with Tuesday, Wednesday, Thursday, Friday, Saturday, or Sunday.

  • If PeriodUnit is set to Daily, the format is 22:00.

  • The comma separates the hour and minute. The first part represents the hour, which ranges from 00 to 23. The second part represents the minute, and only 00 is supported.

Monday,22:00

EndTime

string

No

The end time of the O&M window.

  • If PeriodUnit is set to Weekly, the format is Monday,22:00. You can replace Monday with Tuesday, Wednesday, Thursday, Friday, Saturday, or Sunday.

  • If PeriodUnit is set to Daily, the format is 22:00.

  • The comma separates the hour and minute. The first part represents the hour, which ranges from 00 to 23. The second part represents the minute, and only 00 is supported.

Tuesday,03:00

TargetResource

object

No

The resources to which the O&M window applies. Leave this parameter empty if you do not need to modify it.

Scope

string

No

The type of resources to which the O&M window applies.

Tag

ResourceGroupId

string

No

The ID of the resource group to which the O&M window applies. This parameter is required only when Scope is set to ResourceGroup.

rg-acfmy4cc27vsvia

Tags

array<object>

No

The tags to which the O&M window applies. This parameter is required only when Scope is set to Tag.

object

No

Key

string

No

The key of the tag to which the window applies.

tagKey

Value

string

No

The value of the tag to which the window applies.

tagValue

MinMaintenanceInterval

integer

No

The minimum time interval between the release time and the scheduled execution time of scheduled O&M events for the same instance. Valid values: 1 to 48. Unit: hours.

24

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID.

F3CD6886-D8D0-4FEE-B93E-1B732396****

Examples

Success response

JSON format

{
  "RequestId": "F3CD6886-D8D0-4FEE-B93E-1B732396****"
}

Error codes

HTTP status code

Error code

Error message

Description

500 InternalError Internal error. An internal error occurred. Try again.
403 AccessForbidden User not authorized to operate on the specified resource. You are not authorized to use the specified resource.
403 InvalidParameter.TimePeriod Invalid Parameter Time Period. Time Period property error.
403 InvalidParameter.TargetResource Invalid Parameter Target Resource. TargetResource property setting error
403 InvalidParameter.SupportMaintenanceAction Invalid Parameter SupportMaintenanceAction. SupportMaintenanceAction property setting error.
403 InvalidParameter.MinMaintenanceInterval Invalid Parameter MinMaintenanceInterval. MinMaintenanceInterval parameter setting error
404 InvalidResource.NotFound The specified resource not exists. The specified resource does not exist

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.