最近更新时间:2024.04.16 14:15:07
首次发布时间:2023.11.21 10:21:45
调用 PurchaseReservedInstances 接口购买一张预留实例券。
说明
有关预留实例券的更多介绍,请参见预留实例券概述。
名称 | 类型 | 是否必填 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | PurchaseReservedInstances | 要执行的操作,取值:PurchaseReservedInstances。 |
Version | String | 是 | 2020-04-01 | API的版本,取值:2020-04-01。 |
Scope | String | 否 | ZonalRI | 预留实例券的类型,取值:
|
ZoneId | String | 否 | cn-beijing-a | 可用区级预留实例券所在的可用区ID。 说明
|
RegionId | String | 否 | cn-beijing | 预留实例券所属的地域ID。 说明
|
ReservedInstanceName | String | 是 | reserved-instance-test | 预留实例券的名称,取值:
|
InstanceCount | Integer | 否 | 1 | 预留实例券可以抵扣和预留的按量计费实例数量。取值范围:1~100;传入0时或者不传,会默认为1。 |
InstanceTypeId | String | 是 | ecs.g3i.large | 预留实例券可以抵扣和预留的实例规格。 说明 支持购买预留实例券的实例规格请参见购买预留实例券。 |
Period | Integer | 否 | 12 | 预留实例券的购买时长(月)。
|
PeriodUnit | String | 否 | Month | 购买预留实例券的时长单位,取值:Month。 |
AutoRenew | Boolean | 否 | true | 预留实例券到期后是否自动续费,取值:
|
AutoRenewPeriod | Integer | 否 | 1 | 每次自动续费的时长。
|
ProjectName | String | 否 | project_a | 资源所属项目,一个资源只能归属于一个项目。
|
Tags.N.Key | String | 否 | Tags.1.Key=k1&Tags.2.Key=k2 | 用户标签的标签键。
命名规则如下:
说明 同一资源的标签键不允许重复。 |
Tags.N.Value | String | 否 | Tags.1.Value=v1&Tags.2.Value=v2 | 用户标签的标签值。
命名规则如下:
说明 如果传入该参数,则必须先传入 |
ClientToken | String | 否 | 333456899ff**** | 保证请求幂等性。由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。 |
HpcClusterId | String | 否 | hpcCluster-1 | 购买高性能计算GPU型实例的预留实例券时,需指定高性能计算集群ID。 说明 如需购买GPU型的预留实例券,请联系客户经理申请。 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
ReservedInstanceId | String | ecsri-ycq8kgnlxrb5oxt0**** | 预留实例券ID。 |
GET /?Action=PurchaseReservedInstances&Version=2020-04-01&RegionId=cn-beijing&ZoneId=cn-beijing-a&ReservedInstanceName=reserved-instance-test&InstanceTypeId=ecs.g3i.large HTTP/1.1 Host: open.volcengineapi.com Region: cn-beijing ServiceName: ecs
{ "ResponseMetadata": { "RequestId": "2021062415303301022514515207C4****", "Action": "PurchaseReservedInstances", "Version": "2020-04-01", "Service": "ecs", "Region": "cn-beijing" }, "Result": { "ReservedInstanceId": "ecsri-ycq8kgnlxrb5oxt0****" } }
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidCount.Malformed | The specified count is malformed. | 指定的参数Count不合法。 |
400 | InvalidInstanceTypeForCreateReservedInstance.Unsupported | The specified InstanceType does not support creation of reserved instances. | 指定的实例规格不支持创建预留实例券。 |
400 | InvalidPeriod | The specified period is not valid. | 指定的计费周期个数不合法。 |
400 | InvalidPeriodUnit | The specified PeriodUnit is not valid, is unsupported, or cannot be used. | 指定的计费周期不合法。 |
400 | InvalidReservedInstanceName.Malformed | The specified ReservedInstanceName is malformed. | 指定的ReservedInstanceName不合法。 |
400 | InvalidScope.Malformed | The specified Scope is malformed. | 指定的预留实例券类型不合法。 |
400 | InvalidTagKey.Malformed | The specified TagKey is malformed. | 指定的标签键不合法。 |
400 | InvalidTagValue.Malformed | The specified TagValue is malformed. | 指定的标签值不合法。 |
400 | LimitExceeded.MaximumTags | You've reached the limit on the number of tags that you can create. | 指定的标签数量超过最大限制。 |
400 | LimitExceeded.MinimumInstanceCount | The number of specified InstanceCount exceeds the minimum limit. | 指定的InstanceCount超过最小限制。 |
400 | LimitExceeded.ReservedCapacitySize | The specified reserved capacity size exceeds the limit. | 指定的预留存储容量大小(GiB)超出限制。 |
400 | MissingParameter.InstanceTypeId | The required parameter InstanceTypeId is not supplied. | 实例规格ID不能为空。 |
400 | MissingParameter.ReservedInstanceName | The required parameter ReservedInstanceName is not supplied. | 参数ReservedInstanceName不能为空。 |
400 | MissingParameter.ZoneId | The required parameter ZoneId is not supplied. | 可用区ID不能为空。 |
400 | QuotaExceeded.MaximumReservedInstanceCpus | You've reached the limit on the number of reserved instance CPU that you can create, please submit ticket to request an increase in quota. | 预留实例CPU配额不足,请提工单申请提高配额。 |
400 | QuotaExceeded.MaximumReservedInstanceTypeInstances | You'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. | 预留规格实例数量配额不足,请提工单申请提高配额。 |
400 | QuotaExceeded.MaximumReservedInstances | You've reached the limit on the number of reserved instances that you can create, please submit ticket to request an increase in quota. | 预留实例数量配额不足,请提工单申请提高配额。 |
404 | InvalidHpcCluster.NotFound | The specified HpcCluster does not exist. | 指定的高性能集群不存在。 |
404 | InvalidInstanceType.NotFound | The specified InstanceType does not exist. | 指定的实例规格不存在。 |
404 | InvalidProject.NotFound | The specified Project does not exist. | 指定的Project不存在。 |
404 | InvalidRegion.NotFound | The specified region does not exist. | 指定的Region不存在。 |
404 | InvalidZone.NotFound | The specified zone does not exist. | 指定的可用区不存在。 |
409 | InvalidTagKey.Conflict | The specified TagKey already exists. | 指定的标签键已存在。 |
500 | Insufficient.InstanceCapacity | There is not enough capacity to fulfill your request. | 当前资源不足,请稍后重试或选择其它实例规格。 |
500 | InternalError | An internal error has occurred. | 内部错误,请重试。如果多次尝试失败,请提交工单。 |
500 | Insufficient.VolumePoolCapacity | There is not enough capacity to fulfill your request. | 当前存储池容量不足。 |