Skip to content

Ordering public static subnets results in The price ID# 29583 is not valid for ordering... #1343

@akkowal2

Description

@akkowal2

Actual Behavior

While trying to order a public static subnet, I continually get an exception like the following:

SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(SoftLayer_Exception_Public): The price ID# 29583 is not valid for ordering additional statically routed subnets. Please provide a valid price ID or contact Sales if you require assistance.

While trying to debug this I found the logic is matching on this item:

{'capacity': '8', 'description': '8 Static Public IP Addresses', 'hardwareGenericComponentId': '', 'id': 583, 'itemTaxCategoryId': 166, 'keyName': '8_STATIC_PUBLIC_IP_ADDRESSES', 'softwareDescriptionId': '', 'upgradeItemId': '', 'itemCategory': {'categoryCode': 'static_sec_ip_addresses', 'id': 53, 'name': 'Public Secondary Static IP Addresses', 'quantityLimit': 0, 'sortOrder': 35}, 'prices': [{'currentPriceFlag': '', 'id': 29583, 'itemId': 583, 'laborFee': '0', 'locationGroupId': '', 'onSaleFlag': '', 'oneTimeFee': '0', 'quantity': '', 'recurringFee': '8', 'setupFee': '0', 'sort': 0, 'termLength': '', 'tierMinimumThreshold': ''}, {'currentPriceFlag': '', 'id': 31207, 'itemId': 583, 'laborFee': '0', 'locationGroupId': '', 'onSaleFlag': '', 'oneTimeFee': '0', 'quantity': '', 'recurringFee': '8', 'setupFee': '0', 'sort': 0, 'termLength': '', 'tierMinimumThreshold': ''}, {'currentPriceFlag': '', 'hourlyRecurringFee': '.007', 'id': 23392, 'itemId': 583, 'laborFee': '0', 'locationGroupId': '', 'onSaleFlag': '', 'oneTimeFee': '0', 'quantity': '', 'setupFee': '0', 'sort': 0, 'termLength': '', 'tierMinimumThreshold': ''}]}

The thing that stood out to me is that there are multiple prices in the price list and the current network manager's add_subnet logic appears to only always use the first price id in the list here: https://github.com/softlayer/softlayer-python/blob/master/SoftLayer/managers/network.py#L174

If I compare this to the verifyOrder call in the cloud.ibm.com order portal I see that it is using price id 31207 which is the second price in the prices list.

If I patch the network manager add_subnet function to use prices[1] it seems like I can get a successful verifyOrder back.

Note, the above example is for 8 static ips but if I switch that to the other valid options, I get similar errors.

Expected Behavior

I expect to be able to order public static subnets with the SoftLayer python sdk.

Environment Information

Operating System: Mac
softlayer-python version (slcli --version):

pip show SoftLayer
Name: SoftLayer
Version: 5.8.8
Summary: A library for SoftLayer's API
Home-page: http://github.com/softlayer/softlayer-python
Author: SoftLayer Technologies, Inc.
Author-email: sldn@softlayer.com
License: MIT
Location: ***
Requires: ptable, urllib3, requests, pygments, prompt-toolkit, click
Required-by:

Metadata

Metadata

Assignees

Labels

BugOrderingAnything related to ordering

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions