Bandwidth summary per server

后端 未结 2 1951
一向
一向 2021-01-25 08:30

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 th

2条回答
  •  失恋的感觉
    2021-01-25 09:24

    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?

    hardware = Softlayer::Hardware::Server.find(123)
    hardware.get_current_bandwidth_summary
    
    mask = 'mask[currentBandwidthSummary]'
    hardware = Softlayer::Hardware::Server.mask(mask).find(123)
    hardware.current_bandwidth_summary
    

    You will access a ruby object like this one:

    => #
    

    Hope it can helps you, comment if you have any doubt about the client usage

提交回复
热议问题