這個問題很奇怪,您可以嘗試將所有升級請求以單一順序批量化並查看會發生什麼情況。
placeOrder方法的容器有一個名爲「orderContainers」的屬性,您可以在其中設置升級訂單列表。
看看這個例子使用的SoftLayer Python客戶端,我加入以相同的順序升級resquests:
"""
Upgrade VSIs.
Important manual pages:
http://sldn.softlayer.com/reference/services/SoftLayer_Product_Order
http://sldn.softlayer.com/reference/services/SoftLayer_Product_Order/placeOrder/
http://sldn.softlayer.com/reference/services/SoftLayer_Product_Order/verifyOrder/
License: http://sldn.softlayer.com/article/License
Author: SoftLayer Technologies, Inc. <[email protected]>
"""
import SoftLayer
# For nice debug output:
from pprint import pprint as pp
# Your SoftLayer API username and key.
USERNAME = 'set me'
API_KEY = 'set me'
virtualGuestId = 26252013
virtualGuestId2 = 26252013
# Setting the configuration for a upgrade a VM
orderContainer = {}
orderContainer['packageId'] = 46
orderContainer['complexType'] = 'SoftLayer_Container_Product_Order_Virtual_Guest_Upgrade'
orderContainer['virtualGuests'] = [{'id': virtualGuestId}]
orderContainer['prices'] = [
# Upgraqdes prices
{ 'id': 1644 }
]
orderContainer['properties'] = [{'name': 'MAINTENANCE_WINDOW', 'value': 'now'}]
# Setting the configuration for a upgrade another VM
orderContainer2 = {}
orderContainer2['packageId'] = 46
orderContainer2['complexType'] = 'SoftLayer_Container_Product_Order_Virtual_Guest_Upgrade'
orderContainer2['virtualGuests'] = [{'id': virtualGuestId2}]
orderContainer2['prices'] = [
# Upgraqdes prices
{ 'id': 1644 }
]
orderContainer2['properties'] = [{'name': 'MAINTENANCE_WINDOW', 'value': 'now'}]
#adding the upgrade orders to the container
orderData = {
"orderContainers": [
orderContainer,
orderContainer2
],
'complexType': 'SoftLayer_Container_Product_Order'
}
print (orderData)
orderClient = SoftLayer.Client(
username=USERNAME,
api_key=API_KEY
)
try:
result = orderClient['Product_Order'].verifyOrder(orderData)
pp(result)
except SoftLayer.SoftLayerAPIError as e:
pp('Unable to upgrade the VSI faultCode=%s, faultString=%s'
% (e.faultCode, e.faultString))#!/usr/bin/env python
問候
這很有趣。現在我試圖玩這個想法,看看我可以在沒有API對象的情況下按給定順序接通多少升級請求。任何想法會有什麼樣的限制?我假設我無法一次完成50次升級。 – Gary
作爲一個額外的問題,「價格」屬性是有問題的。有一種方法可以枚舉給定DC中給定項目的這個值嗎?看起來這個數字會根據你所在的DC而改變,所以可能有很多選擇。 – Gary
我不知道,我從來沒有在一個訂單中訂購過這個金額,文件沒有說明限制,所以你應該可以一次訂購50個或更多的升級。 –