cinderlib.serialization module

Oslo Versioned Objects helper file.

These methods help with the serialization of Cinderlib objects that uses the OVO serialization mechanism, so we remove circular references when doing the JSON serialization of objects (for example in a Volume OVO it has a ‘snapshot’ field which is a Snapshot OVO that has a ‘volume’ back reference), piggy back on the OVO’s serialization mechanism to add/get additional data we want.

dict_to_primitive(self, obj, attr, value, visited=None)[source]
dump()[source]

Convert to Json everything we have in this system.

dumps()[source]

Convert to a Json string everything we have in this system.

field_ovo_to_primitive(obj, attr, value, visited=None)[source]
field_to_primitive(self, obj, attr, value, visited=None)[source]
iterable_to_primitive(self, obj, attr, value, visited=None)[source]
json()[source]

Convert to Json everything we have in this system.

jsons()[source]

Convert to a Json string everything we have in this system.

load(json_src, save=False)[source]

Load any json serialized cinderlib object.

obj_from_primitive(cls, primitive, context=None, original_method=cinder.objects.base.CinderObject.obj_from_primitive)[source]
obj_to_primitive(self, target_version=None, version_manifest=None, visited=None)[source]
setup(backend_class)[source]
wrap_to_primitive(cls)[source]