本接口旨在为用户提供便捷、高效的方式来购买弹性保障服务。当用户存在资源准备完毕,处于未激活状态的弹性保障服务时,可以通过该接口进行购买。
接口说明
请确保在使用该接口前,已充分了解弹性保障产品的收费方式和价格。
购买弹性保障服务前,您可以调用 DescribeElasticityAssurances 查询可购买的弹性保障服务。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ecs:PurchaseElasticityAssurance |
update |
*ElasticityAssurance
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| RegionId |
string |
是 |
弹性保障服务所属地域 ID。您可以调用 DescribeRegions 查看最新的阿里云地域列表。 |
cn-hangzhou |
| Period |
integer |
否 |
购买时长。时长单位由 PeriodUnit 参数确定。取值范围:
默认值:1。 |
1 |
| PeriodUnit |
string |
否 |
时长单位。取值范围:
默认值:Year。 |
Month |
| PrivatePoolOptions.Id |
string |
是 |
弹性保障服务 ID。 |
eap-bp67acfmxazb4**** |
| ClientToken |
string |
否 |
保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。 |
123e4567-e89b-12d3-a456-426655440000 |
| PrivatePoolOptions.MatchCriteria |
string |
否 |
弹性保障服务的匹配模式。取值范围:
默认值:Open。 |
Open |
| StartTime |
string |
否 |
弹性保障服务生效时间。默认为调用该接口创建服务的时间。时间格式以 ISO8601 为标准,需要使用 UTC +0 时间,格式为 |
2024-06-18T00:00:00Z |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| RequestId |
string |
请求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
示例
正常返回示例
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidStartTime.MalFormed | The specified StartTime is out of the permitted range. | 指定的 StartTime 参数超出了最大有效取值。 |
| 400 | Invalid.PrivatePoolOptions.Id | The PrivatePool does not exist. | 私有池不存在。 |
| 400 | InvalidParameter.PeriodUnit | The specified PeriodUnit is not supported. | 指定的 PeriodUnit 参数不在有效的取值范围内。 |
| 401 | InvalidUser.Unauthorized | The user is not authorized. | 您当前使用的账号无权限。 |
| 500 | InternalError | Internal error. | 发生未知错误。 |
| 403 | IncorrectPrivatePoolStatus | The current status of the private pool does not support this operation. | 参数中指定的私有池状态不支持当前操作 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。