我正在尝试使用SoftLayer_Product_Order/<package>/verifyOrder.json
API验证我的JSON以订购一些Endurance NAS,但是对于许多组合。
我一直收到错误:
订单缺少以下类别:存储空间
但我似乎提供了有效的存储空间类型价格。
价格对象的组合是:
Type: 45064 (Endurance Storage)
IOPS: 45074 (LOW_INTENSITY_TIER)
Storage: 45856 (20 GB Storage Space)
Base Type: 45104 (Block Storage)
JSON:
{ "parameters" : [
{
"location" : "449494",
"packageId" : 240,
"osFormatType" : {
"id" : 12,
"keyName" : "LINUX"
},
"complexType" : "SoftLayer_Container_Product_Order_Network_Storage_Enterprise",
"quantity" : 1,
"prices" : [
{
"id" : "45064"
},
{
"id" : "45074"
},
{
"id" : "45856"
},
{
"id" : "45104"
}
]
}
]
}
REST通话:
https://api.softlayer.com/rest/v3/SoftLayer_Product_Order/240/verifyOrder.json
响应:
$VAR1 = {
'error' => 'Order is missing the following category: Storage Space.',
'code' => 'SoftLayer_Exception_Order_MissingCategory'
};
不确定我错过了什么。
答案 0 :(得分:0)
答案 1 :(得分:0)
定义存储价格时出错,您发送的是大小的快照,而不是块耐力
- 价格:45856 类别:存储快照空间
- 价格:45124 类别:存储空间
所以你需要使用属于“存储空间”(45124)的价格,一个可能有助于识别它们的请求应该是:
https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Product_Package/240/getItemPrices?objectFilter={"itemPrices":{"categories":{"name":{"operation":"Storage Space"}}}}&objectMask=mask[categories]
Method: Get
请试试这个:
{
"parameters":[
{
"location":"449494",
"packageId":240,
"osFormatType":{
"id":12,
"keyName":"LINUX"
},
"complexType":"SoftLayer_Container_Product_Order_Network_Storage_Enterprise",
"quantity":1,
"prices":[
{
"id":"45064"
},
{
"id":"45074"
},
{
"id":"45124"
},
{
"id":"45104"
}
]
}
]
}