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:
|The provider ID of the volume|
|The ID of the parent organization service (cloud)|
|The region that the volume resides in|
|attr volume_id:||The provider ID of the volume|
|attr name:||The name of the volume|
|The resource ID of the instance this volume is associated with|
|The resource ID of the snapshot this volume was built from|
|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)|
|The type of volume (eg: pd-standard, gp2, premium_LRS, etc)|
|attr size:||The size in gigabytes of the volume|
|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|
|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|
- 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).
Retrieve the attached device name of the volume (eg: /dev/sdf)
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
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.
Create a scheduled event to modify an existing volume. If a schedule is not supplied then the event will be scheduled to run immediately.