cinder.objects.backup module

class Backup(*args, **kwargs)

Bases: CinderPersistentObject, CinderObject, CinderObjectDictCompat, CinderComparableObject

OPTIONAL_FIELDS = ('metadata', 'parent')
VERSION = '1.7'
property availability_zone
property container
create() None
property created_at
property data_timestamp
static decode_record(backup_url) dict

Deserialize backup metadata from string into a dictionary.

Raises:

InvalidInput

property deleted
property deleted_at
destroy() None
property display_description
property display_name
encode_record(**kwargs) str

Serialize backup object, with optional extra info, into a string.

property encryption_key_id
property fail_reason
fields = {'availability_zone': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'container': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'data_timestamp': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'deleted': Boolean(default=False,nullable=True), 'deleted_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'display_description': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'display_name': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'encryption_key_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'fail_reason': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'host': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'id': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'metadata': Dict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'num_dependent_backups': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'object_count': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'parent': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'parent_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'project_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'restore_volume_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'service': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'service_metadata': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'size': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'snapshot_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'status': BackupStatus(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True,valid_values=('error', 'error_deleting', 'creating', 'available', 'deleting', 'deleted', 'restoring')), 'temp_snapshot_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'temp_volume_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'user_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'volume_id': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False)}
property has_dependent_backups: bool
property host
property id
property is_incremental: bool
property metadata
model

alias of Backup

property name
property num_dependent_backups
obj_extra_fields = ['name', 'is_incremental', 'has_dependent_backups']
obj_load_attr(attrname)

Load an additional attribute from the real object.

This should load self.$attrname and cache any data that might be useful for future load operations.

obj_reset_changes(fields=None)

Reset the list of fields that have been changed.

Parameters:
  • fields – List of fields to reset, or “all” if None.

  • recursive – Call obj_reset_changes(recursive=True) on any sub-objects within the list of fields being reset.

This is NOT “revert to previous values”.

Specifying fields on recursive resets will only be honored at the top level. Everything below the top will reset all.

obj_what_changed()

Returns a set of fields that have been modified.

property object_count
property parent
property parent_id
property project_id
property restore_volume_id
save() None

Save the changed fields back to the store.

This is optional for subclasses, but is presented here in the base class for consistency among those that do.

property service
property service_metadata
property size
property snapshot_id
property status
property temp_snapshot_id
property temp_volume_id
property updated_at
property user_id
property volume_id
class BackupDeviceInfo(context=None, **kwargs)

Bases: CinderObject, CinderObjectDictCompat, CinderComparableObject

VERSION = '1.0'
property device_obj
fields = {'secure_enabled': Boolean(default=False,nullable=False), 'snapshot': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'volume': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True)}
classmethod from_primitive(primitive, context, expected_attrs=None)
property is_snapshot
obj_extra_fields = ['is_snapshot', 'device_obj']
property secure_enabled
property snapshot
to_primitive(context)
property volume
class BackupImport(*args, **kwargs)

Bases: Backup

Special object for Backup Imports.

This class should not be used for anything but Backup creation when importing backups to the DB.

On creation it allows to specify the ID for the backup, since it’s the reference used in parent_id it is imperative that this is preserved.

Backup Import objects get promoted to standard Backups when the import is completed.

property availability_zone
property container
create()
property created_at
property data_timestamp
property deleted
property deleted_at
property display_description
property display_name
property encryption_key_id
property fail_reason
fields = {'availability_zone': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'container': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'data_timestamp': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'deleted': Boolean(default=False,nullable=True), 'deleted_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'display_description': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'display_name': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'encryption_key_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'fail_reason': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'host': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'id': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'metadata': Dict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'num_dependent_backups': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'object_count': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'parent': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'parent_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'project_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'restore_volume_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'service': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'service_metadata': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'size': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'snapshot_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'status': BackupStatus(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True,valid_values=('error', 'error_deleting', 'creating', 'available', 'deleting', 'deleted', 'restoring')), 'temp_snapshot_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'temp_volume_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'user_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'volume_id': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False)}
property host
property id
property metadata
model

alias of Backup

property num_dependent_backups
property object_count
property parent
property parent_id
property project_id
property restore_volume_id
property service
property service_metadata
property size
property snapshot_id
property status
property temp_snapshot_id
property temp_volume_id
property updated_at
property user_id
property volume_id
class BackupList(*args, **kwargs)

Bases: ObjectListBase, CinderObject

VERSION = '1.0'
fields = {'objects': List(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False)}
classmethod get_all(context: RequestContext, filters=None, marker=None, limit=None, offset=None, sort_keys=None, sort_dirs=None) BackupList
classmethod get_all_active_by_window(context, begin, end)
classmethod get_all_by_host(context: RequestContext, host: str) BackupList
classmethod get_all_by_project(context, project_id, filters=None, marker=None, limit=None, offset=None, sort_keys=None, sort_dirs=None)
classmethod get_all_by_volume(context: RequestContext, volume_id: str, vol_project_id: str, filters=None) BackupList
property objects