2017-04-11 72 views
0

當ordernig通過(Java)的API的子網上,它是將一個子網爲了像這樣需要:如何驗證訂購的子網是否已創建?

Receipt orderResult = com.softlayer.api.service.billing.Order.service(client).placeOrder(subnet, Boolean.FALSE); 

所得收據對象已經填充訂單ID,但沒有子網ID返回。

有沒有辦法找出使用Softlayer API創建哪個子網?

回答

0

SUBNETID可以發現:

slcli subnet list

然後就可以查詢到與子網相關的賬單項目:

curl -g "https://[username]:<api-key>@api.softlayer.com/rest/v3//SoftLayer_Network_Subnet/<subnet_id>/getBillingItem

這是goint返回一個Softlayer_Billing_Item物體填充orderItemID。

在查看創建子網時返回的Report對象時,可以找到orderItem ID。

如果orderID匹配,則確實創建了子網。

相關問題