摘录来自https://api.softlayer.com/rest/v3/SoftLayer_Product_Package/getAllObjects
{
"firstOrderStepId": 1,
"id": 50,
"isActive": 1,
"keyName": "BARE_METAL_INSTANCE",
"name": "Bare Metal Instance",
"unitSize": 1
},
使用此ID我拨打电话:https://api.softlayer.com/rest/v3/SoftLayer_Product_Package/50/getRegions 返回dal01,dal05,dal06,dal07和dal09,但dal10不返回。这解释了我在尝试验证dal10中的BM订单时遇到的错误:
The location provided for this order is invalid. (HTTP 200)
如果我使用UI,我可以在dal10中订购裸金属。为什么我不能通过api做到这一点?
我正在使用的硬件模板:
hardwareTpl = datatypes.Hardware{
Datacenter: &datatypes.Location{Name: sl.String("dal10")},
Domain: sl.String("xxx"),
Hostname: sl.String("xxx"),
HourlyBillingFlag: sl.Bool(false),
MemoryCapacity: sl.Uint(32),
OperatingSystemReferenceCode: sl.String("UBUNTU_16_64"),
PrimaryBackendNetworkComponent: &datatypes.Network_Component{Id: sl.Int(vlanPriId), MaxSpeed: sl.Int(10000)},
PrimaryNetworkComponent: &datatypes.Network_Component{Id: sl.Int(vlanPubId), MaxSpeed: sl.Int(10000)},
ProcessorCoreAmount: sl.Uint(4),
}
答案 0 :(得分:0)
这是正确的,UI使用其他软件包来订购Bare Metal服务器,我建议使用此请求:
https://api.softlayer.com/rest/v3/SoftLayer_Product_Package_Server/getAllObjects
这将返回UI显示的所有包