You need to enable JavaScript to run this app.
导航

ModifyReservedInstances

最近更新时间2024.03.22 08:34:55

首次发布时间2023.11.21 10:21:45

调用 ModifyReservedInstances 接口更改预留实例券,包括更改预留实例券属性、拆分/合并预留实例券等。

说明

  • 为便于描述,本文将待更改的预留实例券称为原预留实例券,更改后得到的预留实例券称为目标预留实例券。
  • 更改预留实例券的注意事项,请参见更改预留实例券

请求参数

名称类型是否必填示例值描述
ActionStringModifyReservedInstances要执行的操作,取值:ModifyReservedInstances。
VersionString2020-04-01API的版本,取值: 2020-04-01。
RegionIdStringcn-beijing原预留实例券所属的地域ID。
您可以调用 DescribeRegions 接口查看地域ID。

ReservedInstanceIds.N

String

ReservedInstanceIds.1=ecsri-ycsimi9g465p****&ReservedInstanceIds.2=ecsri-ycsimi2db0l8j0wr****

原预留实例券ID,最多支持10个。

  • 参数 -N:表示原预留实例券的序号。

  • 多个ID之间用&分隔。

Configurations.N.ReservedInstanceName

String

Configurations.1.ReservedInstanceName=reserved-instance-test

目标预留实例券的名称。

  • 参数 -N:表示目标预留实例券的序号,N的取值范围:1~50。

  • 多个预留实例券之间用&分隔。

Configurations.N.InstanceCount

String

Configurations.1.InstanceCount=2

目标预留实例券可以抵扣的按量计费实例数量,最多支持100台。传入0时或者不传,会默认为1。

  • 参数 -N:表示目标预留实例券的序号,N的取值范围:1~50。

  • 多个预留实例券之间用&分隔。

Configurations.N.InstanceTypeId

String

Configurations.1.InstanceTypeId=ecs.g3i.xlarge

目标预留实例券可以匹配的实例规格ID。

  • 参数 -N:表示目标预留实例券的序号,N的取值范围:1~50。

  • 多个预留实例券之间用&分隔。

Configurations.N.Scope

String

Configurations.1.Scope=ZonalRI

目标预留实例券的类型,取值:

  • ZonalRI:可用区级预留实例券。

  • RegionalRI:地域级预留实例券。地域级预留实例券正在邀测中,如需试用,请提交工单或联系客户经理申请。

说明

  • 参数 -N:表示预留实例券的序号,N的取值范围:1~50。

  • 多个预留实例券之间用&分隔。

Configurations.N.ZoneId

String

Configurations.1.ZoneId=cn-beijing-a

目标预留实例券所在的可用区ID。
您可以调用 DescribeZones 查询一个地域下的可用区信息。

  • 参数 -N:表示预留实例券的序号,N的取值范围:1~50。

  • 多个预留实例券之间用&分隔。

说明

Configurations.N.Scope取值为ZonalRI时,该参数必填。

AutoRenew

Boolean

true

目标预留实例券到期后是否自动续费,取值:

  • true:自动续费

  • false(默认):不自动续费

说明

启用自动续费后,本次生成的所有目标券在到期前,平台将自动扣除续费费用,无需手动续费。

AutoRenewPeriod

Integer

1

每次自动续费的时长。

  • 仅当参数AutoRenew取值为true时,该参数有效,默认值为1。

  • PeriodUnit取值为Month时,AutoRenewPeriod取值为1、2、3、6、12。

ProjectName

String

project_a

资源所属项目,一个资源只能归属于一个项目。

  • 只能包含字母、数字、下划线“_”、点“.”和中划线“-”。

  • 长度限制在64个字符以内。

Tags.N.Key

String

Tags.1.Key=k1&Tags.2.Key=k2

用户标签的标签键。

  • 参数 - N:表示标签键的序号,取值范围:1~20。

  • 多个标签键之间用&分隔。

命名规则如下:

  • 不能以volc:sys:的任意大小写组合开头。

  • 只能包含语言字符、数字、空格和英文符号“_”、“.”、“:”、“/”、“=”、“+”、“-”、“@”。

  • 长度限制在1~128个字符之间。

说明

同一资源的标签键不允许重复。

Tags.N.Value

String

Tags.1.Value=v1&Tags.2.Value=v2

用户标签的标签值。

  • 参数 - N:表示标签值的序号,取值范围:1~20。

  • 多个标签值之间用&分隔。

命名规则如下:

  • 只能包含语言字符、数字、空格和英文符号“_”、“.”、“:”、“/”、“=”、“+”、“-”、“@”。

  • 允许为空,长度限制在0~256个字符之间。

说明

如果传入该参数,则必须先传入Tags.N.Key

ClientToken

String

333456899ff****

保证请求幂等性。由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。
取值:仅支持ASCII字符,且不能超过64个字符。

Configurations.N.HpcClusterId

String

Configurations.1.HpcClusterId=hpcCluster-1

高性能计算集群ID。

  • 参数 -N:表示预留实例券的序号。

  • 多个预留实例券之间用&分隔。

说明

仅当预留实例券对应的实例规格为高性能计算GPU型时,该参数生效。

返回数据

名称类型示例值描述
ReservedInstanceIdsList["ecsri-ycspipybqpl8j084****","ecsri-ecsri-yccazceloyf80n48****"]预留实例券ID。

请求示例

GET /?Action=ModifyReservedInstances&Version=2020-04-01&ReservedInstanceIds.1=ecsri-ycsimi9g465p****&ReservedInstanceIds.2=ecsri-ycsimi2db0l8j0wr****&Configurations.1.ReservedInstanceName=reserved-instance-test&Configurations.1.InstanceTypeId=ecs.g3i.xlarge&Configurations.1.InstanceCount=2&Configurations.1.Scope=ZonalRI&Configurations.1.ZoneId=cn-beijing-a HTTP/1.1
Host: open.volcengineapi.com
Region: cn-beijing-a
ServiceName: ecs

返回示例

{
    "ResponseMetadata": {
        "RequestId": "20231120161355D7AA5622C4F5C000****",
        "Action": "ModifyReservedInstances",
        "Version": "2020-04-01",
        "Service": "ecs",
        "Region": "cn-beijing"
    },
    "Result": {
        "ReservedInstanceIds": [
            "ecsri-ycspipybqpl8j084****"
        ]
    }
}

错误码

HttpCode错误码错误信息描述

400

IdempotentParameterMismatch

The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical.

幂等参数不一致。

400InvalidClientToken.MalformedThe specified ClientToken is malformed.指定的ClientToken不合法。
400InvalidInstanceStatusThe status of the specified instance does not support this request.当前实例的状态不支持此操作。

400

InvalidInstanceTypeAndInstanceCount

The specified InstanceType And InstanceCount is invalid.

指定的实例规格和实例数量不合法。

400InvalidInstanceTypeForCreateReservedInstance.UnsupportedThe specified InstanceType does not support creation of reserved instances.指定的实例规格不支持创建预留实例券。
400InvalidPeriodThe specified period is not valid.指定的计费周期个数不合法。

400

InvalidReservedInstanceIds.ZoneMismatch

The specified ReservedInstanceIds are in different Availability Zones.

指定预留实例券不属于同一个可用区。

400InvalidReservedInstanceModifyStatus.UnsupportedThe modify status of the specified reserved instance does not support this request.当前预留实例的更改状态不支持此操作。
400InvalidReservedInstanceName.MalformedThe specified ReservedInstanceName is malformed.指定的ReservedInstanceName不合法。

400

InvalidReservedInstanceStatus

The status of the specified reserved instance does not support this request.

当前预留实例的状态不支持此操作。

400InvalidScope.MalformedThe specified Scope is malformed.指定的预留实例券类型不合法。
400InvalidTagKey.MalformedThe specified TagKey is malformed.指定的标签键不合法。

400

InvalidTagValue.Malformed

The specified TagValue is malformed.

指定的标签值不合法。

400LimitExceeded.MaximumConfigurationsThe number of specified Configurations exceeds the maximum limit.指定的Configurations超过最大限制。
400LimitExceeded.MaximumInstanceCountThe number of specified InstanceCount exceeds the maximum limit.指定的InstanceCount超过最大限制。

400

LimitExceeded.MaximumReservedInstanceIds

The number of specified ReservedInstanceIds exceeds the maximum limit.

指定的ReservedInstanceIds超过最大限制。

400LimitExceeded.MaximumTagsYou've reached the limit on the number of tags that you can create.指定的标签数量超过最大限制。
400LimitExceeded.MinimumInstanceCountThe number of specified InstanceCount exceeds the minimum limit.指定的InstanceCount超过最小限制。

400

MissingParameter.Configurations

The required parameter Configurations is not supplied.

预留实例券配置不能为空。

400MissingParameter.ReservedInstanceIdsThe required parameter ReservedInstanceIds is not supplied.参数ReservedInstanceIds不能为空。
400MissingParameter.ReservedInstanceNameThe required parameter ReservedInstanceName is not supplied.参数ReservedInstanceName不能为空。

400

MissingParameter.ZoneId

The required parameter ZoneId is not supplied.

可用区ID不能为空。

400QuotaExceeded.MaximumReservedInstanceCpusYou've reached the limit on the number of reserved instance CPU that you can create, please submit ticket to request an increase in quota.预留实例数量配额不足,请提工单申请提高配额。
400QuotaExceeded.MaximumReservedInstanceTypeInstancesYou've reached the limit on the number of reserved instance type instances that you can create, please submit ticket to request an increase in quota.预留规格实例数量配额不足,请提工单申请提高配额。
404InvalidHpcCluster.NotFoundThe specified HpcCluster does not exist.指定的高性能集群不存在。
404InvalidInstance.NotFoundThe specified instance does not exist.指定的实例不存在。
404InvalidInstanceType.NotFoundThe specified InstanceType does not exist.指定的实例规格不存在。
404InvalidProject.NotFoundThe specified Project does not exist.指定的Project不存在。
404InvalidRegion.NotFoundThe specified region does not exist.指定的Region不存在。
404InvalidReservedInstance.NotFoundThe specified reserved instance does not exist.指定的预留实例不存在。
404InvalidZone.NotFoundThe specified zone does not exist.指定的可用区不存在。
409InvalidTagKey.ConflictThe specified TagKey already exists.指定的标签键已存在。
412IdempotentProcessingThe request uses the same client token as a previous one that is still in process.先前的幂等请求仍在处理中,请稍后重试。
412InvalidReservedInstanceModifyStatus.ComputeFactorMismatchThe compute factor of the specified reserved instances does not match.变更前后预留实例计算力因子不相等。
412InvalidReservedInstanceModifyStatus.ExpiredTimeMismatchThe expired time of the specified reserved instances does not match.预留实例到期时间不相等。
412InvalidReservedInstanceModifyStatus.InstanceTypeFamilyMismatchThe instancetype family of the specified reserved instances does not match.预留实例规格族不相等。
500Insufficient.InstanceCapacityThere is not enough capacity to fulfill your request.当前资源不足,请稍后重试或选择其它实例规格。
500InternalErrorAn internal error has occurred.内部错误,请重试。如果多次尝试失败,请提交工单。