-1

I note that prices differs from region to onother. It's possible to request each region's price using the API. For example :

curl https://user:token@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/getCreateObjectOptions
Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358
khakem
  • 1

2 Answers2

0

When you order an item (i.e. Order a Virtual Guest), first, you need to know the package to use. This Rest request can help you:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getActivePackages

Method: GET

Reference: SoftLayer_Account::getActivePackages

Then, you can use the following to get valid locations using the package id (for Virtual Guest the package id to use is 46):

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/46/getItemPrices?objectMask=mask[id,locationGroupId,item[id,keyName,description],pricingLocationGroup[locations[id, name, longName]]]&objectFilter={   "itemPrices": {     "item": {       "keyName": {         "operation": "*=EVAULT"       }     }   } }

Method: GET

Note: A price id with a locationGroupId = null is considered as "a standard price" and the API will internally switch the prices for the customer. But we recommend first to execute first the verifyOrder in order to see if the wanted order is ok (the fee can vary).

To get more information about prices and locations, please review:

http://sldn.softlayer.com/blog/cmporter/Location-based-Pricing-and-You

References:

SoftLayer_Product_Package::getItemPrices

mcruz
  • 1,534
  • 2
  • 11
  • 14
0

The SoftLayer_Virtual_Guest::getCreateObjectOptions returns the options to create an new virtual guest, the prices of those options are the standard prices , the advantage of the standard prices is that they work over any datacenter, but when the order is placed automatically they are changed to the price of the region that you picked out for your order.

If you wish to see the prices of your order you could try the SoftLayer_Virtual_Guest::generateOrderTemplate method, this method will create an order template and it will show you the prices of the items (as I said before they are standard prices). you can use the result of the generateOrderTemplate() and send it to the verifyOrder method and it will display the price of your order for the regions that you picked out.

For more information about prices see see (http://sldn.softlayer.com/blog/cmporter/Location-based-Pricing-and-You)