You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by ma...@apache.org on 2012/12/10 13:42:52 UTC
[3/4] git commit: Add features and attributes for Openstack block
storage volumes
Add features and attributes for Openstack block storage volumes
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/67c9f078
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/67c9f078
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/67c9f078
Branch: refs/heads/master
Commit: 67c9f07825b7ebfdcd0592f5dde6c2446553502e
Parents: edcd987
Author: marios <ma...@redhat.com>
Authored: Mon Nov 19 12:52:13 2012 +0200
Committer: marios <ma...@redhat.com>
Committed: Mon Dec 10 14:38:24 2012 +0200
----------------------------------------------------------------------
.../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(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/67c9f078/server/lib/deltacloud/collections/storage_volumes.rb
----------------------------------------------------------------------
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
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/67c9f078/server/lib/deltacloud/drivers/features.rb
----------------------------------------------------------------------
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
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/67c9f078/server/lib/deltacloud/models/storage_volume.rb
----------------------------------------------------------------------
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