10.4. Showing virtual router details

GET /v2.0/routers/{router_id}

Shows details of a router with the specified ID.

Source: https://docs.openstack.org/api-ref/network/v2/index.html#show-router-details

10.4.1. Request

Name In Type Description
router_id path string The ID of the router.
fields (Optional) query string The fields that you want the server to return. If no fields query parameter is specified, the networking API returns all attributes allowed by the policy settings. By using fields parameter, the API returns only the requested set of attributes. fields parameter can be specified multiple times. For example, if you specify fields=id&fields=name in the request URL, only id and name attributes will be returned.

10.4.1.1. Example

# curl -ks -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
https://<node_IP_addr>:9696/v2.0/routers/ce996632-45a2-4c6b-a951-a624eba74621

10.4.2. Response

Name In Type Description
router body object A router object.
id body string The ID of the router.
tenant_id body string The ID of the project.
project_id body string The ID of the project.
name body string Human-readable name of the resource.
description body string A human-readable description for the resource.
admin_state_up body boolean The administrative state of the resource, which is up (true) or down (false).
status body string The router status.
external_gateway_info body object The external gateway information of the router. If the router has an external gateway, this would be a dictionary of network_id, enable_snat and external_fixed_ips. Otherwise, this would be null.
revision_number body integer The revision number of the resource.
routes body array The extra routes configuration for L3 router. A list of dictionaries with destination and nexthop parameters. It is available when extraroute extension is enabled.
destination body string The destination CIDR.
nexthop body string The IP address of the next hop for the corresponding destination. The next hop IP address must be a part of one of the subnets to which the router interfaces are connected.
distributed body boolean true indicates a distributed router. It is available when dvr extension is enabled.
ha body boolean true indicates a highly-available router. It is available when l3-ha extension is enabled.
availability_zone_hints body array The availability zone candidates for the router. It is available when router_availability_zone extension is enabled.
availability_zones body array The availability zone(s) for the router. It is available when router_availability_zone extension is enabled.
service_type_id body string The ID of the service type associated with the router.
flavor_id body string The ID of the flavor associated with the router.
created_at body string Time at which the resource has been created (in UTC ISO8601 format).
updated_at body string Time at which the resource has been updated (in UTC ISO8601 format).
tags body array The list of tags on the resource.
conntrack_helpers body array The associated conntrack helper resources for the roter. If the router has multiple conntrack helper resources, this field has multiple entries. Each entry consists of netfilter conntrack helper (helper), the network protocol (protocol), the network port (port).

10.4.2.1. Status codes

10.4.2.1.1. Success

Code Reason
200 - OK Request was successful.

10.4.2.1.2. Error

Code Reason
400 - Bad Request Some content in the request was invalid.
401 - Unauthorized User must authenticate before making a request.
404 - Not Found The requested resource could not be found.
412 - Precondition Failed The server does not meet one of the preconditions that the requester put on the request header fields.

10.4.2.2. Example

{
  "router": {
    "status": "ACTIVE",
    "external_gateway_info": {
      "network_id": "b4907761-8c0f-447e-9cfe-c688ca6e44a0",
      "enable_snat": true,
      "external_fixed_ips": [
        {
          "subnet_id": "351884c7-ee37-4a7d-9dcb-4cff4a1bba27",
          "ip_address": "10.94.139.172"
        }
      ]
    },
    "availability_zone_hints": [],
    "availability_zones": [
      "nova"
    ],
    "description": "",
    "tags": [],
    "tenant_id": "f5d834d636c642c7bfe8af86139c6f26",
    "created_at": "2020-03-04T15:22:40Z",
    "admin_state_up": true,
    "distributed": false,
    "updated_at": "2020-03-04T15:22:44Z",
    "project_id": "f5d834d636c642c7bfe8af86139c6f26",
    "flavor_id": null,
    "revision_number": 4,
    "routes": [],
    "ha": false,
    "id": "ce996632-45a2-4c6b-a951-a624eba74621",
    "name": "router1"
  }
}