DescribePortTraffic

DescribePortTraffic

1. 接口描述

本接口用于查询端口流量。

2. 请求参数

以下请求参数列表仅列出了接口中需要的请求参数

3. 响应结果

4. 代码示例

  1. 查询端口一天的带宽数据

POST /api/v2/sdn HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribePortTraffic
<Common Request Params>

Request: {
    "portId": "port-port-id"
    "startTime": "YYYY-MM-DDThh:mm:ssZ"
    "endTime": "YYYY-MM-DDThh:mm:ssZ"
}

Response: 
{
  "requestId": "T4C35327C-7B13-47B8-A815-5E5213D4A9F9",
  "response": {
    "requestId": "T4C35327C-7B13-47B8-A815-5E5213D4A9F9",
    "dataList": [
      {
        "in": 873034,
        "out": 11971,
        "time": "2023-01-01T00:00:00Z"
      },
      {
        "in": 873034,
        "out": 11971,
        "time": "2023-01-01T00:05:00Z"
      },
      {
        "in": 635218,
        "out": 9028,
        "time": "2023-01-01T00:10:00Z"
      }
    ],
    "in95": 873034,
    "inAvg": 793762,
    "inMax": 873034,
    "inMin": 635218,
    "out95": 11971,
    "outAvg": 10990,
    "outMax": 11971,
    "outMin": 9028,
    "unit": "bps"
  }
}

5. 开发者工具

Zenlayer Cloud API 2.0 提供了配套的开发工具集(SDK),未来会陆续支持更多开发语言,方便快速接入和使用Zenlayer的产品和服务。

6. 错误码

下面包含业务逻辑中遇到的错误码,其他错误码见公共错误码

最后更新于