deltacloud-commits mailing list archives

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

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

Added:
    deltacloud/trunk/clients/cimi/lib/entities/volume_image.rb
      - copied, changed from r1210410, deltacloud/trunk/clients/cimi/lib/entities.rb
    deltacloud/trunk/clients/cimi/views/volume_images/
    deltacloud/trunk/clients/cimi/views/volume_images/index.haml
    deltacloud/trunk/clients/cimi/views/volume_images/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=1210411&r1=1210410&r2=1210411&view=diff
==============================================================================
--- deltacloud/trunk/clients/cimi/app.rb (original)
+++ deltacloud/trunk/clients/cimi/app.rb Mon Dec  5 10:50:06 2011
@@ -22,6 +22,7 @@ module CIMI::Frontend
     use CIMI::Frontend::Machine
     use CIMI::Frontend::MachineTemplate
     use CIMI::Frontend::VolumeConfiguration
+    use CIMI::Frontend::VolumeImage
 
     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=1210411&r1=1210410&r2=1210411&view=diff
==============================================================================
--- deltacloud/trunk/clients/cimi/lib/entities.rb (original)
+++ deltacloud/trunk/clients/cimi/lib/entities.rb Mon Dec  5 10:50:06 2011
@@ -24,4 +24,5 @@ require 'entities/machine_configuration'
 require 'entities/machine_image'
 require 'entities/machine'
 require 'entities/machine_template'
-require 'entities/volume_configuration'
\ No newline at end of file
+require 'entities/volume_configuration'
+require 'entities/volume_image'

Copied: deltacloud/trunk/clients/cimi/lib/entities/volume_image.rb (from r1210410, deltacloud/trunk/clients/cimi/lib/entities.rb)
URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/lib/entities/volume_image.rb?p2=deltacloud/trunk/clients/cimi/lib/entities/volume_image.rb&p1=deltacloud/trunk/clients/cimi/lib/entities.rb&r1=1210410&r2=1210411&rev=1210411&view=diff
==============================================================================
--- deltacloud/trunk/clients/cimi/lib/entities.rb (original)
+++ deltacloud/trunk/clients/cimi/lib/entities/volume_image.rb Mon Dec  5 10:50:06 2011
@@ -13,15 +13,18 @@
 # License for the specific language governing permissions and limitations
 # under the License.
 
-module CIMI
-  module Frontend
+class CIMI::Frontend::VolumeImage < CIMI::Frontend::Entity
+
+  get '/cimi/volume_images/:id' do
+    volume_image_xml = CIMI::Frontend.get_entity('volume_images', params[:id], credentials)
+    @volume_image= CIMI::Model::VolumeImage.from_xml(volume_image_xml)
+    haml :'volume_images/show'
+  end
+
+  get '/cimi/volume_images' do
+    volume_images_xml = CIMI::Frontend.get_entity_collection('volume_images', credentials)
+    @volume_images = CIMI::Model::VolumeImageCollection.from_xml(volume_images_xml)
+    haml :'volume_images/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'
\ No newline at end of file
+end
\ No newline at end of file

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

Added: deltacloud/trunk/clients/cimi/views/volume_images/show.haml
URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/views/volume_images/show.haml?rev=1210411&view=auto
==============================================================================
--- deltacloud/trunk/clients/cimi/views/volume_images/show.haml (added)
+++ deltacloud/trunk/clients/cimi/views/volume_images/show.haml Mon Dec  5 10:50:06 2011
@@ -0,0 +1,28 @@
+- @title="#{@volume_image.name}"
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li
+      %a{ :href => "/cimi/volume_images"} VolumeImageCollection
+      %span.divider="/"
+    %li.active
+      = @volume_image.name
+
+%blockquote
+  %p
+    This entity represents the information necessary for hardware virtualized
+    resources to create a Volume Instance
+
+%dl
+  %dt URI
+  %dd
+    %a{ :href => @volume_image.uri }=@volume_image.uri
+  %dt Description
+  %dd=@volume_image.description
+  %dt Created
+  %dd=@volume_image.created
+  %dt Details
+  %dd=@volume_image.inspect
\ No newline at end of file



Mime
View raw message