<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -650,5 +650,128 @@ Capistrano::Configuration.instance.load do
 
     end # end namespace :addresses
 
+
+    # VOLUME TASKS
+    #########################################
+     
+      namespace :volumes do 
+        desc &lt;&lt;-DESC
+        Describes existing volumes.
+        DESC
+        task :show do
+          begin
+            amazon = capsize_ec2.connect
+            volumes = amazon.describe_volumes
+          
+            if volumes.volumeSet &amp;&amp; volumes.volumeSet.item
+              volumes.volumeSet.item.each do |volume|
+                puts &quot;volume:volumeId = #{volume.volumeId}&quot;
+                %w(status size snapshotId availabilityZone attachmentSet createTime).each do |field|
+                  puts &quot;  volume:#{field} = #{volume[field]}&quot;
+                end
+              end
+            else
+              puts &quot;You have no volumes&quot;
+            end
+          rescue Exception =&gt; e
+            puts &quot;The attempt to show volumes failed with the error : &quot; + e
+            raise e
+          end
+        end
+
+        desc &lt;&lt;-DESC
+        Create a new EBS volume.
+        This will create a new EBS volume of SIZE Gb in the availability zone given as ZONE
+        (eg us-east-1{a,b,c})
+        So to create a 10Gb volume in zone 'us-east-1c':
+         cap ec2:volumes:create SIZE=10 ZONE=us-east-1c
+        DESC
+        task :create do
+          begin
+            size = capsize.get(:size)
+            zone = capsize.get(:zone)
+
+            puts &quot;Creating #{size}Gb volume in #{zone}&quot;
+
+            amazon = capsize_ec2.connect
+            res = amazon.create_volume :size =&gt; size, :availability_zone =&gt; zone
+            puts &quot;Created volume #{res[&quot;volumeId&quot;]}&quot;
+
+          rescue Exception =&gt; e
+            puts &quot;The attempt to create a volume failed with the error : &quot; + e
+            raise e
+          end
+        end
+
+        desc &lt;&lt;-DESC
+        Attach an EBS volume to an instance.
+        This will attach the EBS volume VOLUME_ID to the instance INSTANCE_ID
+        at the device path DEVICE.
+        DESC
+        task :attach do
+          begin
+            volume_id = capsize.get :volume_id
+            instance_id = capsize.get :instance_id
+            device = capsize.get :device
+            puts &quot;Attaching volume #{volume_id} to instance #{instance_id} at #{device}&quot;
+
+            amazon = capsize_ec2.connect
+            response = amazon.attach_volume :volume_id =&gt; volume_id, :instance_id =&gt; instance_id, :device =&gt; device
+            if response.res == &quot;true&quot;
+              puts &quot;Volume #{volume_id} attached to #{instance_id}&quot;
+            end
+          rescue Exception =&gt; e
+            puts &quot;The attempt to attach volume #{volume_id} failed with the error : &quot; + e
+            raise e
+          end
+        end
+
+        desc &lt;&lt;-DESC
+        Detach an EBS volume.
+        This will detach the EBS volume VOLUME_ID from any instance it is connected to.
+        DESC
+        task :detach do
+          begin
+            volume_id = capsize.get :volume_id
+            puts &quot;Detaching volume #{volume_id}&quot;
+
+            amazon = capsize_ec2.connect
+            response = amazon.detach_volume :volume_id =&gt; volume_id
+            if response.res == &quot;true&quot;
+              puts &quot;Volume #{volume_id} detached&quot;
+            end
+          rescue Exception =&gt; e
+            puts &quot;The attempt to detach volume #{volume_id} failed with the error : &quot; + e
+            raise e
+          end
+        end
+
+        desc &lt;&lt;-DESC
+        Delete an EBS volume.
+        This will delete the EBS volume VOLUME_ID.
+        DESC
+        task :delete do 
+
+          confirm = (Capistrano::CLI.ui.ask(&quot;WARNING! Really terminate instance \&quot;#{instance_id}\&quot;? (y/N): &quot;).downcase == 'y')
+          if confirm
+            begin
+              volume_id = capsize.get :volume_id
+              puts &quot;Deleting volume #{volume_id}&quot;
+              
+              amazon = capsize_ec2.connect
+              response = amazon.delete_volume :volume_id =&gt; volume_id
+              if response.res == &quot;true&quot;
+                puts &quot;Volume #{volume_id} deleted&quot;
+              end
+            rescue Exception =&gt; e
+              puts &quot;The attempt to create a volume failed with the error : &quot; + e
+              raise e
+            end
+          end
+        end
+
+      end # end namespace :volumes
+
+
   end # end namespace :ec2
-end # end Capistrano::Configuration.instance.load
\ No newline at end of file
+end # end Capistrano::Configuration.instance.load</diff>
      <filename>lib/capsize/ec2.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b183f9fcea666128389529d3c63f6ee3459c70c4</id>
    </parent>
  </parents>
  <author>
    <name>bodhi</name>
    <email>bodhi@5263.org</email>
  </author>
  <url>http://github.com/jnewland/capsize/commit/4f6ef744b1422c42511c3d987e6819d2fa77db6b</url>
  <id>4f6ef744b1422c42511c3d987e6819d2fa77db6b</id>
  <committed-date>2008-12-16T05:45:46-08:00</committed-date>
  <authored-date>2008-12-04T05:05:39-08:00</authored-date>
  <message>added ec2 volume support

Signed-off-by: Jesse Newland &lt;jnewland@gmail.com&gt;</message>
  <tree>5a4ba7d4b4a03cfaf78af8c5be868117fcc884c8</tree>
  <committer>
    <name>Jesse Newland</name>
    <email>jnewland@gmail.com</email>
  </committer>
</commit>
