# neutron_lib.callbacks.events module

class neutron_lib.callbacks.events.APIEventPayload(context, method_name, action, metadata=None, request_body=None, states=None, resource_id=None, collection_name=None)

  Bases: `EventPayload`

  The payload for API events.

class neutron_lib.callbacks.events.DBEventPayload(context, metadata=None, request_body=None, states=None, resource_id=None, desired_state=None)

  Bases: `EventPayload`

  The payload for data store events payloads.

  property is_persisted

    Determine if the resource for this event payload is persisted.

    Returns:

      True if this payload’s resource is persisted, otherwise False.

  property is_to_be_committed

    “Determine if the event payload resource is to be committed.

    Returns:

      True if the desired state has been populated, else False.

  property latest_state

    Returns the latest state for the event payload resource.

    Returns:

      If this payload has a desired_state its returned, otherwise latest_state is returned.

class neutron_lib.callbacks.events.EventPayload(context, metadata=None, request_body=None, states=None, resource_id=None)

  Bases: `object`

  Base event payload object.

  This class is intended to be the super class for all event payloads. As such, it defines common attributes many events are likely to use in their payload. Note that event attributes are passed by reference; no copying of states, metadata or request_body is performed and thus consumers should not modify payload references.

  For more information, see the callbacks dev-ref documentation for this project.

  property has_states

    Determines if this event payload has any states.

    Returns:

      True if this event payload has states, otherwise False.

  property latest_state

    Returns the latest state for the event payload.

    Returns:

      The last state of this event payload if has_state else None.

neutron_lib.callbacks.events.is_cancellable_event(event)

  Return if an event is cancellable by definition

this page last updated: 2026-03-26 12:58:28

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