> 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/ipt/ip-transit/describeiptransits.md).

# DescribeIPTransits

## 1. 接口描述

本接口(DescribeIPTransits)用于查询IP Transit列表。

{% hint style="info" %}
**BGP 档位**

* `routingType=BGP` 的实例，`bgp.tier` 返回 BGP 档位（`STANDARD` 普通 / `PREMIUM` 优质）；档位拆分前创建的存量实例统一返回 `PREMIUM`。
  {% endhint %}

## 2. 请求参数

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

| 参数名称            | 必选 | 类型                                                         | 描述                                                 |
| --------------- | -- | ---------------------------------------------------------- | -------------------------------------------------- |
| iptIds          | 否  | Array of String                                            | <p>IP Transit ID 列表。</p><p>最多支持 100 个 ID 查询。</p>   |
| iptName         | 否  | String                                                     | <p>IP Transit名称。</p><p>模糊匹配。</p>                   |
| resourceGroupId | 否  | String                                                     | <p>资源组 ID。</p><p>不传则返回该用户可见的所有资源组内的IP Transit。</p> |
| peerPortId      | 否  | String                                                     | 对端数据中心端口 ID 过滤。                                    |
| iptDcId         | 否  | String                                                     | 本端数据中心 ID 过滤。                                      |
| pageSize        | 否  | Integer                                                    | <p>返回的分页大小。</p><p>默认为 20，最大为 1000。</p>             |
| pageNum         | 否  | Integer                                                    | <p>返回的分页数。</p><p>默认为 1。</p><p>默认值：1</p>            |
| tagKeys         | 否  | Array of String                                            | <p>根据标签键进行搜索。</p><p>最长不得超过20个标签键。</p>              |
| tags            | 否  | Array of [Tag](/api-reference/cn/ipt/datastructure.md#tag) | <p>根据标签进行搜索。</p><p>最长不得超过20个标签。</p>                |

## 3. 响应结果

| 参数名称       | 类型                                                                     | 描述                                                       |
| ---------- | ---------------------------------------------------------------------- | -------------------------------------------------------- |
| requestId  | String                                                                 | <p>唯一请求 ID。</p><p>每次请求都会返回。定位问题时需要提供该次请求的 requestId。</p> |
| totalCount | Integer                                                                | 符合条件的数据总数。                                               |
| dataSet    | Array of [IPTransit](/api-reference/cn/ipt/datastructure.md#iptransit) | IP Transit结果集。                                           |

## 4. 代码示例

{% tabs %}
{% tab title="示例" %}
**1. 查询单链路 IP Transit 列表。**

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

Request:
{
    "iptIds": ["your-ipt-id"]
}

Response:
{
    "requestId": "TEC2801F6-9FB4-4DE2-8BCD-1C59655495C5",
    "response": {
        "requestId": "TEC2801F6-9FB4-4DE2-8BCD-1C59655495C5",
        "totalCount": 1,
        "dataSet": [
            {
                "iptId": "your-ipt-id",
                "iptName": "MIA1-10G",
                "iptDescription": "test_ipt_desc",
                "dataCenter": {
                    "dcId": "822b9bd9-44f0-4279-a64d-568f5bc4a77b",
                    "dcName": "Equinix AM3",
                    "cityName": "Amsterdam",
                    "countryName": "Netherlands",
                    "areaName": "Europe"
                },
                "peerPortId": "your-port-id",
                "peerPortName": "MIA1-10G",
                "peerDataCenter": {
                    "dcId": "40eb37d8-0f65-4108-bd2c-a2577498f6eb",
                    "dcName": "Coresite LA2",
                    "cityName": "Los Angeles",
                    "countryName": "United States",
                    "areaName": "North America"
                },
                "deliveryType": "Manual",
                "resourceGroupId": "your-resource-group-id",
                "resourceGroupName": "Default Resource Group",
                "createTime": "2024-01-01T00:00:00Z",
                "routingType": "Static",
                "internetType": "ByBandwidth",
                "bandwidth": 50,
                "commitBandwidth": 50,
                "bfd": { "bfdRxInterval": 100, "bfdTxInterval": 100, "bfdMultiplier": 10 },
                "bgp": null,
                "interconnect": { "vendorIpv4Address": null, "customerIpv4Address": null, "vendorIpv6Address": null, "customerIpv6Address": null },
                "privateConnectId": "your-vll-id",
                "privateConnectName": "PrivateConnect-Los Angeles-Amsterdam",
                "publicIpv4Addresses": [
                    {
                        "ipAddress": "192.0.2.0/25",
                        "netmask": 25,
                        "gatewayIpAddress": "192.0.2.1"
                    }
                ],
                "iptStatus": "RUNNING",
                "connectivityStatus": "ACTIVE",
                "publicIpAddresses": [
                    {
                        "ipUuid": "your-ip-uuid",
                        "ipAddress": "192.0.2.0/25",
                        "netmask": 25,
                        "gatewayIpAddress": "192.0.2.1",
                        "ipType": "IPV4",
                        "ipNetworkType": "BGP_IP"
                    }
                ],
                "haMode": null,
                "zbgRegionId": null,
                "haLinks": null,
                "peerPortType": "PORT"
            }
        ]
    }
}
```

**2. 查询高可用（ACTIVE\_STANDBY）IP Transit，响应包含两条子链路详情。**

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

Request:
{
    "iptIds": ["your-ha-ipt-id"]
}

Response:
{
    "requestId": "TEC2801F6-9FB4-4DE2-8BCD-1C59655495C6",
    "response": {
        "requestId": "TEC2801F6-9FB4-4DE2-8BCD-1C59655495C6",
        "totalCount": 1,
        "dataSet": [
            {
                "iptId": "your-ha-ipt-id",
                "iptName": "HA-IPT-AMS1",
                "dataCenter": {
                    "dcId": "822b9bd9-44f0-4279-a64d-568f5bc4a77b",
                    "dcName": "Equinix AM3",
                    "cityName": "Amsterdam",
                    "countryName": "Netherlands",
                    "areaName": "Europe"
                },
                "routingType": "BGP",
                "internetType": "ByBandwidth",
                "bandwidth": 100,
                "iptStatus": "RUNNING",
                "connectivityStatus": "ACTIVE",
                "publicIpAddresses": [
                    {
                        "ipUuid": "your-ip-uuid",
                        "ipAddress": "192.0.2.0/28",
                        "netmask": 28,
                        "ipType": "IPV4",
                        "ipNetworkType": "BGP_IP"
                    }
                ],
                "haMode": "ACTIVE_STANDBY",
                "haLinks": [
                    {
                        "isPrimary": true,
                        "iptStatus": "RUNNING",
                        "connectivityStatus": "ACTIVE",
                        "privateConnectId": "vll-child-a-uuid",
                        "privateConnectName": "HA-VLL-A",
                        "peerPortId": "port-a-uuid",
                        "peerPortName": "AMS1-10G-1",
                        "peerDataCenter": {
                            "dcId": "40eb37d8-0f65-4108-bd2c-a2577498f6eb",
                            "dcName": "Coresite LA2",
                            "cityName": "Los Angeles",
                            "countryName": "United States",
                            "areaName": "North America"
                        },
                        "peerPortVlan": 100,
                        "interconnect": {
                            "vendorIpv4Address": "10.0.0.1/30",
                            "customerIpv4Address": "10.0.0.2/30"
                        }
                    },
                    {
                        "isPrimary": false,
                        "iptStatus": "RUNNING",
                        "connectivityStatus": "ACTIVE",
                        "privateConnectId": "vll-child-b-uuid",
                        "privateConnectName": "HA-VLL-B",
                        "peerPortId": "port-b-uuid",
                        "peerPortName": "AMS1-10G-2",
                        "peerDataCenter": {
                            "dcId": "40eb37d8-0f65-4108-bd2c-a2577498f6eb",
                            "dcName": "Coresite LA2",
                            "cityName": "Los Angeles",
                            "countryName": "United States",
                            "areaName": "North America"
                        },
                        "peerPortVlan": 200,
                        "interconnect": {
                            "vendorIpv4Address": "10.0.1.1/30",
                            "customerIpv4Address": "10.0.1.2/30"
                        }
                    }
                ],
                "peerPortType": "PORT"
            }
        ]
    }
}
```

{% 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状态码 | 错误码 | 说明 |
| ------- | --- | -- |
