# DescribeCloudRouterEdgePointTraffic

## 1. API Description

This API is used to query cloud router access point bandwidth information in the specified date range.

{% hint style="info" %} <mark style="color:blue;">**Note**</mark>

* <mark style="color:blue;">Access bandwidth of ports, Tencent Cloud, Google Cloud, AWS, Virtual Edge and VPC are supported to query.</mark>
* <mark style="color:blue;">Only the date range of 24 hours are supported.</mark>
* <mark style="color:blue;">Only the bandwidth information within 30 days are supported to query.</mark>
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

<table><thead><tr><th width="193">Parameter Name</th><th width="107">Required</th><th width="131.85945945945946">Type</th><th>Description</th></tr></thead><tbody><tr><td>edgePointId</td><td>Yes</td><td>String</td><td>Access point ID.</td></tr><tr><td>startTime</td><td>Yes</td><td><a href="../../../api-introduction/instruction/datatype">Timestamp</a></td><td><p>Start time.</p><p>Use UTC time according to the <code>ISO8601</code> standard. Format: <code>YYYY-MM-DDThh:mm:ssZ</code>.</p></td></tr><tr><td>endTime</td><td>No</td><td><a href="../../../api-introduction/instruction/datatype">Timestamp</a></td><td><p>End time.</p><p>Use UTC time according to the <code>ISO8601</code> standard. Format: <code>YYYY-MM-DDThh:mm:ssZ</code>.<br>End time is current time by default.</p></td></tr></tbody></table>

## 3. Output Parameters

<table><thead><tr><th width="195">Parameter Name</th><th width="186.97126156843643">Type</th><th>Description</th></tr></thead><tbody><tr><td>requestId</td><td>String</td><td>The unique request ID, which is returned for each request. RequestId is required for locating a problem.</td></tr><tr><td>dataList</td><td>Array of <a href="../../datastructure#trafficdata">TrafficData</a></td><td>List of bandwidth data.</td></tr><tr><td>in95</td><td>Float</td><td>Inbound burstable 95th bandwidth.</td></tr><tr><td>inAvg</td><td>Integer</td><td>Average value of inbound bandwidth.</td></tr><tr><td>inMax</td><td>Integer</td><td>Maximum value of inbound bandwidth.</td></tr><tr><td>inMin</td><td>Integer</td><td>Minimum value of inbound bandwidth.</td></tr><tr><td>inTotal</td><td>Integer</td><td>Total data transfer of inbound bandwidth.</td></tr><tr><td>out95</td><td>Integer</td><td>Outbound burstable 95th bandwidth.</td></tr><tr><td>outAvg</td><td>Integer</td><td>Average value of outbound bandwidth.</td></tr><tr><td>outMax</td><td>Integer</td><td>Maximum value of outbound bandwidth.</td></tr><tr><td>outMin</td><td>Integer</td><td>Minimum value of outbound bandwidth.</td></tr><tr><td>unit</td><td>String</td><td>Unit of bandwidth. For example, <code>bps</code>.</td></tr></tbody></table>

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query the bandwidth information of the access point in a cloud router in one day.**

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

Request:
{
  "edgePointId": "your-cloudrouter-edge-point-id",
  "startTime": "2023-01-01T00:00:00Z",
  "endTime": "2023-01-01T23:59:59Z"
}

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"
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](https://docs.console.zenlayer.com/test/ci-develop-en/api-introduction/software-toolkit/sdk) to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](https://docs.console.zenlayer.com/test/ci-develop-en/api-introduction/instruction/commonerrorcode).​

<table><thead><tr><th width="197.9764821166095">HTTP Status Code</th><th width="246">Error Code</th><th>Description</th></tr></thead><tbody><tr><td>404</td><td>INVALID_CLOUD_ROUTER_POINT_NOT_FOUND</td><td>Access point does not exist.</td></tr><tr><td>403</td><td>INVALID_START_TIME_MUST_BEFORE_END_TIME</td><td>The start time should be earlier than the end time.</td></tr><tr><td>403</td><td>INVALID_TIME_RANGE</td><td>Invalid date range. The date range should be within 24 hours.</td></tr><tr><td>403</td><td>TIME_OUT_OF_RANGE</td><td>Only the bandwidth information within 30 days are supported to query.</td></tr><tr><td>403</td><td>INVALID_TIME_FORMAT</td><td>Invalid time format.</td></tr></tbody></table>
