调用DescribeUserFlowStatistics接口查询指定智能接入网关App实例用户的流量使用信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeUserFlowStatistics | 系统规定参数。取值:DescribeUserFlowStatistics。 |
RegionId | String | 是 | cn-hangzhou | 智能接入网关App实例的地域ID。 |
SmartAGId | String | 是 | sag-mfkg***** | 智能接入网关App实例ID。 |
StatisticsDate | String | 否 | 201905 | 统计日期,格式为YYYYMM。 说明 如果不设置,默认表示当月。 |
UserNames.N | String | 否 | doctest | 用户名列表。列表最大长度为50。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
SagStatistics | Array of Statistics | 流量统计。 |
|
Statistics | |||
TotalBytes | String | 100 | 已使用的流量值。单位:Byte。 |
UserName | String | doctest | 用户名。 |
TotalLeaveBytes | String | 1000 | 智能接入网关App用户剩余免费流量值。单位:Byte。 |
RequestId | String | 9552AD68-18EA-4074-B27D-40040FBA9683 | 请求ID。 |
示例
请求示例
http(s)://[Endpoint]/?Action=DescribeUserFlowStatistics
&RegionId=cn-hangzhou
&SmartAGId=sag-mfkg*****
&StatisticsDate=201905
&UserNames=["doctest"]
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeUserFlowStatisticsResponse>
<SagStatistics>
<TotalBytes>100</TotalBytes>
<UserName>doctest</UserName>
<TotalLeaveBytes>1000</TotalLeaveBytes>
</SagStatistics>
<RequestId>9552AD68-18EA-4074-B27D-40040FBA9683</RequestId>
</DescribeUserFlowStatisticsResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"SagStatistics" : [ {
"TotalBytes" : "100",
"UserName" : "doctest",
"TotalLeaveBytes" : "1000"
} ],
"RequestId" : "9552AD68-18EA-4074-B27D-40040FBA9683"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | SAG.InstanceIdEmpty | You must specify the SAG instance ID. | 智能接入网关实例ID为空。 |
400 | SAG.InstanceNoFound | The specified SAG instance does not exist. | 智能接入网关实例不存在。 |
访问错误中心查看更多错误码。