deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r1210410 - in /deltacloud/trunk/clients/cimi: app.rb lib/entities.rb lib/entities/volume_configuration.rb views/volume_configurations/ views/volume_configurations/index.haml views/volume_configurations/show.haml
Date Mon, 05 Dec 2011 10:49:51 GMT
Author: mfojtik
Date: Mon Dec  5 10:49:51 2011
New Revision: 1210410

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

Added:
    deltacloud/trunk/clients/cimi/lib/entities/volume_configuration.rb
      - copied, changed from r1210409, deltacloud/trunk/clients/cimi/lib/entities.rb
    deltacloud/trunk/clients/cimi/views/volume_configurations/
    deltacloud/trunk/clients/cimi/views/volume_configurations/index.haml
    deltacloud/trunk/clients/cimi/views/volume_configurations/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=1210410&r1=1210409&r2=1210410&view=diff
==============================================================================
--- deltacloud/trunk/clients/cimi/app.rb (original)
+++ deltacloud/trunk/clients/cimi/app.rb Mon Dec  5 10:49:51 2011
@@ -21,6 +21,7 @@ module CIMI::Frontend
     use CIMI::Frontend::MachineImage
     use CIMI::Frontend::Machine
     use CIMI::Frontend::MachineTemplate
+    use CIMI::Frontend::VolumeConfiguration
 
     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=1210410&r1=1210409&r2=1210410&view=diff
==============================================================================
--- deltacloud/trunk/clients/cimi/lib/entities.rb (original)
+++ deltacloud/trunk/clients/cimi/lib/entities.rb Mon Dec  5 10:49:51 2011
@@ -23,4 +23,5 @@ require 'entities/cloud_entry_point'
 require 'entities/machine_configuration'
 require 'entities/machine_image'
 require 'entities/machine'
-require 'entities/machine_template'
\ No newline at end of file
+require 'entities/machine_template'
+require 'entities/volume_configuration'
\ No newline at end of file

Copied: deltacloud/trunk/clients/cimi/lib/entities/volume_configuration.rb (from r1210409,
deltacloud/trunk/clients/cimi/lib/entities.rb)
URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/lib/entities/volume_configuration.rb?p2=deltacloud/trunk/clients/cimi/lib/entities/volume_configuration.rb&p1=deltacloud/trunk/clients/cimi/lib/entities.rb&r1=1210409&r2=1210410&rev=1210410&view=diff
==============================================================================
--- deltacloud/trunk/clients/cimi/lib/entities.rb (original)
+++ deltacloud/trunk/clients/cimi/lib/entities/volume_configuration.rb Mon Dec  5 10:49:51
2011
@@ -13,14 +13,18 @@
 # License for the specific language governing permissions and limitations
 # under the License.
 
-module CIMI
-  module Frontend
+class CIMI::Frontend::VolumeConfiguration < CIMI::Frontend::Entity
+
+  get '/cimi/volume_configurations/:id' do
+    volume_confs_xml = CIMI::Frontend.get_entity('volume_configurations', params[:id], credentials)
+    @volume_configuration = CIMI::Model::VolumeConfiguration.from_xml(volume_confs_xml)
+    haml :'volume_configurations/show'
   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'
\ No newline at end of file
+  get '/cimi/volume_configurations' do
+    volume_conf_xml = CIMI::Frontend.get_entity_collection('volume_configurations', credentials)
+    @volume_configurations = CIMI::Model::VolumeConfigurationCollection.from_xml(volume_conf_xml)
+    haml :'volume_configurations/index'
+  end
+
+end

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

Added: deltacloud/trunk/clients/cimi/views/volume_configurations/show.haml
URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/views/volume_configurations/show.haml?rev=1210410&view=auto
==============================================================================
--- deltacloud/trunk/clients/cimi/views/volume_configurations/show.haml (added)
+++ deltacloud/trunk/clients/cimi/views/volume_configurations/show.haml Mon Dec  5 10:49:51
2011
@@ -0,0 +1,30 @@
+- @title="#{@volume_configuration.name}"
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li
+      %a{ :href => "/cimi/volume_configurations"} VolumeConfigurationCollection
+      %span.divider="/"
+    %li.active
+      = @volume_configuration.name
+
+%blockquote
+  %p
+    The Volume Configuration entity represents the set of configuration values
+    that define the (virtual) hardware resources of a to-be-realized Volume
+    Instance. Volume Configurations are created by Providers and MAY, at the
+    Providers discretion, be created by Consumers.
+
+%dl
+  %dt URI
+  %dd
+    %a{ :href => @volume_configuration.uri }=@volume_configuration.uri
+  %dt Description
+  %dd=@volume_configuration.description
+  %dt Created
+  %dd #{@volume_configuration.created}&nbsp;
+  %dt Details
+  %dd=@volume_configuration.inspect
\ No newline at end of file



Mime
View raw message