Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
usr
/
lib
/
python2.7
/
site-packages
/
boto
/
ec2
/
File Content:
volume.pyo
� �Wc @ s| d Z d d l m Z d d l m Z d d l m Z d e f d � � YZ d e f d � � YZ d e f d � � YZ d S( s0 Represents an EC2 Elastic Block Storage Volume i����( t ResultSet( t Tag( t TaggedEC2Objectt Volumec B s� e Z d Z d d � Z d � Z d � Z d � Z d � Z e e d � Z e d � Z e d � Z e e d � Z d e d � Z d � Z d � Z d d e d � Z RS( s� Represents an EBS volume. :ivar id: The unique ID of the volume. :ivar create_time: The timestamp of when the volume was created. :ivar status: The status of the volume. :ivar size: The size (in GB) of the volume. :ivar snapshot_id: The ID of the snapshot this volume was created from, if applicable. :ivar attach_data: An AttachmentSet object. :ivar zone: The availability zone this volume is in. :ivar type: The type of volume (standard or consistent-iops) :ivar iops: If this volume is of type consistent-iops, this is the number of IOPS provisioned (10-300). :ivar encrypted: True if this volume is encrypted. c C st t t | � j | � d | _ d | _ d | _ d | _ d | _ d | _ d | _ d | _ d | _ d | _ d S( N( t superR t __init__t Nonet idt create_timet statust sizet snapshot_idt attach_datat zonet typet iopst encrypted( t selft connection( ( s3 /usr/lib/python2.7/site-packages/boto/ec2/volume.pyR 2 s c C s d | j S( Ns Volume:%s( R ( R ( ( s3 /usr/lib/python2.7/site-packages/boto/ec2/volume.pyt __repr__? s c C s� t t | � j | | | � } | d k r. | S| d k rM t � | _ | j S| d k rx t d t f g � | _ | j Sd Sd S( Nt attachmentSett tagSett item( R R t startElementR t AttachmentSetR R R t tags( R t namet attrsR t retval( ( s3 /usr/lib/python2.7/site-packages/boto/ec2/volume.pyR B s c C s | d k r | | _ n� | d k r0 | | _ n� | d k rW | d k r| | _ qn� | d k ru t | � | _ n� | d k r� | | _ n� | d k r� | | _ nj | d k r� | | _ nR | d k r� t | � | _ n4 | d k r� | j � d k | _ n t | | | � d S( Nt volumeIdt createTimeR t R t snapshotIdt availabilityZonet volumeTypeR R t true( R R R t intR R R R R t lowerR t setattr( R R t valueR ( ( s3 /usr/lib/python2.7/site-packages/boto/ec2/volume.pyt endElementO s( c C s | j j | j � d S( N( t __dict__t update( R t updated( ( s3 /usr/lib/python2.7/site-packages/boto/ec2/volume.pyt _updatef s c C s� | j j | j g d | �} g | D] } | j | j k r% | ^ q% } t | � d k ro | j | d � n | r� t d | j � � n | j S( s� Update the data associated with this volume by querying EC2. :type validate: bool :param validate: By default, if EC2 returns no data about the volume the update method returns quietly. If the validate param is True, however, it will raise a ValueError exception if no data is returned from EC2. t dry_runi s %s is not a valid Volume ID( R t get_all_volumesR t lenR, t ValueErrorR ( R t validateR- t unfiltered_rst xt rs( ( s3 /usr/lib/python2.7/site-packages/boto/ec2/volume.pyR* i s +c C s | j j | j d | �S( sc Delete this EBS volume. :rtype: bool :return: True if successful R- ( R t delete_volumeR ( R R- ( ( s3 /usr/lib/python2.7/site-packages/boto/ec2/volume.pyt delete� s c C s | j j | j | | d | �S( s� Attach this EBS volume to an EC2 instance. :type instance_id: str :param instance_id: The ID of the EC2 instance to which it will be attached. :type device: str :param device: The device on the instance through which the volume will be exposed (e.g. /dev/sdh) :rtype: bool :return: True if successful R- ( R t attach_volumeR ( R t instance_idt deviceR- ( ( s3 /usr/lib/python2.7/site-packages/boto/ec2/volume.pyt attach� s c C s^ d } | j r | j j } n d } | j r<