require 'softlayer_api' # Requires softlayer_api >= 3.2
require 'pp' # used to display results
# Create a client
client = SoftLayer::Client.new
# add your server id, can be found with the following script: https://softlayer.github.io/ruby/list_instances/
virtual_server_id = 12345678
item = client[:Virtual_Guest].object_mask("mask[billingItem[createDate,hoursUsed,hourlyRecurringFee,currentHourlyCharge]]").object_with_id(virtual_server_id).getObject
puts "Billing Item for Virtual Server:"
pp item['billingItem']
Billing Item for Virtual Server:
{"createDate"=>"2016-01-29T12:23:43-06:00",
"currentHourlyCharge"=>".023",
"hourlyRecurringFee"=>".023",
"hoursUsed"=>"1"}
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