使用量

获取当前账单月内使用量

接口描述

相对URI HTTP 方式
/v1/usage GET

输出

200: 成功

名称 类型 默认值 含义
publishReceived Number 物接入收到的PUBLISH消息
publishSent Number 物接入向外发送的PUBLISH消息

请求示例

GET /v1/usage HTTP/1.1
host: iot.gz.baidubce.com
authorization: {authorization}
content-type: text/json;charset=UTF-8

返回示例

HTTP/1.1 200 Ok
x-bce-request-id: 367d9dd5-4513-412d-a4f8-eacfe37dbaf3
Content-Type: application/json;charset=UTF-8
{"publishReceived":0,"publishSent":0}

获取当前账单月内特定实例的使用量

接口描述

相对URI HTTP 方式
/v1/endpoint/:endpointName/usage GET

输出

200: 成功

名称 类型 默认值 含义
publishReceived Number 物接入收到的PUBLISH消息
publishSent Number 物接入向外发送的PUBLISH消息

请求示例

GET /v1/endpoint/endpoint-1/usage HTTP/1.1
host: iot.gz.baidubce.com
authorization: {authorization}
content-type: text/json;charset=UTF-8

返回示例

HTTP/1.1 200 Ok
x-bce-request-id: 367d9dd5-4513-412d-a4f8-eacfe37dbaf3
Content-Type: application/json;charset=UTF-8
{"publishReceived":0,"publishSent":0}

查询特定实例某个时间段内的使用量

接口描述

相对URI HTTP 方式
/v1/endpoint/:endpointName/usage-query?start=:startDate&end=:endDate POST

输入

名称 类型 默认值 含义
start String 开始日期(包含)
end String 结束日期(不包含)

输出

200: 成功

名称 类型 默认值 含义
publishReceived Number 物接入收到的PUBLISH消息
publishSent Number 物接入向外发送的PUBLISH消息

请求示例

POST /v1/endpoint/endpoint-1/usage-query?start=2017-07-10&end=2017-0810 HTTP/1.1
host: iot.gz.baidubce.com
authorization: {authorization}
content-type: text/json;charset=UTF-8

返回示例

HTTP/1.1 200 Ok
x-bce-request-id: 367d9dd5-4513-412d-a4f8-eacfe37dbaf3
Content-Type: application/json;charset=UTF-8
{"value":[{"date":"2017-07-10","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-11","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-12","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-13","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-14","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-15","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-16","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-17","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-18","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-19","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-20","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-21","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-22","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-23","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-24","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-25","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-26","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-27","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-28","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-29","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-30","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-07-31","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-08-01","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-08-02","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-08-03","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-08-04","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-08-05","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-08-06","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-08-07","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-08-08","usage":{"publishReceived":0,"publishSent":0}},{"date":"2017-08-09","usage":{"publishReceived":0,"publishSent":0}}]}