> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/cn/compute/zec/vnic/describenetworkinterfacemonitordata.md).

# DescribeNetworkInterfaceMonitorData

## 1. 接口描述

本接口(DescribeNetworkInterfaceMonitorData)用于查询一段时间内的网卡监控指标数据。包含带宽、包量、丢包、错误包等指标。

## 2. 请求参数

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

| 参数名称       | 必选 | 类型                                                                                    | 描述                                                                                                                          |
| ---------- | -- | ------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| nicId      | 是  | String                                                                                | 网卡唯一标识ID。                                                                                                                   |
| metricType | 是  | [NicApiMonitorMeta](/api-reference/cn/compute/zec/datastructure.md#nicapimonitormeta) | 网卡监控指标类型。                                                                                                                   |
| startTime  | 是  | String                                                                                | <p>查询开始时间。</p><p>时间格式：yyyy-MM-ddTHH<span data-gb-custom-inline data-tag="emoji" data-code="1f1f2-1f1f2">🇲🇲</span>ssZ。</p> |
| endTime    | 是  | String                                                                                | <p>查询结束时间。</p><p>时间格式：yyyy-MM-ddTHH<span data-gb-custom-inline data-tag="emoji" data-code="1f1f2-1f1f2">🇲🇲</span>ssZ。</p> |
| step       | 否  | Integer                                                                               | <p>查询数据点间隔。</p><p>单位为分钟。</p><p>支持参数：1,5。</p><p>默认值：5</p>                                                                    |

## 3. 响应结果

| 参数名称      | 类型                                                                                 | 描述                                                       |
| --------- | ---------------------------------------------------------------------------------- | -------------------------------------------------------- |
| requestId | String                                                                             | <p>唯一请求 ID。</p><p>每次请求都会返回。定位问题时需要提供该次请求的 requestId。</p> |
| maxValue  | Float                                                                              | 数据点的最大值。                                                 |
| minValue  | Float                                                                              | 数据点的最小值。                                                 |
| avgValue  | Float                                                                              | 数据点的平均值。                                                 |
| metrics   | Array of [MetricValue](/api-reference/cn/compute/zec/datastructure.md#metricvalue) | 监控数据集合。                                                  |

## 4. 代码示例

{% tabs %}
{% tab title="示例" %}
**1. 查询某段时间的网卡的 `RX_BITS` 监控指标数据。**

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

Request：
{
    "nicId": "<nicId>",
    "metricType": "RX_BITS",
    "startTime": "2025-06-25T01:55:00Z",
    "endTime": "2025-06-25T07:55:00Z"
}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
    "maxValue": 1024.0,
    "minValue": 512.0,
    "avgValue": 768.0,
    "metrics": [
      {
        "time": "2025-06-25T01:55:00Z",
        "value": 1024.0
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## 5. 开发者工具

Zenlayer Cloud API 2.0 提供了配套的[开发工具集（SDK）](/api-reference/cn/api-introduction/toolkit.md)，未来会陆续支持更多开发语言，方便快速接入和使用Zenlayer的产品和服务。

## 6. 错误码

下面包含业务逻辑中遇到的错误码，其他错误码见[公共错误码](/api-reference/cn/api-introduction/instruction/commonerrorcode.md)

| HTTP状态码 | 错误码                                         | 说明        |
| ------- | ------------------------------------------- | --------- |
| 400     | OPERATION\_DENIED\_TIME\_STEP\_NOT\_SUPPORT | 数据点间隔不支持。 |
