DescribePortTraffic

DescribePortTraffic

1. API Description

This API is used to query port bandwidth information in the specified date range.

2. Input Parameters

The following request parameter list only provides API request parameters.

3. Output Parameters

4. Code Example

Query the bandwidth information of the instance in one day.

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. Developer Resources

Zenlayer Cloud API 2.0 integrates SDKs to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

No error codes related to the API business logic. For other error codes, see Common Error Codes.​

Last updated