pyrax
Python Bindings for the Rackspace Cloud
 All Classes Namespaces Files Functions Variables Properties
Public Member Functions | Public Attributes | Properties
CloudBlockStorageVolume Class Reference

This class represents a Block Storage volume. More...

Inheritance diagram for CloudBlockStorageVolume:
BaseResource

List of all members.

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

Detailed Description

This class represents a Block Storage volume.


Constructor & Destructor Documentation

def __init__ (   self,
  args,
  kwargs 
)

Member Function Documentation

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.


Member Data Documentation


Property Documentation

description [static]
Initial value:
property(_get_description, _set_description, None,
            "Convenience for referencing the display_description.")
name [static]
Initial value:
property(_get_name, _set_name, None,
            "Convenience for referencing the display_name.")

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Properties