ModifyCapacityReservation - 修改一个容量预定服务的部分信息

更新时间:2025-02-19 07:59:38

调用ModifyCapacityReservation修改一个容量预定服务的部分信息,包括容量预定服务的名称、描述信息、失效方式以及预留的实例总数量。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用前面加 * 表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
操作访问级别资源类型条件关键字关联操作
ecs:ModifyCapacityReservationupdate
*全部资源
*

请求参数

名称类型必填描述示例值
名称类型必填描述示例值
RegionIdstring

容量预定服务所属地域 ID。您可以调用 DescribeRegions 查看最新的阿里云地域列表。

cn-hangzhou
PrivatePoolOptions.Idstring

容量预定服务 ID。

crp-bp67acfmxazb4****
PrivatePoolOptions.Namestring

容量预定服务的名称。长度为 2~128 个英文或中文字符。必须以大小写字母或中文开头,不能以http://https://开头。可以包含数字、半角冒号(:)、下划线(_)或者连字符(-)。

eapTestName
Descriptionstring

容量预定服务的描述信息。长度为 2~256 个英文或中文字符,不能以http://https://开头。

This is description.
StartTimestring

容量预定服务的生效方式。目前仅支持设置为立即生效,且参数无需传值。

说明
该参数不传值即表示设置为立即生效。
Now
EndTimestring

容量预定服务的失效时间,仅EndTimeType=Limited时该参数生效。时间格式以 ISO8601 为标准,并需要使用 UTC +0 时间,格式为yyyy-MM-ddTHH:mm:ssZ。更多信息,请参见 ISO8601

2021-10-30T06:32:00Z
EndTimeTypestring

容量预定服务的失效方式。取值范围:

  • Limited:指定时间释放。必须同时指定EndTime参数。
  • Unlimited:手动释放。不限制时间。
Unlimited
Platformstring

实例使用的镜像的操作系统类型。取值范围:

  • Windows:Windows Server 类型的操作系统。
  • Linux:Linux 及类 Unix 类型的操作系统。
说明
该参数暂未开放使用。
Linux
InstanceAmountinteger

容量预定服务需要预留的实例总数量。取值范围:已使用的实例数量~1000

说明
扩充实例总数量时,可能因库存不足导致扩充失败。
100

返回参数

名称类型描述示例值
名称类型描述示例值
object
RequestIdstring

请求 ID。

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

示例

正常返回示例

JSON格式

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

错误码

HTTP status code错误码错误信息描述
HTTP status code错误码错误信息描述
400InvalidInstanceAmount.ValueNotSupportedThe specified parameter InstanceAmount is not valid.指定的参数InstanceAmount不符合要求。
400InvalidDescription.ValueNotSupportedThe specified Description is invalid.-
400InvalidEndTime.ValueNotSupportedThe specified EndTime is invalid.-
400InvalidStartTime.ValueNotSupportedThe specified StartTime is invalid.-
401InvalidUser.UnauthorizedThe user is not authorized.您当前使用的账号无权限。
403IncorrectPrivatePoolStatusThe current status of the private pool does not support this operation.参数中指定的私有池状态不支持当前操作
403OperationDenied.NoStockThe requested resource is sold out in the specified zone; try other types of resources or other regions and zones.库存不足。
403InvalidPrivatePoolOptionsName.ValueNotSupportedThe specified PrivatePoolOptions.Name is invalid.-
403InvalidPlatform.ValueNotSupportedThe specified Platform is invalid.-
403OperationDenied.PlatformNotSupportedThe specified private pool does not support this operation.-
403OperationDenied.EndTimeTypeNotSupportedThe specified private pool does not support this operation.-
403OperationDenied.StartTimeNotSupportedThe specified private pool does not support this operation.-
403OperationDenied.InstanceAmountNotSupportedThe specified private pool does not support this operation.-
403InvalidInstanceAmount.ValueNotSupportedThe specified InstanceAmount is invalid.-
403InvalidPrivatePoolOptions.IdThe specified private pool does not support this operation.-
403InvalidPrivatePoolOptions.IdThe specified PrivatePoolOptions.Id is invalid.指定的私有池无效
403OperationDenied.InstanceTypeNotAuthorizedThe specified InstanceType is not available or not authorized.指定的实例规格不可用或未被授权。
404InvalidPrivatePoolId.NotFoundThe specified private pool does not exist.指定的私有池不存在
500InternalErrorThe request processing has failed due to some unknown error.内部错误,请重试。

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
变更时间变更内容概要操作
2023-12-06OpenAPI 错误码发生变更查看变更详情
  • 本页导读 (1)
  • 调试
  • 授权信息
  • 请求参数
  • 返回参数
  • 示例
  • 错误码
  • 变更历史
AI助理

点击开启售前

在线咨询服务

你好,我是AI助理

可以解答问题、推荐解决方案等