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

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

问题描述

我有一个关于使用 SoftLayer REST API 使用 getBandwidthDataByDate 请求的问题.

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 请求,因此您需要在Payload"中传递参数(我使用的是 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

方法:Post(在Payload"中复制以下代码)

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天全站免登陆