• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Neutron
  5. Router
  6. Querying Routers

Querying Routers

Function

This interface is used to query all routers accessible to the tenant submitting the request.

URI

GET /v2.0/routers

Example:

/v2.0/routers?id={id}&name={name}&admin_state_up={admin_state_up}&tenant_id={tenant_id}&status={status}

Request Message

None

Response Message

Table 1 Response parameter

Parameter

Type

Description

routers

List(router)

Specifies the router list. For details, see Table 1.

Example:

Example request

GET /v2.0/routers?limit=1

Example response

{
    "routers": [
        {
            "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"
        }
    ]
}

Status Codes

For details, see section Status Codes.