openstack.network.v2.router

openstack.network.v2.router

The Router Class

The Router class inherits from Resource.

class openstack.network.v2.router.Router(attrs=None, loaded=False)

Construct a Resource to interact with a service’s REST API.

The Resource class offers two class methods to construct resource objects, which are preferrable to entering through this initializer. See Resource.new() and Resource.existing().

Parameters:
  • attrs (dict) – The attributes to set when constructing this Resource.
  • loaded (bool) – True if this Resource exists on the server, False if it does not.
admin_state_up = None

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

availability_zone_hints = None

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

availability_zones = None

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

external_gateway_info = None

The network_id, for the external gateway. Type: dict

name = None

The router name.

project_id = None

The ID of the project this router is associated with.

status = None

The router status.

is_ha = None

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

is_distributed = None

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

add_interface(session, subnet_id)

Add an internal interface to a logical router.

Parameters:
  • session (Session) – The session to communicate through.
  • subnet_id (str) – The ID of a subnet to add.
Returns:

The body of the response as a dictionary.

remove_interface(session, subnet_id)

Remove an internal interface from a logical router.

Parameters:
  • session (Session) – The session to communicate through.
  • subnet_id (str) – The ID of a subnet to remove.
Returns:

The body of the response as a dictionary.

Creative Commons Attribution 3.0 License

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