订单升级询价
接口功能介绍
支持云主机、云硬盘、弹性公网IP、NAT网关、共享带宽、性能保障型负载均衡、云主机备份存储库和云硬盘备份存储库产品的包年/包月或按量订单变配时的询价功能
接口约束
无
URI
POST /v4/upgrade-order/query-price
路径参数
无
Query参数
无
请求参数
请求头header参数
无
请求体body参数
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
regionID | 是 | String | 资源池ID | 41f64827f25f468595ffa3a5deb5d15d | |
resourceID | 是 | String | 资源ID | 6ff3103f8daf41839d13dafa55e981c1 | |
resourceType | 是 | String | 资源类型 | VM | |
flavorName | 否 | String | 云主机规格,当resourceType为VM时必填 | s2.medium.2 | |
bandwidth | 否 | Integer | 带宽大小,范围[1,2000],需大于当前带宽,当resourceType为IP时必填 | 101 | |
diskSize | 否 | Integer | 磁盘大小,范围[10,2000],需大于当前大小,当resourceType为EBS时必填 | 40 | |
natType | 否 | String | NAT规格 | small | |
ipPoolBandwidth | 否 | Integer | 共享带宽大小,范围[5,2000],需大于当前带宽,当resourceType为IP_POOL时必填 | 10 | |
elbType | 否 | String | 性能保障型负载均衡类型,支持standardI/standardII/enhancedI/enhancedII/higherI,当resourceType为PGELB时必填 | standardI | |
cbrValue | 否 | Integer | 存储库大小,100-1024000GB,当resourceType为CBR_VM或CBR_VBS时必填 | 100 |
响应参数
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
statusCode | 是 | Integer | 返回状态码(800为成功,900为失败) | 800 | |
errorCode | 是 | String | 具体错误码标志 | ||
message | 是 | String | 失败时的错误信息 | ||
description | 是 | String | 失败时的错误描述 | ||
returnObj | 是 | Object | 成功时返回的数据,参见returnObj对象结构 | returnObj |
returnObj对象:
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
totalPrice | 是 | Float | 总价格 | 117.05 | |
discountPrice | 是 | Float | 折后价格 | 64.38 | |
finalPrice | 是 | Float | 最终价格 | 64.38 | |
subOrderPrices | 是 | Array of Objects | 子订单价格信息 | subOrderPrices |
subOrderPrices内容:
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
serviceTag | 是 | String | 服务类型 | OVMS | |
totalPrice | 是 | Float | 总价格 | 117.05 | |
finalPrice | 是 | Float | 最终价格 | 64.38 | |
orderItemPrices | 是 | Array of Objects | 资源价格信息 | orderItemPrices |
orderItemPrices内容:
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
resourceType | 是 | String | 资源类型 | VM | |
totalPrice | 是 | Float | 总价格 | 117.05 | |
finalPrice | 是 | Float | 最终价格 | 64.38 |
请求示例:
包周期云主机变配询价:
{
"resourceType": "VM",
"resourceID": "6ff3103f8daf41839d13dafa55e981c1",
"regionID": "41f64827f25f468595ffa3a5deb5d15d",
"flavorName": "s2.medium.2"
}
返回
{
"returnObj":
{
"discountPrice": 64.38,
"totalPrice": 117.05,
"finalPrice": 64.38,
"subOrderPrices":
[
{
"serviceTag": "OVMS",
"totalPrice": 117.05,
"orderItemPrices":
[
{
"itemId": "4a5be93780a311e7b63fa0369f9f6a76",
"resourceType": "VM",
"totalPrice": 117.05,
"finalPrice": 64.38
}
],
"finalPrice": 64.38,
"cycleType": 1
}
],
"isSucceed": true
},
"message": "",
"errorCode": "",
"description": "",
"statusCode": 800
}
按需云主机变配询价
{
"resourceType": "VM",
"resourceID": "369e3cdf9a0743ea809f91ab8f449d0f",
"regionID": "41f64827f25f468595ffa3a5deb5d15d",
"flavorName": "s2.medium.2"
}
返回:
{
"returnObj":
{
"discountPrice": 0.08,
"totalPrice": 0.15,
"finalPrice": 0.08,
"subOrderPrices":
[
{
"serviceTag": "OVMS",
"totalPrice": 0.15,
"orderItemPrices":
[
{
"itemId": "4a5be93780a311e7b63fa0369f9f6a76",
"resourceType": "VM",
"totalPrice": 0.15,
"finalPrice": 0.08
}
],
"finalPrice": 0.08
}
],
"isSucceed": true
},
"message": "",
"errorCode": "",
"description": "",
"statusCode": 800
}
包周期云硬盘变配询价:
{
"resourceType": "EBS",
"resourceID": "bc4af33cd6a44a8788757ed9a8ea11e1",
"regionID": "41f64827f25f468595ffa3a5deb5d15d",
"diskSize": 40
}
返回
{
"returnObj":
{
"discountPrice": 0,
"totalPrice": 12.9,
"finalPrice": 12.9,
"subOrderPrices":
[
{
"serviceTag": "OVMS",
"totalPrice": 12.9,
"orderItemPrices":
[
{
"itemId": "956a23cd50214c4b8ddd507dbc6be5ae",
"resourceType": "EBS",
"totalPrice": 12.9,
"finalPrice": 12.9
}
],
"finalPrice": 12.9,
"cycleType": 1
}
],
"isSucceed": true
},
"message": "",
"errorCode": "",
"description": "",
"statusCode": 800
}
按需云硬盘变配询价
{
"resourceType": "EBS",
"resourceID": "885c750184e941729b836319e63fe47f",
"regionID": "41f64827f25f468595ffa3a5deb5d15d",
"diskSize": 60
}
返回
{
"returnObj":
{
"discountPrice": 0,
"totalPrice": 0.03,
"finalPrice": 0.03,
"subOrderPrices":
[
{
"serviceTag": "OVMS",
"totalPrice": 0.03,
"orderItemPrices":
[
{
"itemId": "956a23cd50214c4b8ddd507dbc6be5ae",
"resourceType": "EBS",
"totalPrice": 0.03,
"finalPrice": 0.03
}
],
"finalPrice": 0.03
}
],
"isSucceed": true
},
"message": "",
"errorCode": "",
"description": "",
"statusCode": 800
}
包周期弹性公网IP变配询价
{
"resourceType": "IP",
"resourceID": "afc71813c4b3494b9a8b439ba4d4fc5c",
"bandwidth": 101,
"regionID": "41f64827f25f468595ffa3a5deb5d15d"
}
返回
{
"returnObj":
{
"discountPrice": 0,
"totalPrice": 150.32,
"finalPrice": 150.32,
"subOrderPrices":
[
{
"serviceTag": "OVMS",
"totalPrice": 150.32,
"orderItemPrices":
[
{
"itemId": "4092314281f94139b0d1693db96d662a",
"resourceType": "NETWORK",
"totalPrice": 150.32,
"finalPrice": 150.32
}
],
"finalPrice": 150.32,
"cycleType": 1
}
],
"isSucceed": true
},
"message": "",
"errorCode": "",
"description": "",
"statusCode": 800
}
按需弹性公网IP变配询价
{
"resourceType": "IP",
"resourceID": "b6834abbd8da4cf1a4146b75beaa49bd",
"bandwidth": 2,
"regionID": "41f64827f25f468595ffa3a5deb5d15d"
}
返回
{
"returnObj":
{
"discountPrice": 0,
"totalPrice": 0.11,
"finalPrice": 0.11,
"subOrderPrices":
[
{
"serviceTag": "OVMS",
"totalPrice": 0.11,
"orderItemPrices":
[
{
"itemId": "4092314281f94139b0d1693db96d662a",
"resourceType": "NETWORK",
"totalPrice": 0.11,
"finalPrice": 0.11
}
],
"finalPrice": 0.11
}
],
"isSucceed": true
},
"message": "",
"errorCode": "",
"description": "",
"statusCode": 800
}
包周期共享带宽变配询价
{
"resourceType": "IP_POOL",
"resourceID": "1a85a1f3443b4cdea33444800064b8b9",
"ipPoolBandwidth": 101,
"regionID": "41f64827f25f468595ffa3a5deb5d15d"
}
返回
{
"returnObj":
{
"discountPrice": 0,
"totalPrice": 150.32,
"finalPrice": 150.32,
"subOrderPrices":
[
{
"serviceTag": "OVMS",
"totalPrice": 150.32,
"orderItemPrices":
[
{
"itemId": "4092314281f94139b0d1693db96d662a",
"resourceType": "NETWORK",
"totalPrice": 150.32,
"finalPrice": 150.32
}
],
"finalPrice": 150.32,
"cycleType": 1
}
],
"isSucceed": true
},
"message": "",
"errorCode": "",
"description": "",
"statusCode": 800
}
按需共享带宽变配询价
{
"resourceType": "IP_POOL",
"resourceID": "b6834abbd8da4cf1a4146b75beaa49bd",
"ipPoolBandwidth": 20,
"regionID": "41f64827f25f468595ffa3a5deb5d15d"
}
返回
{
"returnObj":
{
"discountPrice": 0,
"totalPrice": 0.11,
"finalPrice": 0.11,
"subOrderPrices":
[
{
"serviceTag": "OVMS",
"totalPrice": 0.11,
"orderItemPrices":
[
{
"itemId": "4092314281f94139b0d1693db96d662a",
"resourceType": "NETWORK",
"totalPrice": 0.11,
"finalPrice": 0.11
}
],
"finalPrice": 0.11
}
],
"isSucceed": true
},
"message": "",
"errorCode": "",
"description": "",
"statusCode": 800
}
包周期NAT网关变配询价
{
"resourceType": "NAT",
"resourceID": "a9010766e9494d12a81371b3daed102f",
"natType": "large",
"regionID": "41f64827f25f468595ffa3a5deb5d15d"
}
返回
{
"returnObj":
{
"discountPrice": 0,
"totalPrice": 150.32,
"finalPrice": 150.32,
"subOrderPrices":
[
{
"serviceTag": "OVMS",
"totalPrice": 150.32,
"orderItemPrices":
[
{
"itemId": "bb3d33548c714f2798ae01b62a9f9818",
"resourceType": "GATEWAY",
"totalPrice": 150.32,
"finalPrice": 150.32
}
],
"finalPrice": 150.32,
"cycleType": 1
}
],
"isSucceed": true
},
"message": "",
"errorCode": "",
"description": "",
"statusCode": 800
}
按需NAT网关变配询价
{
"resourceType": "NAT",
"resourceID": "b6834abbd8da4cf1a4146b75beaa49bd",
"natType": "large",
"regionID": "41f64827f25f468595ffa3a5deb5d15d"
}
返回
{
"returnObj":
{
"discountPrice": 0,
"totalPrice": 0.11,
"finalPrice": 0.11,
"subOrderPrices":
[
{
"serviceTag": "OVMS",
"totalPrice": 0.11,
"orderItemPrices":
[
{
"itemId": "4092314281f94139b0d1693db96d662a",
"resourceType": "GATEWAY",
"totalPrice": 0.11,
"finalPrice": 0.11
}
],
"finalPrice": 0.11
}
],
"isSucceed": true
},
"message": "",
"errorCode": "",
"description": "",
"statusCode": 800
}
失败返回示例:
{
"errorCode": "Unknown.Parameter.InvalidError",
"details": "",
"message": "request param error: resourceID is not empty",
"description": "请求参数错误: 资源id不能为空",
"statusCode": 900
}
资源类型
值 | 说明 |
---|---|
VM | 云主机 |
EBS | 云硬盘 |
IP | 弹性公网IP |
IP_POOL | 共享带宽 |
NAT | NAT网关 |
PGELB | 性能保障型负载均衡 |
CBR_VM | 云主机备份存储库 |
CBR_VBS | 云硬盘备份存储库 |
NAT规格
值 | 说明 |
---|---|
small | 小型 |
medium | 中型 |
large | 大型 |
xlarge | 超大型 |
状态码
状态码 | 描述 |
---|---|
200 | 表示请求成功。 |
错误码说明:
errorCode | 含义 |
---|---|
Unknown.Parameter.InvalidError | 参数有误 |
OrderPrice.ResourceNotExist | 资源未查询到 |
Vm.OrderPrice.InvalidFlavor | 云主机规格不正确 |
Ip.OrderPrice.InvalidBandwidth | 弹性公网IP带宽大小错误 |
Ebs.OrderPrice.SizeError | 云硬盘大小错误 |