pyrax
Python Bindings for the Rackspace Cloud
|
This class represents a Block Storage volume. More...
Public Member Functions | |
def | __init__ |
def | attach_to_instance |
Attaches this volume to the cloud server instance at the specified mountpoint. | |
def | detach |
Detaches this volume from any device it may be attached to. | |
def | delete |
Volumes cannot be deleted if either a) they are attached to a device, or b) they have any snapshots. | |
def | create_snapshot |
Creates a snapshot of this volume, with an optional name and description. | |
def | list_snapshots |
Returns a list of all snapshots of this volume. | |
def | delete_all_snapshots |
Locates all snapshots of this volume and deletes them. | |
Public Attributes | |
display_name | |
display_description | |
Properties | |
name | |
description |
This class represents a Block Storage volume.
def __init__ | ( | self, | |
args, | |||
kwargs | |||
) |
def attach_to_instance | ( | self, | |
instance, | |||
mountpoint | |||
) |
Attaches this volume to the cloud server instance at the specified mountpoint.
This requires a call to the cloud servers API; it cannot be done directly.
def create_snapshot | ( | self, | |
name = None , |
|||
description = None , |
|||
force = False |
|||
) |
Creates a snapshot of this volume, with an optional name and description.
Normally snapshots will not happen if the volume is attached. To override this default behavior, pass force=True.
def delete | ( | self, | |
force = False |
|||
) |
Volumes cannot be deleted if either a) they are attached to a device, or b) they have any snapshots.
This method overrides the base delete() method to both better handle these failures, and also to offer a 'force' option. When 'force' is True, the volume is detached, and any dependent snapshots are deleted before calling the volume's delete.
def delete_all_snapshots | ( | self | ) |
Locates all snapshots of this volume and deletes them.
def detach | ( | self | ) |
Detaches this volume from any device it may be attached to.
If it is not attached, nothing happens.
def list_snapshots | ( | self | ) |
Returns a list of all snapshots of this volume.
description [static] |
property(_get_description, _set_description, None, "Convenience for referencing the display_description.")
name [static] |
property(_get_name, _set_name, None, "Convenience for referencing the display_name.")