SoftLayer_Exception_Public): 为升级订单提供了当前价格。请发送不同的价格以升级该项目

SoftLayer_Exception_Public): A current price was provided for the upgrade order. Please send a different price to upgrade the item

我在尝试为现有虚拟机订购 SAN 磁盘时收到以下错误。这几天一直运行良好,突然就失败了。 错误:

File "C:\Python27\lib\site-packages\softlayer-2.2.0-py2.7.egg\SoftLayer\API.py", line 446, in call_handler return self.call(self._service_name, name, *args, **kwargs) File "C:\Python27\lib\site-packages\softlayer-2.2.0-py2.7.egg\SoftLayer\API.py", line 344, in call verbose=self.verbose) File "C:\Python27\lib\site-packages\softlayer-2.2.0-py2.7.egg\SoftLayer\transport.py", line 65, in make_xml_rpc_api_call e.faultCode, e.faultString) SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(SoftLayer_Exception_Public): A current price was provided for the upgrade order. Please send a different price to upgrade the item.

这到底是什么意思? 这是订单容器>>

    {'prices': [{'id': 112927}], 'virtualGuests': [{'id': 15825861}], 'properties': [{'name': 'MAINTENANCE_WINDOW', 'value': '2016-05-17 16:41:45.029000'}], 'categories': [{'categoryCode': 'disk4'}], 'complexType': 'SoftLayer_Container_Product_Order_Virtual_Guest_Upgrade'}

    orderClient = SoftLayer.API.Client('SoftLayer_Product_Order', None, username=getUser(detailsFilePath), api_key=getKey(detailsFilePath))

    orderClient.placeOrder(orderContainer)

我如何获得价格 ID:

    packageClient = SoftLayer.API.Client('SoftLayer_Virtual_Guest', virtualGuestid, username=getUser(detailsFilePath), api_key=getKey(detailsFilePath))
    items = packageClient.getUpgradeItemPrices()
    for item in items:        
           if  item.get('item')['keyName'] == keyname:                
            return item['id']

你遇到的异常:

"A current price was provided for the upgrade order. Please send a different price to upgrade the item"

表示您提供的价格与您在服务器上已有的价格相同,您可以通过以下请求验证您服务器上已有的价格:

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/$vsiId/getBillingItem?objectMask=mask[orderItem[order[items]]]

Method: Get

用您自己的信息替换:$user、$apiKey 和$vsiId

Updated

查看商品价格类别

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/$vsiId/getUpgradeItemPrices?objectMask=mask[categories]

Method: Get

Updated 2

需要在每个价格里面定义类别,看例子:

{'prices': [{'id': 112927, 'categories': [{'categoryCode': "guest_disk4"}]}], 'virtualGuests': [{'id': 15825861}], 'properties': [{'name': 'MAINTENANCE_WINDOW', 'value': '2016-05-17 16:41:45.029000'}], 'complexType': 'SoftLayer_Container_Product_Order_Virtual_Guest_Upgrade'}

参考文献: