deltacloud-commits mailing list archives

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

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

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

Copied: deltacloud/trunk/clients/cimi/lib/entities/machine_template.rb (from r1210408, deltacloud/trunk/clients/cimi/lib/entities.rb)
URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/lib/entities/machine_template.rb?p2=deltacloud/trunk/clients/cimi/lib/entities/machine_template.rb&p1=deltacloud/trunk/clients/cimi/lib/entities.rb&r1=1210408&r2=1210409&rev=1210409&view=diff
==============================================================================
--- deltacloud/trunk/clients/cimi/lib/entities.rb (original)
+++ deltacloud/trunk/clients/cimi/lib/entities/machine_template.rb Mon Dec  5 10:49:35 2011
@@ -13,13 +13,18 @@
 # License for the specific language governing permissions and limitations
 # under the License.
 
-module CIMI
-  module Frontend
+class CIMI::Frontend::MachineTemplate < CIMI::Frontend::Entity
+
+  get '/cimi/machine_templates/:id' do
+    machine_templates_xml = CIMI::Frontend.get_entity('machine_templates', params[:id], credentials)
+    @machine_template = CIMI::Model::MachineTemplate.from_xml(machine_templates_xml)
+    haml :'machine_templates/show'
+  end
+
+  get '/cimi/machine_templates' do
+    machine_template_xml = CIMI::Frontend.get_entity_collection('machine_templates', credentials)
+    @machine_templates = CIMI::Model::MachineTemplateCollection.from_xml(machine_template_xml)
+    haml :'machine_templates/index'
   end
-end
 
-require 'entities/base_entity'
-require 'entities/cloud_entry_point'
-require 'entities/machine_configuration'
-require 'entities/machine_image'
-require 'entities/machine'
\ No newline at end of file
+end
\ No newline at end of file

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

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



Mime
View raw message