Volume ====== 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. +-------------------------+-------------------------------------------------------------------------------------------------+ | Attribute | Description | +=========================+=================================================================================================+ | resource_id | The provider ID of the volume | +-------------------------+-------------------------------------------------------------------------------------------------+ | organization_service_id | The ID of the parent organization service (cloud) | +-------------------------+-------------------------------------------------------------------------------------------------+ | region_name | The region that the volume resides in | +-------------------------+-------------------------------------------------------------------------------------------------+ | volume_id | The provider ID of the volume | +-------------------------+-------------------------------------------------------------------------------------------------+ | name | The name of the volume | +-------------------------+-------------------------------------------------------------------------------------------------+ | instance_resource_id | The resource ID of the instance this volume is associated with | +-------------------------+-------------------------------------------------------------------------------------------------+ | snapshot_resource_id | The resource ID of the snapshot this volume was built from | +-------------------------+-------------------------------------------------------------------------------------------------+ | create_time | Timestamp of when this volume was created | +-------------------------+-------------------------------------------------------------------------------------------------+ | device | The device that a volume is mapped to on the instance (e.g., /dev/sdf) | +-------------------------+-------------------------------------------------------------------------------------------------+ | state | The current state of the volume (available or in-use) | +-------------------------+-------------------------------------------------------------------------------------------------+ | volume_type | The type of volume (e.g., pd-standard, gp2, premium_LRS, etc.) | +-------------------------+-------------------------------------------------------------------------------------------------+ | size | The size in gigabytes of the volume | +-------------------------+-------------------------------------------------------------------------------------------------+ | availability_zone | The availability_zone where the volume resides | +-------------------------+-------------------------------------------------------------------------------------------------+ | iops | The total IOPS allocated to this volume (provisioned volumes only) | +-------------------------+-------------------------------------------------------------------------------------------------+ | encrypted | Denotes whether the volume is encrypted | +-------------------------+-------------------------------------------------------------------------------------------------+ | delete_on_termination | Whether or not the volume is set to automatically delete when the parent instance is terminated | +-------------------------+-------------------------------------------------------------------------------------------------+ | snapshots | Returns a list of associated snapshots of this volume | +-------------------------+-------------------------------------------------------------------------------------------------+ .. container:: magic-block-textarea **Volume Operations** | ``delete(user_resource_id=None)`` | Delete this resource. If wrapped in a with JobQueue() block, this will queue the deletion job to the wrapped queue, otherwise it calls immediately. | ``get_attached_instance_resource_id()`` | Retrieve the resource id of the instance this volume is attached to, if any. | ``get_availability_zone()`` | Retrieve the availability zone/location of the resource. | ``get_date_created()`` | Retrieve the time from the provider that this resource was created (if available). ``static get_db_class()`` | ``get_device()`` | Retrieve the attached device name of the volume (e.g., /dev/sdf). ``get_parent_resource_id()`` ``static get_provider_id_field()`` ``static get_resource_type()`` | ``get_size()`` | Retrieve the size in GB of the resource. | ``get_snapshots()`` | Retrieve a list of db objects for snapshots created from the volume (if any) | ``get_supported_actions()`` | Retrieve all the actions which are supported by this resource. | ``get_volume_backup_scheduled_events()`` | Retrieve volume backup scheduled events. | ``get_volume_type()`` | 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). | ``handle_resource_destroyed(user_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 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`` ``volume`` ``volume_id``