You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2013/02/20 01:29:39 UTC

[3/3] git commit: CIMI client: display machine disks

Updated Branches:
  refs/heads/master db3c40f4b -> dde256ac9


CIMI client: display machine disks

Fix for https://issues.apache.org/jira/browse/DTACLOUD-404


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/dde256ac
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/dde256ac
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/dde256ac

Branch: refs/heads/master
Commit: dde256ac90ba2696e28b3feb86aba88915ed422d
Parents: 5ca2f0c
Author: NjeriChelimo <ma...@gmail.com>
Authored: Tue Jan 22 11:39:23 2013 +0300
Committer: David Lutterkort <lu...@redhat.com>
Committed: Tue Feb 19 16:00:58 2013 -0800

----------------------------------------------------------------------
 clients/cimi/app.rb                          |    4 +-
 clients/cimi/lib/entities/machine.rb         |   14 ++++++++
 clients/cimi/views/machines/disks/index.haml |   34 +++++++++++++++++++++
 clients/cimi/views/machines/show.haml        |    2 -
 4 files changed, 50 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/dde256ac/clients/cimi/app.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/app.rb b/clients/cimi/app.rb
index 9f29980..465ad90 100644
--- a/clients/cimi/app.rb
+++ b/clients/cimi/app.rb
@@ -22,6 +22,8 @@ module CIMI::Frontend
     use CIMI::Frontend::Address
     use CIMI::Frontend::AddressTemplate
     use CIMI::Frontend::CloudEntryPoint
+    use CIMI::Frontend::ForwardingGroup
+    use CIMI::Frontend::ForwardingGroupTemplate
     use CIMI::Frontend::MachineConfiguration
     use CIMI::Frontend::MachineImage
     use CIMI::Frontend::Machine
@@ -41,8 +43,6 @@ module CIMI::Frontend
     use CIMI::Frontend::VSP
     use CIMI::Frontend::VSPConfiguration
     use CIMI::Frontend::VSPTemplate
-    use CIMI::Frontend::ForwardingGroup
-    use CIMI::Frontend::ForwardingGroupTemplate
     use Rack::Session::Cookie
 
     helpers CIMI::Frontend::Helper

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/dde256ac/clients/cimi/lib/entities/machine.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/machine.rb b/clients/cimi/lib/entities/machine.rb
index 941f738..2708e4b 100644
--- a/clients/cimi/lib/entities/machine.rb
+++ b/clients/cimi/lib/entities/machine.rb
@@ -21,6 +21,20 @@ class CIMI::Frontend::Machine < CIMI::Frontend::Entity
     haml :'machines/show'
   end
 
+  get '/cimi/machines/:id/disks' do
+    machine_xml = get_entity('machines', params[:id], credentials)
+    @machine= CIMI::Model::Machine.from_xml(machine_xml)
+    @disks = @machine.disks
+    haml :'machines/disks/index'
+  end
+
+  get '/cimi/machines/:id/volumes' do
+    machine_xml = get_entity('machines', params[:id], credentials)
+    @machine= CIMI::Model::Machine.from_xml(machine_xml)
+    @volumes = @machine.volumes
+    haml :'volumes/index'
+  end
+
   get '/cimi/machines' do
     # We need to include this stuff for new Machine Form
     machine_image_xml = get_entity_collection('machine_images', credentials)

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/dde256ac/clients/cimi/views/machines/disks/index.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/machines/disks/index.haml b/clients/cimi/views/machines/disks/index.haml
new file mode 100644
index 0000000..b2dd41b
--- /dev/null
+++ b/clients/cimi/views/machines/disks/index.haml
@@ -0,0 +1,34 @@
+- @title=collection_name @disks
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li
+      %a{ :href => "/cimi/machines"} MachineCollection
+      %span.divider="/"
+    %li
+      %a{ :href => "/cimi/machines/:id"}= @machine.name
+      %span.divider="/"
+    %li.active
+      MachineDisksCollection
+
+- content_for :actions do
+  %p
+    %a{ :href => "#{@disks.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@disks.id}?format=json", :class => 'label warning' } JSON
+
+%ul
+  - @disks.disks.each do |disk|
+    %li
+      %a{ :href => "cimi/machines/#{href_to_id @machine.id}/disks/#{href_to_id(disk.id)}" }
+
+- if @disks.disks.empty?
+  .alert-message.block-message.warning
+    %p
+      There are no disks defined for this machine.
+
+-details do
+  -row 'ID', @disks.id
+  -row 'Count', @disks.count

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/dde256ac/clients/cimi/views/machines/show.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/machines/show.haml b/clients/cimi/views/machines/show.haml
index c7e5599..cc31f0c 100644
--- a/clients/cimi/views/machines/show.haml
+++ b/clients/cimi/views/machines/show.haml
@@ -42,7 +42,6 @@
   -row 'Disks', url("/cimi/machines/#{href_to_id @machine.id}/disks")
   -row 'Volumes', url("/cimi/machines/#{href_to_id @machine.id}/volumes")
 
-
 %h5 Properties
 %table{ :class => 'table table-bordered table-striped' }
   %thead
@@ -55,4 +54,3 @@
         %td
           %code=name
         %td=convert_urls value
-