deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik <mfoj...@redhat.com>
Subject Re: [PATCH 1/3] Adds storage_volume create/delete to mock driver
Date Tue, 13 Dec 2011 15:46:34 GMT
On Dec 13, 2011, at 3:24 PM, marios@redhat.com wrote:

ACK to whole series

 -- Michal

> From: marios <marios@redhat.com>
> 
> 
> Signed-off-by: marios <marios@redhat.com>
> ---
> server/lib/deltacloud/drivers/mock/mock_driver.rb |   19 +++++++++++++++++++
> 1 files changed, 19 insertions(+), 0 deletions(-)
> 
> diff --git a/server/lib/deltacloud/drivers/mock/mock_driver.rb b/server/lib/deltacloud/drivers/mock/mock_driver.rb
> index 9a79671..5d07eed 100644
> --- a/server/lib/deltacloud/drivers/mock/mock_driver.rb
> +++ b/server/lib/deltacloud/drivers/mock/mock_driver.rb
> @@ -245,6 +245,25 @@ module Deltacloud::Drivers::Mock
>       volumes
>     end
> 
> +    def create_storage_volume(credentials, opts=nil)
> +      check_credentials(credentials)
> +      opts ||= {}
> +      opts[:capacity] ||= "1"
> +      volume = {
> +            :id => "Volume#{Time.now.to_i}",
> +            :created => Time.now.to_s,
> +            :state => "AVAILABLE",
> +            :capacity => opts[:capacity],
> +      }
> +      @client.store(:storage_volumes, volume)
> +      StorageVolume.new(volume)
> +    end
> +
> +    def destroy_storage_volume(credentials, opts=nil)
> +      check_credentials(credentials)
> +      @client.destroy(:storage_volumes, opts[:id])
> +    end
> +
>     #
>     # Storage Snapshots
>     #
> -- 
> 1.7.6.4
> 

------------------------------------------------------
Michal Fojtik, mfojtik@redhat.com
Deltacloud API: http://deltacloud.org


Mime
View raw message