-1

Similar to another posted question at softlayer - getting bandwidth usage per datacenter , my question(s):

How can I use the API get a value (not graph) that represents the amount of bandwidth used by our entire account (1), and by specific data centers (2).

Which API calls are the correct entries to accomplish these goals? We are prototyping in PHP, but Python is also welcome.

Community
  • 1
  • 1
Patrick
  • 1
  • 2
  • Welcome to SO! Can you please add the relevant parts from the other question? IMHO it's better to describe your problem and mention you've looked at others rather than referring one. It also improves readability. – Laur Ivan Apr 20 '16 at 21:27
  • All of the relevant parts of the other question are contained in the question here. I included the link/reference only to clarify that the other question was different and didn't include an answer with the specific focus (datacenter and account aggregate), or with the API calls needed to accomplish either of those. – Patrick Apr 20 '16 at 21:40

1 Answers1

0

Unfortunately, It's not possible making a single call, but this can be a workaround:

Retrieve Vitual Guests and Hardware objects from account

Then, we should get the bandwidth data, from each one with the following request:

If you want for a specific datacenter, it is necessary to filter the hardware objects and virtual guests per datacenter.

Here a Rest request, to filter for Dal05 datacenter. The same idea should be applied for hardware objects.

https://$user:$apiKey@api.softlayer.com/rest/v3.1/SoftLayer_Account/getVirtualGuests?objectMask=mask[datacenter]&objectFilter={"virtualGuests":{"datacenter":{"name":{"operation":"dal05"}}}}

Method: Get