资源uuid升级询价
接口功能介绍
支持云主机、云硬盘、弹性公网IP、NAT网关、共享带宽、性能保障型负载均衡、云主机备份存储库和云硬盘备份存储库产品产品的包年/包月或按量订单变配时的询价功能,根据资源uuid询价。
接口约束
无
URI
POST /v4/order/upgrade-query-price
路径参数
无
Query参数
无
请求参数
请求头header参数
无
请求体body参数
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
regionID | 是 | String | 资源池ID | 41f64827f25f468595ffa3a5deb5d15d | |
resourceUUID | 是 | String | 资源uuid | eip-2tgfff6jvw | |
resourceType | 是 | String | 资源类型 | IP | |
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",
"resourceUUID": "7e656368-5c82-ddd8-a8a4-2fbe6875aebc",
"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",
"resourceUUID": "32dee842-f5b2-b1bb-e382-31d2e1b54a60",
"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",
"resourceUUID": "41c05b3f-50f2-4e22-ba06-94c4548c1a0a",
"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",
"resourceUUID": "b38c136f-4cf2-48cf-b99f-43b7a65969d5",
"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",
"resourceUUID": "eip-2tgfff6jvw",
"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",
"resourceUUID": "eip-t4fhdkm3ee",
"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",
"resourceUUID": "bandwidth-rwz2d2k2bo",
"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",
"resourceUUID": "bandwidth-rwz2d2k2bo",
"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",
"resourceUUID": "natgw-21rovudenl",
"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",
"resourceUUID": "natgw-wvmhty3guk",
"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 | 云硬盘大小错误 |