Snapshot ======== Snapshots are point in time backups of a volume. This class inherits from TopLevelResource and has direct access to the resource’s database object. +-------------------------+--------------------------------------------------------------+ | Attribute | Description | +=========================+==============================================================+ | organization_service_id | The ID of the parent organization service (cloud) | +-------------------------+--------------------------------------------------------------+ | region_name | The region that the snapshot resides in | +-------------------------+--------------------------------------------------------------+ | snapshot_id | The provider ID of the snapshot | +-------------------------+--------------------------------------------------------------+ | volume_resource_id | The resource ID of the volume this snapshot was created from | +-------------------------+--------------------------------------------------------------+ | name | The name of the volume’s snapshot | +-------------------------+--------------------------------------------------------------+ | description | Description of the snapshot | +-------------------------+--------------------------------------------------------------+ | state | The current lifecycle state of the snapshot | +-------------------------+--------------------------------------------------------------+ | progress | The creation progress of the snapshot | +-------------------------+--------------------------------------------------------------+ | size | The size in gigabytes of the volume | +-------------------------+--------------------------------------------------------------+ | public | Denotes whether the snapshot is publicly available | +-------------------------+--------------------------------------------------------------+ | create_time | The time when the snapshot was created | +-------------------------+--------------------------------------------------------------+ | encrypted | Denotes whether the snapshot is encrypted | +-------------------------+--------------------------------------------------------------+ .. container:: magic-block-textarea **Snapshot Operations** | ``delete(user_resource_id=None)`` | Delete this resource. If wrapped with JobQueue() block, this will queue the deletion job to the wrapped queue, otherwise it calls immediately. | ``get_date_created()`` | Retrieve the time from the provider that this resource was created (if available). ``static get_db_class()`` ``get_parent_resource_id()`` | ``get_private_images()`` | Retrieve a list of db objects for private images created from the snapshot (if any). ``static get_provider_id_field()`` | ``get_resource_dependencies()`` | Retrieve the dependencies for a particular resources. This is an override of the parent function because we don’t have ResourceLink relationships for volumes and private/public images where the snapshot ID is included in the block device mapping. ``static get_resource_type()`` | ``get_size()`` | Retrieve the size of the snapshot. | ``get_supported_actions()`` | Retrieve all the actions which are supported by this resource. | ``handle_resource_created(user_resource_id=None)`` | This should be called when a resource is created/discovered after the basic data is added to the database. This gives an opportunity for post-addition hooks (assignment to groups, alerts, etc). | ``handle_resource_destroyed(user_resource_id=None, project_resource_id=None)`` | This should be called when a resource is destroyed before the basic data is removed from the database. This gives an opportunity for pre-destruction hooks (removal from groups, alerts, etc). | ``handle_resource_modified(resource, *args, **kwargs)`` | This should be called when a resource is modified after the new data has been updated in the DB session. This gives an opportunity for post-modification hooks. | ``is_backup()`` | Determine if this snapshot represents a volume backup. ``snapshot`` ``snapshot_id`` ``top_level_resource = True``