Volumes are network attached storage such as the EBS service within Amazon Web Services. This class inherits from TopLevelResource and has direct access to the resource’s database object. The following attributes are directly accessible:

attr resource_id:
 The provider ID of the volume
attr organization_service_id:
 The ID of the parent organization service (cloud)
attr region_name:
 The region that the volume resides in
attr volume_id:The provider ID of the volume
attr name:The name of the volume
attr instance_resource_id:
 The resource ID of the instance this volume is associated with
attr snapshot_resource_id:
 The resource ID of the snapshot this volume was built from
attr create_time:
 Timestamp of when this volume was created
attr device:The device that a volume is mapped to on the instance (eg: /dev/sdf)
attr state:The current state of the volume (available or in-use)
attr volume_type:
 The type of volume (eg: pd-standard, gp2, premium_LRS, etc)
attr size:The size in gigabytes of the volume
attr availability_zone:
 The availability_zone where the volume resides
attr iops:The total IOPS allocated to this volume (provisioned volumes only)
attr encrypted:Denotes whether the volume is encrypted
attr delete_on_termination:
 Whether or not the volume is set to automatically delete when the parent instance is terminated
attr snapshots:Returns a list of associated snapshots of this volume
class DivvyResource.Resources.volume.Volume(resource_id)

Bases: DivvyResource.Resources.toplevelresource.TopLevelResource

Volume operations

Delete this resource. If wrapped in a with JobQueue() block, this will queue the deletion job to the wrapped queue, otherwise it
calls immediately.

Retrieve the resource id of the instance this volume is attached to, if any


Retrieve the availability zone/location of the resource


Retrieve the time from the provider that this resource was created (if available).

static get_db_class()

Retrieve the attached device name of the volume (eg: /dev/sdf)

static get_provider_id_field()
static get_resource_type()

Retrieve the size in GB of the resource


Retrieve a list of db objects for snapshots created from the volume (if any)


Retrieve all the actions which are supported by this resource.


Retrieve volume backup scheduled events.


Retrieve the volume type of the resource

handle_resource_created(user_resource_id=None, project_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 projects/groups, alerts, etc)


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 projects/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

modify(iops=None, size=None, volume_type=None, user_resource_id=None)

Modify the volume. This makes a call sot he upstream providier to change one or more properties.

schedule_modification(*args, **kwargs)

Create a scheduled event to modify an existing volume. If a schedule is not supplied then the event will be scheduled to run immediately.

top_level_resource = True