softlayer / softlayer-ruby

http://softlayer.github.io/softlayer-ruby/
MIT License
54 stars 35 forks source link

Baremetal order may fail for some datacenters #126

Closed ArtsiomMusin closed 7 years ago

ArtsiomMusin commented 7 years ago

The baremetal order may fail with some product packages for certain datacenters. You may see this error: The location provided for this order is invalid.

Here is an example. The product package id is 126. The datacenter is Amsterdam1. For this combination, the order will fail.

It turns out this is a bug in API as it gives the wrong info about available locations. ProductPackage.available_locations method lists all datacenters including Amsterdam1. However, if you look at:

client['Product_Package'].object_mask('mask[regions]').object_with_id(126).getObject

it won't show any datacenter at all.

I figured out from the docs that availableLocations is deprecated. The right way is to use regions. See here: http://sldn.softlayer.com/reference/datatypes/SoftLayer_Product_Package

So availableLocations should be changed to regions.