SoftLayer REST API按日期获取带宽数据 [英] SoftLayer REST API get Bandwidth Data By Date

查看:122
本文介绍了SoftLayer REST API按日期获取带宽数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对使用SoftLayer REST APIgetBandwidthDataByDate请求的使用有疑问.

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

在文档中,它列出了此请求的3个参数,但这是一个GET请求.有人知道如何发出此请求和/或有示例吗?

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

我不确定要在此处添加参数.(startDateTime,endDateTime,networkType)

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

dateTime对象是什么样的?

And what does the dateTime object look like?

谢谢

推荐答案

这是一个POST请求,因此您需要在有效负载"中传递参数(我正在使用适用于Chrome的Advanced REST客户端).

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

尝试以下REST请求:

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"
   ]
}

注意:用您自己的信息替换$ user,$ apiKey和$ device_id

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

参考:

SoftLayer_Virtual_Guest :: getBandwidthDataByDate

这篇关于SoftLayer REST API按日期获取带宽数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆