# neutron_lib.agent.l2_extension module

class neutron_lib.agent.l2_extension.L2AgentExtension

  Bases: `AgentExtension`

  Define stable abstract interface for l2 agent extensions.

  An agent extension extends the agent core functionality.

  abstractmethod delete_port(context, data)

    Handle a port delete event.

    Parameters:

      - context – RPC context.

      - data – Port data.

  abstractmethod 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.

  handle_switch_restart()

    Handle the restart of the switch.

    If switch state is lost when the switch is restarted, here you can re-initialize it.

  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.

this page last updated: 2026-08-15 12:38:23

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

found an error? report a bug