Context:
On softlayer configure page for a virtual guest ( https://www.softlayer.com/Store/orderComputingInstance/1640,1644,2202 ), the JavaScript do a lot of show / hide on price items based on some restrictions like:
- MySQL for Linux is hidden when you choose Windows as Operating System (price to price restriction)
- Private Node are unavailable on Dallas (location to price restriction)
My Problem:
Building a web interface to configure a virtual guest, I need to build a hash exactly like priceConflicts
that is shown on configure page.
calling SoftLayer_Product_Package.getItemLocationConflicts
I can get the location to price restrictions, but when I call SoftLayer_Product_Package.getItemConflicts
is returned an array of SoftLayer_Product_Item_Resource_Conflict_Item
with 4 attributes itemId
, packageId
, resourceTableId
and message
, that is exactly what is describe for http://sldn.softlayer.com/reference/datatypes/SoftLayer_Product_Item_Resource_Conflict_Item
Some things that are weird:
- According to documentation: http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getItemConflicts return values was supposed to be an array of SoftLayer_Product_Item_Resource_Conflict, not an array of SoftLayer_Product_Item_Resource_Conflict_Item
- According to documenation: http://sldn.softlayer.com/reference/datatypes/SoftLayer_Product_Item_Resource_Conflict_Item there's a resource relational property, but when I call with a mask
mask[resource]
the following error is returned: Property 'resource' not valid for 'SoftLayer_Product_Item_Resource_Conflict'.
So, how do I get the information needed to create a struct like priceConflicts
hash?
Thank you
For both cases it returns an array of SoftLayer_Product_Item_Resource_Conflict
You need to assume
For SoftLayer_Product_Package::getItemLocationConflicts method, the "itemId" has a "location conflict" with the location which has the same identifier as "resourceTableId".
You can retrieve location identifiers with the following method: SoftLayer_Location_Datacenter::getDatacenters. So you will need to match the identifier, to get the location
I can provide a Python script which will help you to get all of this information