首页 ModifyCapacityReservation

ModifyCapacityReservation

更新时间: 2026-05-14 11:19:07

Modifies the information of a capacity reservation, including the name, description, release mode, and the total number of Elastic Compute Service (ECS) instances for which capacity is reserved.

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

update

*CapacityReservation

acs:ecs:{#regionId}:{#accountId}:capacityreservation/{#CapacityReservationId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the capacity reservation. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

PrivatePoolOptions.Id

string

Yes

The capacity reservation ID.

crp-bp67acfmxazb4****

PrivatePoolOptions.Name

string

No

The name of the capacity reservation. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).

eapTestName

Description

string

No

The description of the capacity reservation. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.

This is description.

StartTime

string

No

The mode in which the capacity reservation takes effect. Only immediate capacity reservations are supported. You do not need to specify a value for this parameter.

Note

If you do not specify a value for this parameter, the capacity reservation immediately takes effect.

Now

EndTime

string

No

The expiration time of the capacity reservation. This parameter takes effect only when EndTimeType is set to Limited. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. For more information, see ISO 8601.

2021-10-30T06:32:00Z

EndTimeType

string

No

The release mode of the capacity reservation. Valid values:

  • Limited: The capacity reservation is automatically released at the specified point in time. If you configure this parameter, you must also configure EndTime.

  • Unlimited: The capacity reservation must be manually released. You can release it anytime.

Unlimited

Platform

string

No

The operating system of the image used by the instance. Valid values:

  • Windows

  • Linux

Note

This parameter is unavailable.

Linux

InstanceAmount

integer

No

The total number of instances for which capacity is reserved. Valid values: the number of used instances to 1000.

Note

When you increase the number of instances, the increase may fail due to insufficient resources.

100

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

8455DD10-84F8-43C9-8365-5F448EB169B6

Examples

Success response

JSON format

{
  "RequestId": "8455DD10-84F8-43C9-8365-5F448EB169B6"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidInstanceAmount.ValueNotSupported The specified parameter InstanceAmount is not valid.
400 InvalidDescription.ValueNotSupported The specified Description is invalid.
400 InvalidEndTime.ValueNotSupported The specified EndTime is invalid.
400 InvalidStartTime.ValueNotSupported The specified StartTime is invalid.
401 InvalidUser.Unauthorized The user is not authorized. The account you are currently using does not have permission.
500 InternalError The request processing has failed due to some unknown error.
403 IncorrectPrivatePoolStatus The current status of the private pool does not support this operation. The specified private pool state does not support the operation.
403 OperationDenied.NoStock The requested resource is sold out in the specified zone; try other types of resources or other regions and zones. The requested resources are insufficient.
403 InvalidPrivatePoolOptionsName.ValueNotSupported The specified PrivatePoolOptions.Name is invalid.
403 InvalidPlatform.ValueNotSupported The specified Platform is invalid.
403 OperationDenied.PlatformNotSupported The specified private pool does not support this operation.
403 OperationDenied.EndTimeTypeNotSupported The specified private pool does not support this operation.
403 OperationDenied.StartTimeNotSupported The specified private pool does not support this operation.
403 OperationDenied.InstanceAmountNotSupported The specified private pool does not support this operation.
403 InvalidInstanceAmount.ValueNotSupported The specified InstanceAmount is invalid.
403 InvalidPrivatePoolOptions.Id The specified private pool does not support this operation.
403 OperationDenied.InstanceTypeNotAuthorized The specified InstanceType is not available or not authorized. The specified InstanceType is not available or is not authorized.
404 InvalidPrivatePoolId.NotFound The specified private pool does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.

阿里云首页 云服务器 ECS 相关技术圈