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?expanded=show-router-details-detail#show-router-details

Request

Parameters

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 the fields parameter, the API returns only the requested set of attributes. The fields parameter can be specified multiple times. For example, if you specify fields=id&fields=name in the request URL, only the id and name attributes will be returned.

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

Response

Parameters

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.
network_id body string Network ID which the router gateway is connected to.
enable_snat body boolean Enable Source NAT (SNAT) attribute. true means Network Address Translation (NAT) is enabled for traffic generated by subnets attached to the router when the traffic is sent to/received from the external network. false means no NAT is applied for traffic from/to the external network. It is available when ext-gw-mode extension is enabled.
external_fixed_ips body array IP address(es) of the external gateway of the router. It is a list of IP addresses. Each element of the list is a dictionary of ip_address and subnet_id.
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

The date and time when the resource was created.

The date and time stamp format is ISO 8601:

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00.

The ±hh:mm value, if included, is the time zone as an offset from UTC. In this example, the offset value is -05:00.

updated_at body string

The date and time when the resource was updated. If the resource has not been updated, this field will be null.

The date and time stamp format is ISO 8601:

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00.

The ±hh:mm value, if included, is the time zone as an offset from UTC. In this example, the offset value is -05:00.

tags body array The list of tags on the router.
conntrack_helpers body array The associated conntrack helper resources for the router. 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).

Status codes

Success

Code Reason
200 - OK Request was successful.

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.

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"
  }
}