deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r1210412 - in /deltacloud/trunk/clients/cimi: app.rb lib/entities.rb lib/entities/volume.rb views/volumes/ views/volumes/index.haml views/volumes/show.haml
Date Mon, 05 Dec 2011 10:50:23 GMT
Author: mfojtik
Date: Mon Dec  5 10:50:23 2011
New Revision: 1210412

URL: http://svn.apache.org/viewvc?rev=1210412&view=rev
Log:
CIMI: Added volume support for new cimi client

Added:
    deltacloud/trunk/clients/cimi/lib/entities/volume.rb
      - copied, changed from r1210411, deltacloud/trunk/clients/cimi/lib/entities.rb
    deltacloud/trunk/clients/cimi/views/volumes/
    deltacloud/trunk/clients/cimi/views/volumes/index.haml
    deltacloud/trunk/clients/cimi/views/volumes/show.haml
Modified:
    deltacloud/trunk/clients/cimi/app.rb
    deltacloud/trunk/clients/cimi/lib/entities.rb

Modified: deltacloud/trunk/clients/cimi/app.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/app.rb?rev=1210412&r1=1210411&r2=1210412&view=diff
==============================================================================
--- deltacloud/trunk/clients/cimi/app.rb (original)
+++ deltacloud/trunk/clients/cimi/app.rb Mon Dec  5 10:50:23 2011
@@ -23,6 +23,7 @@ module CIMI::Frontend
     use CIMI::Frontend::MachineTemplate
     use CIMI::Frontend::VolumeConfiguration
     use CIMI::Frontend::VolumeImage
+    use CIMI::Frontend::Volume
 
     configure do
       enable :logging

Modified: deltacloud/trunk/clients/cimi/lib/entities.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/lib/entities.rb?rev=1210412&r1=1210411&r2=1210412&view=diff
==============================================================================
--- deltacloud/trunk/clients/cimi/lib/entities.rb (original)
+++ deltacloud/trunk/clients/cimi/lib/entities.rb Mon Dec  5 10:50:23 2011
@@ -26,3 +26,4 @@ require 'entities/machine'
 require 'entities/machine_template'
 require 'entities/volume_configuration'
 require 'entities/volume_image'
+require 'entities/volume'

Copied: deltacloud/trunk/clients/cimi/lib/entities/volume.rb (from r1210411, deltacloud/trunk/clients/cimi/lib/entities.rb)
URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/lib/entities/volume.rb?p2=deltacloud/trunk/clients/cimi/lib/entities/volume.rb&p1=deltacloud/trunk/clients/cimi/lib/entities.rb&r1=1210411&r2=1210412&rev=1210412&view=diff
==============================================================================
--- deltacloud/trunk/clients/cimi/lib/entities.rb (original)
+++ deltacloud/trunk/clients/cimi/lib/entities/volume.rb Mon Dec  5 10:50:23 2011
@@ -13,16 +13,18 @@
 # License for the specific language governing permissions and limitations
 # under the License.
 
-module CIMI
-  module Frontend
+class CIMI::Frontend::Volume < CIMI::Frontend::Entity
+
+  get '/cimi/volumes/:id' do
+    volume_xml = CIMI::Frontend.get_entity('volumes', params[:id], credentials)
+    @volume = CIMI::Model::Volume.from_xml(volume_xml)
+    haml :'volumes/show'
+  end
+
+  get '/cimi/volumes' do
+    volumes_xml = CIMI::Frontend.get_entity_collection('volumes', credentials)
+    @volumes = CIMI::Model::VolumeCollection.from_xml(volumes_xml)
+    haml :'volumes/index'
   end
-end
 
-require 'entities/base_entity'
-require 'entities/cloud_entry_point'
-require 'entities/machine_configuration'
-require 'entities/machine_image'
-require 'entities/machine'
-require 'entities/machine_template'
-require 'entities/volume_configuration'
-require 'entities/volume_image'
+end
\ No newline at end of file

Added: deltacloud/trunk/clients/cimi/views/volumes/index.haml
URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/views/volumes/index.haml?rev=1210412&view=auto
==============================================================================
--- deltacloud/trunk/clients/cimi/views/volumes/index.haml (added)
+++ deltacloud/trunk/clients/cimi/views/volumes/index.haml Mon Dec  5 10:50:23 2011
@@ -0,0 +1,21 @@
+- @title=@volumes.description
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li.active
+      VolumeCollection
+
+
+%blockquote
+  %p
+    A Volume Collection entity represents the collection of Volume
+    entities within a Provider. This entity can be used to locate and create
+    volumes.
+
+%ul
+  - @volumes.volumes.each do |volume|
+    %li
+      %a{ :href => "/cimi/volumes/#{volume.href.split('/').last}"}=volume.href.split('/').last

Added: deltacloud/trunk/clients/cimi/views/volumes/show.haml
URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/views/volumes/show.haml?rev=1210412&view=auto
==============================================================================
--- deltacloud/trunk/clients/cimi/views/volumes/show.haml (added)
+++ deltacloud/trunk/clients/cimi/views/volumes/show.haml Mon Dec  5 10:50:23 2011
@@ -0,0 +1,28 @@
+- @title="#{@volume.name}"
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li
+      %a{ :href => "/cimi/volumes"} VolumeCollection
+      %span.divider="/"
+    %li.active
+      = @volume.name
+
+%blockquote
+  %p
+    This entity represents a
+    volume Instance
+
+%dl
+  %dt URI
+  %dd
+    %a{ :href => @volume.uri }=@volume.uri
+  %dt Description
+  %dd=@volume.description
+  %dt Created
+  %dd #{@volume.created}&nbsp;
+  %dt Details
+  %dd=@volume.inspect
\ No newline at end of file



Mime
View raw message