deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@redhat.com
Subject [PATCH 2/3] Add features and attributes for Openstack block storage volumes
Date Mon, 19 Nov 2012 14:54:06 GMT
From: marios <marios@redhat.com>


Signed-off-by: marios <marios@redhat.com>
---
 server/lib/deltacloud/collections/storage_volumes.rb |  4 ++++
 server/lib/deltacloud/drivers/features.rb            | 19 +++++++++++++++++++
 server/lib/deltacloud/models/storage_volume.rb       |  1 +
 3 files changed, 24 insertions(+)

diff --git a/server/lib/deltacloud/collections/storage_volumes.rb b/server/lib/deltacloud/collections/storage_volumes.rb
index 0b52045..bc505cb 100644
--- a/server/lib/deltacloud/collections/storage_volumes.rb
+++ b/server/lib/deltacloud/collections/storage_volumes.rb
@@ -16,6 +16,8 @@
 module Deltacloud::Collections
   class StorageVolumes < Base
 
+    include Deltacloud::Features
+
     set :capability, lambda { |m| driver.respond_to? m }
     check_features :for => lambda { |c, f| driver.class.has_feature?(c, f) }
 
@@ -37,6 +39,8 @@ module Deltacloud::Collections
         param :snapshot_id, :string,  :optional
         param :capacity,    :string,  :optional
         param :realm_id,    :string,  :optional
+        param :name,        :string,  :optional
+        param :description, :string,  :optional
         control do
           @storage_volume = driver.create_storage_volume(credentials, params)
           status 201
diff --git a/server/lib/deltacloud/drivers/features.rb b/server/lib/deltacloud/drivers/features.rb
index 3e1b704..ca4e19a 100644
--- a/server/lib/deltacloud/drivers/features.rb
+++ b/server/lib/deltacloud/drivers/features.rb
@@ -163,6 +163,25 @@ module Deltacloud
         end
       end
 
+      feature :volume_name, :for => :storage_volumes do
+        description "Specify name when creating storage_volume"
+        operation :create do
+          param :name, :string, :optional
+        end
+      end
+
+      feature :volume_description, :for => :storage_volumes do
+        description "Specify description when creating storage_volume"
+        operation :create do
+          param :description, :string, :optional
+        end
+      end
+
+
+
+
+
+
     end
 
   end
diff --git a/server/lib/deltacloud/models/storage_volume.rb b/server/lib/deltacloud/models/storage_volume.rb
index 0722395..7aa00a9 100644
--- a/server/lib/deltacloud/models/storage_volume.rb
+++ b/server/lib/deltacloud/models/storage_volume.rb
@@ -26,5 +26,6 @@ class StorageVolume < BaseModel
   attr_accessor :actions
   attr_accessor :name
   attr_accessor :kind
+  attr_accessor :description # openstack volumes have a display_description attr
 
 end
-- 
1.7.11.7


Mime
View raw message