# openstack.network.v2.router

## The Router Class

The `Router` class inherits from `Resource`.

class openstack.network.v2.router.Router(_synchronized=False, connection=None, **attrs)

  The base resource

  Parameters:

    - _synchronized (bool) – This is not intended to be used directly. See `new()` and `existing()`.

    - connection (openstack.connection.Connection) – Reference to the Connection being used. Defaults to None to allow Resource objects to be used without an active Connection, such as in unit tests. Use of `self._connection` in Resource code should protect itself with a check for None.

  resource_key = 'router'

    Singular form of key for resource.

  resources_key = 'routers'

    Plural form of key for resource.

  base_path = '/routers'

    The base part of the URI for this resource.

  allow_create = True

    Allow create operation for this resource.

  allow_fetch = True

    Allow get operation for this resource.

  allow_commit = True

    Allow update operation for this resource.

  allow_delete = True

    Allow delete operation for this resource.

  allow_list = True

    Allow list operation for this resource.

  availability_zone_hints

    Availability zone hints to use when scheduling the router. Type: list of availability zone names

  availability_zones

    Availability zones for the router. Type: list of availability zone names

  created_at

    Timestamp when the router was created.

  description

    The router description.

  enable_ndp_proxy

    The ndp proxy state of the router

  external_gateway_info

    The `network_id`, for the external gateway. Type: dict

  flavor_id

    The ID of the flavor.

  is_admin_state_up

    The administrative state of the router, which is up `True` or down `False`. Type: bool

  is_distributed

    The distributed state of the router, which is distributed `True` or not `False`. Type: bool

  is_ha

    The highly-available state of the router, which is highly available `True` or not `False`. Type: bool

  name

    The router name.

  project_id

    The ID of the project this router is associated with.

  tenant_id

    Tenant_id (deprecated attribute).

  revision_number

    Revision number of the router. Type: int

  routes

    The extra routes configuration for the router.

  status

    The router status.

  updated_at

    Timestamp when the router was created.

  add_interface(session, **body)

    Add an internal interface to a logical router.

    Parameters:

      - session (`Adapter`) – The session to communicate through.

      - body (dict) – The body requested to be updated on the router

    Returns:

      The body of the response as a dictionary.

    Raises:

      `SDKException` on error.

  remove_interface(session, **body)

    Remove an internal interface from a logical router.

    Parameters:

      - session (`Adapter`) – The session to communicate through.

      - body (dict) – The body requested to be updated on the router

    Returns:

      The body of the response as a dictionary.

    Raises:

      `SDKException` on error.

  add_extra_routes(session, body)

    Add extra routes to a logical router.

    Parameters:

      - session (`Adapter`) – The session to communicate through.

      - body (dict) – The request body as documented in the api-ref.

    Returns:

      The response as a Router object with the added extra routes.

    Raises:

      `SDKException` on error.

  remove_extra_routes(session, body)

    Remove extra routes from a logical router.

    Parameters:

      - session (`Adapter`) – The session to communicate through.

      - body (dict) – The request body as documented in the api-ref.

    Returns:

      The response as a Router object with the extra routes left.

    Raises:

      `SDKException` on error.

  add_gateway(session, **body)

    Add an external gateway to a logical router.

    Parameters:

      - session (`Adapter`) – The session to communicate through.

      - body (dict) – The body requested to be updated on the router

    Returns:

      The body of the response as a dictionary.

  remove_gateway(session, **body)

    Remove an external gateway from a logical router.

    Parameters:

      - session (`Adapter`) – The session to communicate through.

      - body (dict) – The body requested to be updated on the router

    Returns:

      The body of the response as a dictionary.

  add_external_gateways(session, body)

    Add external gateways to a router.

    Parameters:

      - session (`Adapter`) – The session to communicate through.

      - body (dict) – The body requested to be updated on the router

    Returns:

      The body of the response as a dictionary.

  update_external_gateways(session, body)

    Update external gateways of a router.

    Parameters:

      - session (`Adapter`) – The session to communicate through.

      - body (dict) – The body requested to be updated on the router

    Returns:

      The body of the response as a dictionary.

  remove_external_gateways(session, body)

    Remove external gateways from a router.

    Parameters:

      - session (`Adapter`) – The session to communicate through.

      - body (dict) – The body requested to be updated on the router

    Returns:

      The body of the response as a dictionary.

this page last updated: 2026-01-16 23:06:19

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.