# DescribeCloudRouters

## 1. API Description

This API is used to query information of one or more Layer 3 cloud routers. You can filter the query results with cloud router ID, name, and etc.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

<table><thead><tr><th width="204">Parameter Name</th><th width="115">Required</th><th width="119">Type</th><th>Description</th></tr></thead><tbody><tr><td>cloudRouterIds</td><td>No</td><td>Array of String</td><td>Cloud router ID(s).<br>You can query up to 100 IDs in each request.</td></tr><tr><td>cloudRouterName</td><td>No</td><td>String</td><td>Cloud router name.<br>Fuzzy search is supported.</td></tr><tr><td>cloudRouterStatus</td><td>No</td><td>String</td><td>Cloud router state.<br>See <a href="../../datastructure#cloudrouterstatus">CloudRouterStatus</a> for valid value.</td></tr><tr><td>egdePointId</td><td>No</td><td>String</td><td>Access point ID in cloud router.</td></tr><tr><td>resourceGroupId</td><td>No</td><td>String</td><td><p>Resource group ID.</p><p>If the value is null, then return all the cloud routers in the authorized resource groups.</p></td></tr><tr><td>tagKeys</td><td>No</td><td>Array of String</td><td><p>Query using tag keys.</p><p>A maximum of 20 tag keys can be used.</p></td></tr><tr><td>tags</td><td>No</td><td>Array of <a href="../../datastructure#tag">Tag</a></td><td><p>Query using tags.</p><p>A maximum of 20 tags can be used.</p></td></tr><tr><td>pageNum</td><td>No</td><td>Integer</td><td><p>Number of pages returned.</p><p>Default value: 1.</p></td></tr><tr><td>pageSize</td><td>No</td><td>Integer</td><td><p>Number of items in the current page result.</p><p>Default value: 20;</p><p>Maximum value: 1000.</p></td></tr></tbody></table>

## 3. Output Parameters

<table><thead><tr><th width="197.33333333333331">Parameter Name</th><th width="202">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>dataSet</td><td>Array of <a href="../../datastructure#cloudrouter">CloudRouter</a></td><td>Information on cloud routers.</td></tr><tr><td>totalCount</td><td>Integer</td><td>Number of cloud routers meeting the filtering conditions.</td></tr></tbody></table>

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query information of Layer 3 cloud routers.**

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

Request：
{}

Response：
{   
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
     "requestId": "T98044459-95B2-477E-9A2F-00253A70CC6E"，
     "dataSet": [
        {
            "resourceGroupName":"Default Resource Group",
            "cloudRouterStatus":"RUNNING",
            "edgePoints":[
                {
                    "dataCenter":{
                        "dcId":"LAX5",
                        "cityName":"Los Angeles",
                        "areaName":"North America",
                        "dcName":"DRT",
                        "dcAddress":"600 West 7th Street Los Angeles, CA 90017",
                        "countryName":"United States"
                    },
                    "ipAddress":"4.4.4.4/24",
                    "portId":"your-portId",
                    "edgePointId":"the edge point id",
                    "bgpConnection":{
                        "password":"",
                        "peerIpAddress":"4.4.4.3",
                        "localAsn":62610,
                        "peerAsn":6543
                    },
                    "createTime":"2023-10-27T07:14:46Z",
                    "edgePointName":"LAX5-1698390478681",
                    "connectivityStatus":"DOWN",
                    "bandwidthMbps":1
                },
                {
                    "dataCenter":{
                        "dcId":"SOF1",
                        "cityName":"Sofia",
                        "areaName":"Europe",
                        "dcName":"Equinix_SO2",
                        "dcAddress":"N33 Nedelcho Bonchev str, Sofia, Bulgaria",
                        "countryName":"Bulgaria"
                    },
                    "vlanId":1061,
                    "ipAddress":"5.5.5.5/24",
                    "portId":"your port id",
                    "edgePointId":"the edge point id",
                    "bgpConnection":{
                        "password":"",
                        "peerIpAddress":"5.5.5.4",
                        "localAsn":62610,
                        "peerAsn":3456
                    },
                    "createTime":"2023-10-27T07:14:46Z",
                    "edgePointName":"SOF1-1698391290880",
                    "connectivityStatus":"DOWN",
                    "bandwidthMbps":1
                }
            ],
            "createTime":"2023-10-27T07:14:46Z",
            "cloudRouterId":"cloud-router-id",
            "resourceGroupId":"c91db3f4-b15e-4323-9a12-fd3f0330b74b",
            "cloudRouterName":"Test",
            "connectivityStatus":"ABNORMAL",
            "cloudRouterDescription":"",
            "cloudRouterChargeType":"POSTPAID"
        }
     ],
     totalCount: 1
  }
}
```

{% 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

No 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).​
