Search code examples
apiibm-cloud-infrastructure

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


I am getting this error below when trying to order SAN Disk for existing vm. This has been working fine for last few days and all of a sudden failing. with error:

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.

What does this even mean? Here is the order container>>

    {'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)

How did i get price 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']

Solution

  • The exception that you got:

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

    Means that the price that you provided is the same as what you already have on the server, you can verify the prices that already have on your server with the following request:

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

    Replace: $user, $apiKey and $vsiId with your own information

    Updated

    Check item prices categories

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

    Updated 2

    It is necessary to define categories inside of each price, take a look the example:

    {'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'}
    

    References: