Nova common internal object model
Bases: oslo_versionedobjects.base.VersionedObject
Base class and object factory.
This forms the base of all objects that can be remoted or instantiated via RPC. Simply defining a class that inherits from this base class will make it remotely instantiatable. Objects should implement the necessary “get” classmethod routines as well as “save” object methods as appropriate.
Context manager to make an object call as an admin.
This temporarily modifies the context embedded in an object to be elevated() and restores it after the call completes. Example usage:
- with obj.obj_as_admin():
- obj.save()
Reset the list of fields that have been changed.
Note
Parameters: |
|
---|
A check that can be used to inhibit online migration behavior
This is usually used to check if all services that will be accessing the db directly are ready for the new format.
Bases: oslo_versionedobjects.base.VersionedObjectRegistry
Bases: oslo_messaging.serializer.NoOpSerializer
A NovaObject-aware Serializer.
This implements the Oslo Serializer interface and provides the ability to serialize and deserialize NovaObject entities. Any service that needs to accept or return NovaObjects as arguments or result values should pass this to its RPCClient and RPCServer objects.
Bases: object
Mixin class for Persistent objects.
This adds the fields that we use in common for most persistent objects.
Bases: object
Mixin class for db backed objects with timestamp fields.
Sqlalchemy models that inherit from the oslo_db TimestampMixin will include these fields and the corresponding objects will benefit from this mixin.
Bases: oslo_versionedobjects.base.ObjectListBase
Return the mangled name of the attribute’s underlying storage.
Compare two primitives for equivalence ignoring some keys.
This operation tests the primitives of two objects for equivalence. Object primitives may contain a list identifying fields that have been changed - this is ignored in the comparison. The ignore parameter lists any other keys to be ignored.
:param:obj1: The first object in the comparison :param:obj2: The second object in the comparison :param:ignore: A list of fields to ignore :returns: True if the primitives are equal ignoring changes and specified fields, otherwise False.
Construct a dictionary of object lists, keyed by item_key.
:param:context: Request context :param:list_cls: The ObjectListBase class :param:obj_list: The list of objects to place in the dictionary :param:item_key: The object attribute name to use as a dictionary key
Construct an object list from a list of primitives.
This calls item_cls._from_db_object() on each item of db_list, and adds the resulting object to list_obj.
:param:context: Request context :param:list_obj: An ObjectListBase object :param:item_cls: The NovaObject class of the objects within the list :param:db_list: The list of primitives to convert to objects :param:extra_args: Extra arguments to pass to _from_db_object() :returns: list_obj
Recursively turn an object into a python primitive.
A NovaObject becomes a dict, and anything that implements ObjectListBase becomes a list.
Decorator that will do the arguments serialization before remoting.