September 1, 2016

Find Location specific pricing for a package

Use an object filter to return the Location Based pricing information for a SoftLayer package.

With the introduction to Location-based Pricing, we updated our pricing model to represent the costs in each data center more clearly. Instead of adding premiums to a base server price, we have priced servers and services in each data center with their own location-based SoftLayer_Product_Item_Price objects via the API. In the following example we will query for the Dallas 10 data center for SoftLayer Virtual Guests.

require 'softlayer_api'
require 'pp'

client = => 120)

object_filter =
	'operation' => 'in',
        'options' => [{
        'name' => 'data',
        'value' => 1441195

location = client['SoftLayer_Product_Package']
result = location.object_with_id(46).object_filter(object_filter).getItems

pp result


If this article contains any error, or leaves any of your questions unanswered, please help us out by opening up a github issue.
Open an issue