neutron_lib.agent package

neutron_lib.agent package

Submodules

neutron_lib.agent.constants module

neutron_lib.agent.extension module

class neutron_lib.agent.extension.AgentExtension

Bases: object

Define stable abstract interface for agent extensions.

An agent extension extends the agent core functionality.

consume_api(agent_api)

Consume the AgentAPI instance from the AgentExtensionsManager.

Allows an extension to gain access to resources internal to the neutron agent and otherwise unavailable to the extension. Examples of such resources include bridges, ports, and routers.

Parameters:agent_api – An instance of an agent-specific API.
initialize(connection, driver_type)

Perform agent core resource extension initialization.

Parameters:
  • connection – RPC connection that can be reused by the extension to define its RPC endpoints
  • driver_type – String that defines the agent type to the extension. Can be used to choose the right backend implementation.

Called after all extensions have been loaded. No resource (port, policy, router, etc.) handling will be called before this method.

neutron_lib.agent.l2_extension module

class neutron_lib.agent.l2_extension.L2AgentExtension

Bases: neutron_lib.agent.extension.AgentExtension

Define stable abstract interface for l2 agent extensions.

An agent extension extends the agent core functionality.

delete_port(context, data)

Handle a port delete event.

Parameters:
  • context – RPC context.
  • data – Port data.
handle_port(context, data)

Handle a port add/update event.

This can be called on either create or update, depending on the code flow. Thus, it’s this function’s responsibility to check what actually changed.

Parameters:
  • context – RPC context.
  • data – Port data.
initialize(connection, driver_type)

Initialize agent extension.

Parameters:
  • connection – RPC connection that can be reused by the extension to define its RPC endpoints
  • driver_type – String that defines the agent type to the extension. Can be used to choose the right backend implementation.

neutron_lib.agent.l3_extension module

class neutron_lib.agent.l3_extension.L3AgentExtension

Bases: neutron_lib.agent.extension.AgentExtension

Define stable abstract interface for l3 agent extensions.

An agent extension extends the agent core functionality.

add_router(context, data)

Handle a router add event.

Called on router create.

Parameters:
  • context – RPC context.
  • data – Router data.
delete_router(context, data)

Handle a router delete event.

Parameters:
  • context – RPC context.
  • data – Router data.
ha_state_change(context, data)

Change router state from agent extension.

Called on HA router state change.

Parameters:
  • context – rpc context
  • data – dict of router_id and new state
update_router(context, data)

Handle a router update event.

Called on router update.

Parameters:
  • context – RPC context.
  • data – Router data.

neutron_lib.agent.topics module

neutron_lib.agent.topics.get_topic_name(prefix, table, operation, host=None)

Create a topic name.

The topic name needs to be synced between the agent and the plugin. The plugin will send a fanout message to all of the listening agents so that the agents in turn can perform their updates accordingly.

Parameters:
  • prefix – Common prefix for the plugin/agent message queues.
  • table – The table in question (NETWORK, SUBNET, PORT).
  • operation – The operation that invokes notification (CREATE, DELETE, UPDATE)
  • host – Add host to the topic
Returns:

The topic name.

Module contents

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.