正如@Xiang Wang 所说,应该可以使用slcli order 命令订购。
python和go中也有一些例子可以试试:
https://softlayer.github.io/python/orderVyatta/
https://softlayer.github.io/python/order_vyatta.py/
https://softlayer.github.io/go/order_vyatta_gateway.go/
休息
以下是可用于构建订单的 JSON 结构示例,考虑到价格可能会根据包裹和位置而变化,其中一些可能会发生冲突。
要检索价格列表,您可以使用getItems 或getItemPrices
当您准备订购时,使用 placeOrder 而不是 verifyOrder。
POST:
https://api.softlayer.com/rest/v3/SoftLayer_Product_Order/verifyOrder
PAYLOAD:
{
"parameters": [{
"orderContainers": [{
"complexType": "SoftLayer_Container_Product_Order_Hardware_Server_Gateway_Appliance",
"hardware": [
{
"hostname": "gateway",
"domain": "softlayer.com"
}
],
"quantity": 1,
"location": "AMSTERDAM",
"packageId": 1055,
"prices": [
{
"id": 206251,
"item": { "description": "Single Intel Xeon E3-1270 v6 (4 Cores, 3.80 GHz)" }
},
{
"id": 209453,
"item": { "description": "16 GB RAM" }
},
{
"id": 201199,
"item": { "description": "Virtual Router Appliance 5.x (up to 2 Gbps) Subscription Edition (64 Bit)" }
},
{
"id": 32927,
"item": { "description": "Non-RAID" }
},
{
"id": 83483,
"item": { "description": "2.00 TB SATA" }
},
{
"id": 33867,
"item": { "description": "20000 GB Bandwidth Allotment" }
},
{
"id": 96817,
"item": { "description": "1 Gbps Public & Private Network Uplinks" }
},
{
"id": 80263,
"item": { "description": "Host Ping and TCP Service Monitoring" }
},
{
"id": 32627,
"item": { "description": "Automated Notification" }
},
{
"id": 35310,
"item": { "description": "Nessus Vulnerability Assessment & Reporting" }
},
{
"id": 32500,
"item": { "description": "Email and Ticket" }
},
{
"id": 25014,
"item": { "description": "Reboot / KVM over IP" }
},
{
"id": 212715,
"item": { "description": "SRIOV Enabled" }
},
{
"id": 34807,
"item": { "description": "1 IP Address" }
},
{
"id": 33483,
"item": { "description": "Unlimited SSL VPN Users & 1 PPTP VPN User per account" }
}
]
}]
}]
}
如果您想要一个高可用性设备 (HA),那么您需要在 hardware 参数中指定两个硬件对象,并且数量必须为 2。