这是我放置裸机服务器的代码。placeOrder 函数将返回订单收据。然后我从 SL 门户查看订单状态,它已更改为已批准。
我的问题是我们是否有任何 API 来检查何时供应裸机服务器?我们需要在提供裸机服务器后对其进行配置。
var sess = session.New(userName, apiKey, endpoint)
accountService := services.GetAccountService(sess)
order := datatypes.Container_Product_Order{
Quantity: sl.Int(1),
Hardware: []datatypes.Hardware{
{
Hostname: sl.String("test10g"),
Domain: sl.String("example.com"),
PrimaryBackendNetworkComponent: &datatypes.Network_Component{
NetworkVlan: &datatypes.Network_Vlan{Id: sl.Int(2288425)},
},
},
},
Location: sl.String("DALLAS10"),
PackageId: sl.Int(911), // Single E3-1270 v6
Prices: []datatypes.Product_Item_Price{
{Id : sl.Int(206249)}, // server
{Id : sl.Int(209427)}, // ram
{Id : sl.Int(175789)}, // os
{Id : sl.Int(32927)}, // disk controller
{Id : sl.Int(49761)}, // disk 0
{Id : sl.Int(50359)}, // bandwidth
{Id : sl.Int(35686)}, // portSpeed
{Id : sl.Int(34241)}, // monitoring
{Id : sl.Int(34996)}, // response
{Id : sl.Int(33483)}, // vpn management
{Id : sl.Int(35310)}, // vulnerabilityScanner
{Id : sl.Int(34807)}, // pri_ip_address
{Id : sl.Int(32500)}, // notification
{Id : sl.Int(25014)}, // remote_management
},
}
service := services.GetProductOrderService(sess)
receipt, err := service.PlaceOrder(&order, sl.Bool(false))
// Any functions to check the order status here?
// Need some code to waiting for the baremetal server to become ready.