deltacloud-commits mailing list archives

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

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

Added:
    deltacloud/trunk/clients/cimi/lib/entities/machine.rb
      - copied, changed from r1210402, deltacloud/trunk/clients/cimi/lib/entities.rb
    deltacloud/trunk/clients/cimi/views/machines/
    deltacloud/trunk/clients/cimi/views/machines/index.haml
    deltacloud/trunk/clients/cimi/views/machines/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=1210408&r1=1210407&r2=1210408&view=diff
==============================================================================
--- deltacloud/trunk/clients/cimi/app.rb (original)
+++ deltacloud/trunk/clients/cimi/app.rb Mon Dec  5 10:49:20 2011
@@ -19,6 +19,7 @@ module CIMI::Frontend
     use CIMI::Frontend::CloudEntryPoint
     use CIMI::Frontend::MachineConfiguration
     use CIMI::Frontend::MachineImage
+    use CIMI::Frontend::Machine
 
     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=1210408&r1=1210407&r2=1210408&view=diff
==============================================================================
--- deltacloud/trunk/clients/cimi/lib/entities.rb (original)
+++ deltacloud/trunk/clients/cimi/lib/entities.rb Mon Dec  5 10:49:20 2011
@@ -22,3 +22,4 @@ 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

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

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

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



Mime
View raw message