获取资源价格
更新时间:2025-08-15 03:41:38
基本信息
Action
GetPrice
Path
/iaas
Method
POST
请求参数
此接口除公共参数外,还包含以下参数。关于公共参数的更多信息,请参见前文内容。
| 参数名 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
currency |
String |
是 |
货币类型 |
duration |
Integer |
否 |
时长,不传默认为3600小时,支持1~60,单位 |
promotion_id |
String |
否 |
促销活动 ID |
promotion_ignore_user |
Integer |
否 |
获取促销价格时是否忽略用户 |
resources |
Array |
是 |
资源配置列表 |
resources.duration |
Integer |
是 |
时长,这里传了会覆盖请求参数的duration |
resources.sequence |
Integer |
是 |
请求序号,依据此映射返回的价格参数 |
resources.type |
String |
是 |
资源类型 |
start_time |
String |
否 |
价格生效的时间 |
user |
String |
否 |
用户 ID |
返回数据
此接口除公共返回参数外,还包含以下返回参数。关于公共返回参数的更多信息,请参见前文内容。
| 参数名 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
price_set |
Array |
否 |
价格信息的列表 |
price_set.available_coupon |
String |
否 |
序号对应产品配置可用优惠券金额 |
price_set.available_coupon_set |
Array |
否 |
序号对应产品配置可用优惠券列表 |
price_set.discount |
Integer |
否 |
折扣 |
price_set.normal_price |
String |
否 |
普惠价 |
price_set.original_price |
String |
否 |
原价 |
price_set.price |
String |
否 |
实际价格,仅当有促销价时,normal_price!=price |
price_set.sequence |
Integer |
否 |
序号,与请求的resources对应 |
请求示例
{
"currency": "cny",
"duration": 3600,
"resources": [
{
"bandwidth": 1,
"billing_mode": "bandwidth",
"media_type": "vm",
"sequence": 0,
"type": "new_wan_access"
}
],
"user": "usr-AebiPgK3",
"zone": "devops"
}
返回示例
{
"action": "GetPriceResponse",
"price_set": [
{
"available_coupon": "0",
"available_coupon_set": [],
"discount": 100,
"discount_details": {},
"normal_price": "1468.8",
"original_price": "1468.8",
"price": "1468.8",
"sequence": 0
}
],
"ret_code": 0
}