I am trying to get the bandwidth data for all the softlayer servers under my account.
Thanks to account_servers.rb
I am able to get the server id for all the servers. Now I would like to get the Bandwidth used by the servers for a particular time frame. The data that I am interested is
http://sldn.softlayer.com/reference/datatypes/SoftLayer_Metric_Tracking_Object_Bandwidth_Summary .
I tried to get information using softlayer_client.service_named("Metric_Tracking_Object_Bandwidth_Summary")
. Unfortunately I am not able to get the details.
I did find a java code, but I am interested in ruby code. Can someone please guide me to get the server bandwith summary?
Disclamer: I created my own Ruby SoftLayer client, you can check it at http://github.com/zertico/softlayer specially for situations like this one where you want to access some specific data (and I'm not SoftLayer staff ;) )
If you'd like to give it a try the code that solves your problem is
ps: I'm considering you are manipulating a SoftLayer_Hardware_Server, right?
You will access a ruby object like this one:
Hope it can helps you, comment if you have any doubt about the client usage
Please, try the following
Ruby
examples:References:
SoftLayer_Metric_Tracking_Object::getSummaryData
SoftLayer_Virtual_Guest::getMetricTrackingObjectId
Second example using
SoftLayer_Virtual_Gues::getBandwidthDataByDate
:References:
SoftLayer_Virtual_Guest::getBandwidthDataByDate