调用ModifyReservedInstances拆分、合并或修改预留实例券。
接口描述
调用该接口前,请阅读以下注意事项:
- 预留实例券的使用限制,请参见预留实例券概述中使用限制章节。
- 如果您需要拆分预留实例券,请先了解拆分预留实例券功能存在的限制,详情请参见拆分预留实例券。
- 如果您需要合并预留实例券,请先了解合并预留实例券功能存在的限制,详情请参见合并预留实例券。
- 如果您需要修改预留实例券,请先了解修改预留实例券功能的限制与方式,详情请参见修改预留实例券。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ModifyReservedInstances |
系统规定参数。取值:ModifyReservedInstances。 |
RegionId | String | 是 | cn-hangzhou |
预留实例券所属的地域ID。 您可以调用DescribeRegions查看最新的阿里云地域列表。 |
ReservedInstanceId.N | String | 否 | ecsri-bp15xx2**** |
预留实例券ID。N的取值范围:1~20。 |
Configuration.N.ReservedInstanceName | String | 否 | testReservedInstanceName |
预留实例券的名称。N的取值范围:1~100。 长度为2~128个英文或中文字符。必须以大小写字母或中文开头,不能以http://和https://开头。可以包含数字、半角冒号(:)、下划线(_)或者短划线(-)。 |
Configuration.N.ZoneId | String | 否 | cn-hangzhou-i |
预留实例券所属的可用区编号。N的取值范围:1~100
您可以调用DescribeZones获取可用区列表。 |
Configuration.N.Scope | String | 是 | Zone |
预留实例券的范围。取值范围:
N的取值范围:1~100。 默认值:Region。 |
Configuration.N.InstanceType | String | 是 | ecs.c5.4xlarge |
预留实例券可以同时匹配的实例规格。N的取值范围:1~100。 说明 适用的实例规格持续更新,详情请参见预留实例券概述的预留实例券属性章节。 |
Configuration.N.InstanceAmount | Integer | 是 | 1 | 预留实例券可以同时匹配同规格按量付费实例的数量。取值范围:≥1。N的取值范围:1~100。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | ED9E4A5F-FF4D-4C96-BE80-6B4227060DD7 |
请求ID。 |
ReservedInstanceIdSets | Array of String | {“ReservedInstanceId”:”ecsri-bp1cx3****”,”ecsri-bp15xx2****”]} |
预留实例券ID列表。 |
示例
请求示例
http(s)://ecs.aliyuncs.com/?Action=ModifyReservedInstances
&RegionId=cn-hangzhou
&ReservedInstanceId.1=ecsri-bp1cx3****
&ReservedInstanceId.2=ecsri-bp15xx2****
&Configuration.1.InstanceType=ecs.c5.4xlarge
&Configuration.1.Scope=Zone
&Configuration.2.InstanceType=ecs.g5.4xlarge
&Configuration.2.Scope=Region
&
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
ecsri-bp1cx3****
ecsri-bp15xx2****
ED9E4A5F-FF4D-4C96-BE80-6B4227060DD7
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"ReservedInstanceIdSets" : {
"ReservedInstanceId" : [ "ecsri-bp1cx3****", "ecsri-bp15xx2****" ]
},
"RequestId" : "ED9E4A5F-FF4D-4C96-BE80-6B4227060DD7"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidInstanceType.ValueUnauthorized | The specified InstanceType is not authorized. | 指定的实例规格未授权使用。 |
400 | InvalidParameter.Conflict | The specified region and cluster do not match. | 指定的地域与指定的集群不匹配。 |
400 | InvalidTagKey.Malformed | The specified Tag.n.Key is not valid. | 指定的标签键参数有误。 |
400 | RegionUnauthorized | %s | 该地域未被授权。%s为变量,将根据调用API的实际情况动态返回错误信息。 |
400 | Zone.NotOnSale | %s | 该可用区暂时关闭了售卖。%s为变量,将根据调用API的实际情况动态返回错误信息。 |
400 | InvalidPeriodUnit.ValueNotSupported | The specified parameter PeriodUnit is not valid. | 参数 PeriodUnit 无效。 |
400 | InvalidTagValue.Malformed | The specified Tag.n.Value is not valid. | 指定的标签值参数有误。 |
400 | InvalidChargeType.ValueNotSupported | ChargeType is not valid. | 该计费方式不支持,请您重新选择计费方式。 |
403 | OperationDenied.NoStock | The requested resource is sold out in the specified zone; try other types of resources or other regions and zones. | 请求的资源在指定的可用区已售完,请您更换实例规格或者可用区重试,调用 DescribeZones 接口可以获得库存结果。 |
403 | OperationDenied | Sales of this resource are temporarily suspended in the specified region; please try again later. | 指定的地域暂时关闭了此资源的售卖,请稍后重试。 |
403 | NodeControllerUnavailable | The Node Controller is temporarily unavailable. | 节点控制器暂不可用。 |
403 | OperationDenied | The resource is out of usage. | 该实例不在运行状态,请您启动实例或检查操作是否合理。 |
403 | InvalidParameter.ResourceOwnerAccount | ResourceOwnerAccount is Invalid. | 指定的 ResourceOwnerAccount 不合法。 |
403 | Zone.NotOpen | The specified zone is not granted to you to buy resources yet. | 用户未被授权购买指定的可用区的资源。 |
403 | Zone.NotOnSale | The specified zone is not available for purchase. | 指定可用区已经售罄,请您更换实例规格或者更换地域创建。 |
403 | InvalidParameter.NotMatch | %s | 您输入的参数无效,请检查参数之间是否冲突。 |
403 | Account.Arrearage | Your account has been in arrears. | 账户余额不足,请先充值再操作。 |
403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | 该资源目前的状态不支持此操作。 |
403 | OperationDenied.OnlyModifyName | It is not allowed to modify the ReservedInstanceName only. | 不允许只修改预留实例券的名称。 |
500 | InternalError | The request processing has failed due to some unknown error. | 内部错误,请重试。 |
500 | InternalError | %s | 内部错误。 |
访问错误中心查看更多错误码。
腾讯云1折,限时活动,即将结束: 马上收藏
同尘科技为腾讯云授权服务中心。
购买腾讯云产品享受折上折,更有现金返利。同意关联立享优惠
转转请注明出处:https://www.yunxiaoer.com/151702.html