SoftLayer REST API get Bandwidth Data By Date

2019-06-12 11:29发布

问题:

I have a question regarding the use of the getBandwidthDataByDate request using the SoftLayer REST API.

In the documentation it lists 3 parameters for this request, but it's a GET request. Does anyone know how to make this request and/or have an example?

https://api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/getBandwidthDataByDate/'device_id'.json

I'm not sure where to add the parameters here.(startDateTime, endDateTime, networkType)

And what does the dateTime object look like?

Thanks

回答1:

This is a POST request, so you need to pass the parameters in "Payload" (I'm using Advanced REST client for Chrome).

Try the following REST request:

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/$device_id/getBandwidthDataByDate

Method: Post (Copy the below code in "Payload")

{  
   "parameters":[  
      "2016-03-10T00:00:00",
      "2016-03-15T00:00:00",
      "public"
   ]
}

Note: Replace $user, $apiKey and $device_id with your own information

References:

SoftLayer_Virtual_Guest::getBandwidthDataByDate