Following the example in https://gist.github.com/bmpotter/27913e92e9ff7b6b0c54 we tried to use the SoftLayer API to order a Bare Metal machine.
Our "verifyOrder" request i.e. ( https://$SLUSERNAME:[email protected]/rest/v3/SoftLayer_Product_Order/verifyOrder.json ) using the following json
{ "complexType":"SoftLayer_Container_Product_Order_Hardware_Server", "quantity":1, "hardware":[{"hostname":"userBM3", "domain":"cloud.com", "primaryBackendNetworkComponent":{"networkVlan":{"id":1050255, "primarySubnetId":1223965}}}], "location":"dal09", "useHourlyPricing":false, "packageId":251, "prices":[{"id":50659}, {"id":49447}, {"id":31154}, {"id":40148}, {"id":35963}, {"id":25014}, {"id":34807}, {"id":27023}, {"id":32627}, {"id":32500}, {"id":33483}, {"id":35310}, {"id":156765}, {"id":156765}, {"id":49841}, {"id":49841}, {"id":49841}, {"id":49841}, {"id":49841}, {"id":49841}, {"id":49841}, {"id":49841}, {"id":49841}, {"id":49841}, {"id":50223}, {"id":141945}], "storageGroups":[{"arrayTypeId":2, "hardDrives":[0, 1]},{"arrayTypeId":2, "hardDrives":[2, 3]}, {"arrayTypeId":9, "hardDrives":[4]}, {"arrayTypeId":9, "hardDrives":[5]}, {"arrayTypeId":9, "hardDrives":[6]}, {"arrayTypeId":9, "hardDrives":[7]}, {"arrayTypeId":9, "hardDrives":[8]}, {"arrayTypeId":9, "hardDrives":[9]}, {"arrayTypeId":9, "hardDrives":[10]}, {"arrayTypeId":9, "hardDrives":[11]}]
}
resulted in the following response
{"error":"An internal system error has occurred.","code":"SoftLayer_Exception_InternalError"}
We verified that all the price ids are valid and not able to figure out what is causing the internal error.
Try the following REST request:
https://$user:[email protected]/rest/v3/SoftLayer_Product_Order/verifyOrder
Method: Post
{
"parameters":[
{
"complexType":"SoftLayer_Container_Product_Order_Hardware_Server",
"quantity":1,
"hardware":[
{
"hostname":"userBM3",
"domain":"cloud.com",
"primaryBackendNetworkComponent":{
"networkVlan":{
"id":1050255,
"primarySubnetId":1223965
}
}
}
],
"location":"DALLAS09",
"useHourlyPricing":false,
"packageId":251,
"prices":[
{
"id":50659
},
{
"id":49447
},
{
"id":31154
},
{
"id":40148
},
{
"id":35963
},
{
"id":25014
},
{
"id":34807
},
{
"id":27023
},
{
"id":32627
},
{
"id":32500
},
{
"id":33483
},
{
"id":35310
},
{
"id":156765
},
{
"id":156765
},
{
"id":49841
},
{
"id":49841
},
{
"id":49841
},
{
"id":49841
},
{
"id":49841
},
{
"id":49841
},
{
"id":49841
},
{
"id":49841
},
{
"id":49841
},
{
"id":49841
},
{
"id":50223
},
{
"id":141945
}
],
"storageGroups":[
{
"arrayTypeId":2,
"hardDrives":[
0,
1
]
},
{
"arrayTypeId":2,
"hardDrives":[
2,
3
]
},
{
"arrayTypeId":9,
"hardDrives":[
4
]
},
{
"arrayTypeId":9,
"hardDrives":[
5
]
},
{
"arrayTypeId":9,
"hardDrives":[
6
]
},
{
"arrayTypeId":9,
"hardDrives":[
7
]
},
{
"arrayTypeId":9,
"hardDrives":[
8
]
},
{
"arrayTypeId":9,
"hardDrives":[
9
]
},
{
"arrayTypeId":9,
"hardDrives":[
10
]
},
{
"arrayTypeId":9,
"hardDrives":[
11
]
}
]
}
]
}
A quick view, there exist conflict between prices and Dallas09 location, see this article for more information please: Location-based Pricing and You
Updated
The 156765 price (description: 2.00 TB SATA) It's not a a valid price for Dallas 9
If you want to order the same item in Dallas 9, change 49821 instead of 156765
Price: 49821 which is a standard price (description: 2.00 TB).
References: