这个问题很奇怪,您可以尝试将所有升级请求以单一顺序批量化并查看会发生什么情况。
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个或更多的升级。 –