
# 查询路由器
#### 功能介绍
查询路由器详情。
#### 调试
您可以在[API Explorer](https://apiexplorer.developer.huaweicloud.com/apiexplorer/doc?product=VPC&version=v2&api=NeutronShowRouter)中调试该接口。
#### URI
GET /v2.0/routers/{router_id}
#### 请求参数
无。
#### 请求示例
```
GET https://{Endpoint}/v2.0/routers/01ab4be1-4447-45fb-94be-3ee787ed4ebe
```
#### 响应参数
表1响应参数 
| 参数名称   | 类型                                                                       | 说明                                                                        |
|:---|:---|:---|
| router | [router] object | router对象，参见[表2]。 |
   
 表2router对象 
| 参数名称                  | 类型                                                                                      | 说明                                                                                        |
|:---|:---|:---|
| id                    | String                                                                                  | 路由器的id 【使用说明】在查询路由器列表时非必选            |
| name                  | String                                                                                  | 路由器的名称。 仅支持数字、字母、_(下划线)、-（中划线）、.（点）。 |
| admin_state_up        | Boolean                                                                                 | 管理状态。 只支持true。                       |
| status                | String                                                                                  | 状态，可以为ACTIVE， DOWN，ERROR。                                                                 |
| tenant_id             | String                                                                                  | 项目ID                                                                                      |
| external_gateway_info | [external_gateway_info] object | 扩展属性：外部网关信息，参见external_gateway_info对象                                                     |
| routes                | Array of [route] objects       | 扩展属性：路由信息列表，参见[表4]               |
| project_id            | String                                                                                  | 项目ID，请参见[获取项目ID](https://support.huaweicloud.com/api-vpc/vpc_api_0011.html)。              |
| created_at            | String                                                                                  | 资源创建时间，UTC时间 格式：yyyy-MM-ddTHH:mm:ss   |
| updated_at            | String                                                                                  | 资源更新时间，UTC时间 格式：yyyy-MM-ddTHH:mm:ss   |
   
 表3external_gateway_info对象 
| 参数名称        | 类型      | 说明                                                                                                                                               |
|:---|:---|:---|
| network_id  | String  | 外部网络的UUID。 外部网络的信息请通过GET /v2.0/networks?router:external=True或neutron net-external-list方式查询。 |
| enable_snat | Boolean | 是否启用SNAT。 默认为false。                                                                         |
   
 表4route对象 
| 参数名称        | 类型     | 说明                                     |
|:---|:---|:---|
| destination | String | IP地址段                                  |
| nexthop     | String | 下一跳IP地址，nexthop仅支持是router所关联的子网范围内IP地址 |
   
#### 响应示例
```
{
    "router": {
        "id": "01ab4be1-4447-45fb-94be-3ee787ed4ebe",
        "name": "xiaoleizi-tag",
        "status": "ACTIVE",
        "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
        "project_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
        "admin_state_up": true,
        "external_gateway_info": {
            "network_id": "0a2228f2-7f8a-45f1-8e09-9039e1d09975",
            "enable_snat": false
        },
        "routes": [
            {
                "destination": "0.0.0.0/0",
                "nexthop": "172.16.0.124"
            }
        ],
        "created_at": "2018-03-23T09:26:08",
        "updated_at": "2018-08-24T08:49:53"
    }
}
```
#### 状态码
请参见[状态码](https://support.huaweicloud.com/api-vpc/vpc_api_0002.html)。
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-vpc/vpc_api_0003.html)。
