我们发送了一个API调用来订购帐号910593中的Vyatta。此API运行良好,但这次失败了。我们收到此错误消息:
"价格20000 GB带宽(33867)对包无效 (236)"
以下是我们的请求正文:
{"orderContainers"=>[{"quantity"=>2,
"hardware"=>[{"hostname"=>"sjc01-ded-910593-A",
"domain"=>"bluemix.softlayer.com",
"primaryBackendNetworkComponent"=>{"networkVlanId"=>1178249}},
{"hostname"=>"sjc01-ded-910593-B", "domain"=>"bluemix.softlayer.com",
"primaryBackendNetworkComponent"=>{"networkVlanId"=>1178249}}],
"location"=>168642, "packageId"=>236, "prices"=>[{"id"=>49347},
{"id"=>22527}, {"id"=>36043}, {"id"=>32927}, {"id"=>33990},
{"id"=>33867}, {"id"=>24713}, {"id"=>33644}, {"id"=>34241},
{"id"=>34996}, {"id"=>33483}, {"id"=>35310}, {"id"=>34807},
{"id"=>32500}, {"id"=>32082}, {"id"=>25014}]}]}
答案 0 :(得分:0)
在查看包“236”
的有效商品价格后,此包的价格“33867”
不可用。用于确认它的请求是:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/236/getItemPrices?objectMask=mask[id,locationGroupId,item[id,keyName,description],pricingLocationGroup[locations[id, name, longName]]]
Method: GET
此套餐的唯一带宽价格为:31241
{
"id": 31241
"locationGroupId": null
"item": {
"description": "0 GB Bandwidth"
"id": 439
"keyName": "BANDWIDTH_0_GB_2"
}-
}
以下是使用以上价格成功运作的REST示例:
URL:
https://[username]:[apikey]api.softlayer.com/rest/v3/SoftLayer_Product_Order/verifyOrder
方法:POST
{
"parameters": [
{
"orderContainers": [
{
"hardware": [
{
"hostname": "vyattagw",
"domain": "mydoamin.com"
}
],
"location": 168642,
"packageId": 236,
"quantity": 1,
"prices": [
{
"id": 49347
},
{
"id": 22527
},
{
"id": 36043
},
{
"id": 32927
},
{
"id": 33990
},
{
"id": 31241
},
{
"id": 24713
},
{
"id": 33644
},
{
"id": 34241
},
{
"id": 34996
},
{
"id": 33483
},
{
"id": 35310
},
{
"id": 34807
},
{
"id": 32500
},
{
"id": 32082
},
{
"id": 25014
}
]
}
]
}
]
}
<强>参考文献:强>