You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by ma...@redhat.com on 2012/03/12 18:14:33 UTC

Updates CIMI Client views

Cosmetic changes (views) for CIMI client app - updates 'uri' to 'id', and tabular output

[PATCH 3/3] Minor change to mock_driver cimi url conversion (.uri/.id)

Posted by ma...@redhat.com.
From: marios <ma...@redhat.com>


Signed-off-by: marios <ma...@redhat.com>
---
 server/lib/deltacloud/drivers/mock/mock_driver.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/server/lib/deltacloud/drivers/mock/mock_driver.rb b/server/lib/deltacloud/drivers/mock/mock_driver.rb
index 86e096e..1725538 100644
--- a/server/lib/deltacloud/drivers/mock/mock_driver.rb
+++ b/server/lib/deltacloud/drivers/mock/mock_driver.rb
@@ -513,7 +513,7 @@ module Deltacloud::Drivers::Mock
 
     def convert_cimi_mock_urls(model_name, cimi_object, context)
       uri=context.send(:"#{model_name}_url", cimi_object.name)
-      cimi_object.uri=uri
+      cimi_object.id=uri
       cimi_object.operations.each{|op| op.href=uri}
       cimi_object
     end
-- 
1.7.6.5


[PATCH 1/3] CIMI :: change references in views from 'uri' to 'id'

Posted by ma...@redhat.com.
From: marios <ma...@redhat.com>


Signed-off-by: marios <ma...@redhat.com>
---
 clients/cimi/views/cloud_entry_point/index.haml    |    6 +++---
 clients/cimi/views/machine_admins/index.haml       |    8 ++++----
 clients/cimi/views/machine_admins/show.haml        |    6 +++---
 .../cimi/views/machine_configurations/index.haml   |    8 ++++----
 .../cimi/views/machine_configurations/show.haml    |    6 +++---
 clients/cimi/views/machine_images/index.haml       |    8 ++++----
 clients/cimi/views/machine_images/show.haml        |    6 +++---
 clients/cimi/views/machine_templates/index.haml    |    4 ++--
 clients/cimi/views/machine_templates/show.haml     |    6 +++---
 clients/cimi/views/machines/index.haml             |    8 ++++----
 clients/cimi/views/machines/show.haml              |    6 +++---
 .../cimi/views/network_configurations/index.haml   |    8 ++++----
 .../cimi/views/network_configurations/show.haml    |    8 ++++----
 clients/cimi/views/networks/index.haml             |    8 ++++----
 clients/cimi/views/networks/show.haml              |    8 ++++----
 .../cimi/views/volume_configurations/index.haml    |    4 ++--
 clients/cimi/views/volume_configurations/show.haml |    8 ++++----
 clients/cimi/views/volume_images/index.haml        |    8 ++++----
 clients/cimi/views/volume_images/show.haml         |    8 ++++----
 clients/cimi/views/volumes/index.haml              |    6 +++---
 clients/cimi/views/volumes/show.haml               |    6 +++---
 21 files changed, 72 insertions(+), 72 deletions(-)

diff --git a/clients/cimi/views/cloud_entry_point/index.haml b/clients/cimi/views/cloud_entry_point/index.haml
index 189c71a..9621bc8 100644
--- a/clients/cimi/views/cloud_entry_point/index.haml
+++ b/clients/cimi/views/cloud_entry_point/index.haml
@@ -7,8 +7,8 @@
 
 - content_for :actions do
   %p
-    %a{ :href => "#{@entry_point.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@entry_point.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@entry_point.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@entry_point.id}?format=json", :class => 'label warning' } JSON
 
 %blockquote
   %p
@@ -25,6 +25,6 @@
         =not_implemented(entity)
 
 - details('Collection details') do
-  - row 'URI', @entry_point.uri
+  - row 'ID', @entry_point.id
   - row 'Description', @entry_point.description
   - row 'Created', @entry_point.created
diff --git a/clients/cimi/views/machine_admins/index.haml b/clients/cimi/views/machine_admins/index.haml
index a8bab3c..3b0e1ae 100644
--- a/clients/cimi/views/machine_admins/index.haml
+++ b/clients/cimi/views/machine_admins/index.haml
@@ -10,8 +10,8 @@
 
 - content_for :actions do
   %p
-    %a{ :href => "#{@machine_admins.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@machine_admins.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@machine_admins.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@machine_admins.id}?format=json", :class => 'label warning' } JSON
   %p
     %a{ :href => '#adminModal', :class => 'btn btn-primary', :'data-toggle' => :modal } New Machine Admin
 
@@ -36,7 +36,7 @@
       %a{ :href => '#', :class => 'btn', :'data-dismiss' => 'modal'} Cancel
 
 %blockquote
-  %p 
+  %p
     A Machine Admin Collection entity represents the collection of Machine Admin
     entities within a Provider. This entity can be used to locate and create
     MachineAdmins.
@@ -49,6 +49,6 @@
       %a{ :href => "/cimi/machine_admins/#{conf.href.split('/').last}"}=conf.href.split('/').last
 
 - details 'Collection details' do
-  - row 'URI', @machine_admins.uri
+  - row 'ID', @machine_admins.id
   - row 'Description', @machine_admins.description
   - row 'Created', @machine_admins.created
diff --git a/clients/cimi/views/machine_admins/show.haml b/clients/cimi/views/machine_admins/show.haml
index abf8e88..2e95ea7 100644
--- a/clients/cimi/views/machine_admins/show.haml
+++ b/clients/cimi/views/machine_admins/show.haml
@@ -13,8 +13,8 @@
 
 - content_for :actions do
   %p
-    %a{ :href => "#{@machine_admin.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@machine_admin.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@machine_admin.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@machine_admin.id}?format=json", :class => 'label warning' } JSON
   %p
     %form{ :action => "/cimi/machine_admins/#{@machine_admin.name}/delete", :method => :post, :style => 'display:inline'}
       %input{ :type => :hidden, :name => '_method', :value => 'delete'}
@@ -26,7 +26,7 @@
     initial administrative super- user of a newly created Machine
 
 - details 'MachineAdmin Details' do
-  - row 'URI', @machine_admin.uri
+  - row 'ID', @machine_admin.id
   - row 'Description', @machine_admin.description
   - row 'Created', @machine_admin.created
   - row 'Username', boolean_span_for(@machine_admin.username)
diff --git a/clients/cimi/views/machine_configurations/index.haml b/clients/cimi/views/machine_configurations/index.haml
index 0f9e8b3..01d194d 100644
--- a/clients/cimi/views/machine_configurations/index.haml
+++ b/clients/cimi/views/machine_configurations/index.haml
@@ -10,11 +10,11 @@
 
 - content_for :actions do
   %p
-    %a{ :href => "#{@machine_configurations.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@machine_configurations.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@machine_configurations.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@machine_configurations.id}?format=json", :class => 'label warning' } JSON
 
 %blockquote
-  %p 
+  %p
     A Machine Configuration Collection entity represents the collection of
     Machine Configuration entities within a Provider. This entity can be used to
     locate and create Machine Configurations.
@@ -26,6 +26,6 @@
       %a{ :href => "/cimi/machine_configurations/#{conf.href.split('/').last}"}=conf.href.split('/').last
 
 - details('Collection details') do
-  - row 'URI', @machine_configurations.uri
+  - row 'ID', @machine_configurations.id
   - row 'Description', @machine_configurations.description
   - row 'Created', @machine_configurations.created
diff --git a/clients/cimi/views/machine_configurations/show.haml b/clients/cimi/views/machine_configurations/show.haml
index 7eff926..6484123 100644
--- a/clients/cimi/views/machine_configurations/show.haml
+++ b/clients/cimi/views/machine_configurations/show.haml
@@ -13,8 +13,8 @@
 
 - content_for :actions do
   %p
-    %a{ :href => "#{@machine_configuration.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@machine_configuration.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@machine_configuration.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@machine_configuration.id}?format=json", :class => 'label warning' } JSON
 
 %blockquote
   %p
@@ -24,7 +24,7 @@
     Providers discretion, be created by Consumers.
 
 - details('MachineConfiguration details') do
-  - row 'URI', @machine_configuration.uri
+  - row 'ID', @machine_configuration.id
   - row 'Description', @machine_configuration.description
   - row 'Created', @machine_configuration.created
   - row '# of CPU', @machine_configuration.cpu
diff --git a/clients/cimi/views/machine_images/index.haml b/clients/cimi/views/machine_images/index.haml
index defad9a..af4da79 100644
--- a/clients/cimi/views/machine_images/index.haml
+++ b/clients/cimi/views/machine_images/index.haml
@@ -10,11 +10,11 @@
 
 - content_for :actions do
   %p
-    %a{ :href => "#{@machine_images.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@machine_images.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@machine_images.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@machine_images.id}?format=json", :class => 'label warning' } JSON
 
 %blockquote
-  %p 
+  %p
     A Machine Image Collection entity represents the collection of Machine Image
     entities within a Provider. This entity can be used to locate and create
     Machine Images.
@@ -26,6 +26,6 @@
       %a{ :href => "/cimi/machine_images/#{image.href.split('/').last}"}=image.href.split('/').last
 
 - details('Collection details') do
-  - row 'URI', @machine_images.uri
+  - row 'ID', @machine_images.id
   - row 'Description', @machine_images.description
   - row 'Created', @machine_images.created
diff --git a/clients/cimi/views/machine_images/show.haml b/clients/cimi/views/machine_images/show.haml
index af5ba91..0dfda3f 100644
--- a/clients/cimi/views/machine_images/show.haml
+++ b/clients/cimi/views/machine_images/show.haml
@@ -13,8 +13,8 @@
 
 - content_for :actions do
   %p
-    %a{ :href => "#{@machine_image.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@machine_image.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@machine_image.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@machine_image.id}?format=json", :class => 'label warning' } JSON
 
 %blockquote
   %p
@@ -23,7 +23,7 @@
     Machine Instance
 
 - details 'MachineImage details' do
-  - row 'URI', @machine_image.uri
+  - row 'ID', @machine_image.id
   - row 'Description', @machine_image.description
   - row 'Created', @machine_image.created
   - row 'Image Location', @machine_image.image_location.href
diff --git a/clients/cimi/views/machine_templates/index.haml b/clients/cimi/views/machine_templates/index.haml
index 2a285f1..cb14ac0 100644
--- a/clients/cimi/views/machine_templates/index.haml
+++ b/clients/cimi/views/machine_templates/index.haml
@@ -23,8 +23,8 @@
 %h3 Collection details
 
 %dl
-  %dt URI
-  %dd=@machine_templates.uri
+  %dt id
+  %dd=@machine_templates.id
   %dt Description
   %dd=@machine_templates.description
   %dt Created
diff --git a/clients/cimi/views/machine_templates/show.haml b/clients/cimi/views/machine_templates/show.haml
index 9386437..1bfe803 100644
--- a/clients/cimi/views/machine_templates/show.haml
+++ b/clients/cimi/views/machine_templates/show.haml
@@ -19,10 +19,10 @@
     Providers discretion, be created by Consumers.
 
 %dl
-  %dt URI
+  %dt id
   %dd
-    %a{ :href => @machine_template.uri }=@machine_template.uri
+    %a{ :href => @machine_template.id }=@machine_template.id
   %dt Description
   %dd=@machine_template.description
   %dt Created
-  %dd #{@machine_template.created}&nbsp;
\ No newline at end of file
+  %dd #{@machine_template.created}&nbsp;
diff --git a/clients/cimi/views/machines/index.haml b/clients/cimi/views/machines/index.haml
index 735bd2c..ba9212c 100644
--- a/clients/cimi/views/machines/index.haml
+++ b/clients/cimi/views/machines/index.haml
@@ -10,10 +10,10 @@
 
 - content_for :actions do
   %p
-    %a{ :href => "#{@machines.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@machines.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@machines.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@machines.id}?format=json", :class => 'label warning' } JSON
   %p
-    %a{ :href => '#machineModal', :class => 'btn btn-primary', :'data-toggle' => :modal} New Machine 
+    %a{ :href => '#machineModal', :class => 'btn btn-primary', :'data-toggle' => :modal} New Machine
 
   %div{ :id => :machineModal, :class => 'modal hide fade' }
     .modal-header
@@ -67,6 +67,6 @@
 
 
 - details('Collection details') do
-  - row 'URI', @machines.uri
+  - row 'ID', @machines.id
   - row 'Description', @machines.description
   - row 'Created', @machines.created
diff --git a/clients/cimi/views/machines/show.haml b/clients/cimi/views/machines/show.haml
index 26deb9e..24f86d8 100644
--- a/clients/cimi/views/machines/show.haml
+++ b/clients/cimi/views/machines/show.haml
@@ -13,8 +13,8 @@
 
 - content_for :actions do
   %p
-    %a{ :href => "#{@machine.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@machine.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@machine.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@machine.id}?format=json", :class => 'label warning' } JSON
   %p
     - if @machine.state == 'STARTED'
       %form{ :action => "/cimi/machines/#{@machine.name}/stop", :method => :post, :style => 'display:inline'}
@@ -35,7 +35,7 @@
     %tr
       %th ID
       %td
-        %a{ :href => @machine.uri }=@machine.uri
+        %a{ :href => @machine.id }=@machine.id
     %tr
       %th Description
       %td=@machine.description
diff --git a/clients/cimi/views/network_configurations/index.haml b/clients/cimi/views/network_configurations/index.haml
index 155baca..9b7a370 100644
--- a/clients/cimi/views/network_configurations/index.haml
+++ b/clients/cimi/views/network_configurations/index.haml
@@ -9,8 +9,8 @@
       NetworkConfigurationCollection
 - content_for :actions do
   %p
-    %a{ :href => "#{@network_configs.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@network_configs.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@network_configs.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@network_configs.id}?format=json", :class => 'label warning' } JSON
 
 %blockquote
   %p
@@ -26,8 +26,8 @@
 %h3 Collection details
 
 %dl
-  %dt URI
-  %dd=@network_configs.uri
+  %dt id
+  %dd=@network_configs.id
   %dt Description
   %dd=@network_configs.description
   %dt Created
diff --git a/clients/cimi/views/network_configurations/show.haml b/clients/cimi/views/network_configurations/show.haml
index 676ee9c..e35952e 100644
--- a/clients/cimi/views/network_configurations/show.haml
+++ b/clients/cimi/views/network_configurations/show.haml
@@ -13,8 +13,8 @@
 
 - content_for :actions do
   %p
-    %a{ :href => "#{@network_config.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@network_config.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@network_config.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@network_config.id}?format=json", :class => 'label warning' } JSON
 
 %blockquote
   %p
@@ -22,9 +22,9 @@
     the information needed to create a Network with certain characteristics.
 
 %dl
-  %dt URI
+  %dt id
   %dd
-    %a{ :href => @network_config.uri }=@network_config.uri
+    %a{ :href => @network_config.id }=@network_config.id
   %dt Description
   %dd=@network_config.description
   %dt Created
diff --git a/clients/cimi/views/networks/index.haml b/clients/cimi/views/networks/index.haml
index 699ebf8..75d80ee 100644
--- a/clients/cimi/views/networks/index.haml
+++ b/clients/cimi/views/networks/index.haml
@@ -10,8 +10,8 @@
 
 - content_for :actions do
   %p
-    %a{ :href => "#{@networks.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@networks.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@networks.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@networks.id}?format=json", :class => 'label warning' } JSON
 
 %blockquote
   %p
@@ -26,8 +26,8 @@
 %h3 Collection details
 
 %dl
-  %dt URI
-  %dd=@networks.uri
+  %dt id
+  %dd=@networks.id
   %dt Description
   %dd=@networks.description
   %dt Created
diff --git a/clients/cimi/views/networks/show.haml b/clients/cimi/views/networks/show.haml
index 111254a..44bca74 100644
--- a/clients/cimi/views/networks/show.haml
+++ b/clients/cimi/views/networks/show.haml
@@ -13,8 +13,8 @@
 
 - content_for :actions do
   %p
-    %a{ :href => "#{@network.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@network.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@network.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@network.id}?format=json", :class => 'label warning' } JSON
 
 %blockquote
   %p
@@ -22,9 +22,9 @@
     that represents an abstraction of a layer 2 broadcast domain.
 
 %dl
-  %dt URI
+  %dt id
   %dd
-    %a{ :href => @network.uri }=@network.uri
+    %a{ :href => @network.id }=@network.id
   %dt Description
   %dd=@network.description
   %dt Created
diff --git a/clients/cimi/views/volume_configurations/index.haml b/clients/cimi/views/volume_configurations/index.haml
index 88ed9c8..71af308 100644
--- a/clients/cimi/views/volume_configurations/index.haml
+++ b/clients/cimi/views/volume_configurations/index.haml
@@ -9,8 +9,8 @@
       VolumeConfigurationCollection
 - content_for :actions do
   %p
-    %a{ :href => "#{@volume_configurations.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@volume_configurations.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@volume_configurations.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@volume_configurations.id}?format=json", :class => 'label warning' } JSON
 
 %blockquote
   %p
diff --git a/clients/cimi/views/volume_configurations/show.haml b/clients/cimi/views/volume_configurations/show.haml
index 1e55473..2465423 100644
--- a/clients/cimi/views/volume_configurations/show.haml
+++ b/clients/cimi/views/volume_configurations/show.haml
@@ -13,8 +13,8 @@
 
 - content_for :actions do
   %p
-    %a{ :href => "#{@volume_configuration.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@volume_configuration.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@volume_configuration.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@volume_configuration.id}?format=json", :class => 'label warning' } JSON
 
 %blockquote
   %p
@@ -24,9 +24,9 @@
     Providers discretion, be created by Consumers.
 
 %dl
-  %dt URI
+  %dt id
   %dd
-    %a{ :href => @volume_configuration.uri }=@volume_configuration.uri
+    %a{ :href => @volume_configuration.id }=@volume_configuration.id
   %dt Description
   %dd=@volume_configuration.description
   %dt Created
diff --git a/clients/cimi/views/volume_images/index.haml b/clients/cimi/views/volume_images/index.haml
index 2fb5826..8a36205 100644
--- a/clients/cimi/views/volume_images/index.haml
+++ b/clients/cimi/views/volume_images/index.haml
@@ -10,8 +10,8 @@
 
 - content_for :actions do
   %p
-    %a{ :href => "#{@volume_images.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@volume_images.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@volume_images.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@volume_images.id}?format=json", :class => 'label warning' } JSON
 
 %blockquote
   %p
@@ -27,8 +27,8 @@
 %h3 Collection details
 
 %dl
-  %dt URI
-  %dd=@volume_images.uri
+  %dt id
+  %dd=@volume_images.id
   %dt Description
   %dd=@volume_images.description
   %dt Created
diff --git a/clients/cimi/views/volume_images/show.haml b/clients/cimi/views/volume_images/show.haml
index f76bf5e..d0257d7 100644
--- a/clients/cimi/views/volume_images/show.haml
+++ b/clients/cimi/views/volume_images/show.haml
@@ -13,8 +13,8 @@
 
 - content_for :actions do
   %p
-    %a{ :href => "#{@volume_image.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@volume_image.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@volume_image.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@volume_image.id}?format=json", :class => 'label warning' } JSON
 
 %blockquote
   %p
@@ -22,9 +22,9 @@
     resources to create a Volume Instance
 
 %dl
-  %dt URI
+  %dt id
   %dd
-    %a{ :href => @volume_image.uri }=@volume_image.uri
+    %a{ :href => @volume_image.id }=@volume_image.id
   %dt Description
   %dd=@volume_image.description
   %dt Created
diff --git a/clients/cimi/views/volumes/index.haml b/clients/cimi/views/volumes/index.haml
index 08a5cc1..dc1b631 100644
--- a/clients/cimi/views/volumes/index.haml
+++ b/clients/cimi/views/volumes/index.haml
@@ -10,8 +10,8 @@
 
 - content_for :actions do
   %p
-    %a{ :href => "#{@volumes.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@volumes.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@volumes.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@volumes.id}?format=json", :class => 'label warning' } JSON
 
 %blockquote
   %p
@@ -26,7 +26,7 @@
       %a{ :href => "/cimi/volumes/#{volume.href.split('/').last}"}=volume.href.split('/').last
 
 - details 'Collection details' do
-  - row 'URI', @volumes.uri
+  - row 'ID', @volumes.id
   - row 'Description', @volumes.description
   - row 'Created', @volumes.created
 
diff --git a/clients/cimi/views/volumes/show.haml b/clients/cimi/views/volumes/show.haml
index ae477db..9046402 100644
--- a/clients/cimi/views/volumes/show.haml
+++ b/clients/cimi/views/volumes/show.haml
@@ -13,15 +13,15 @@
 
 - content_for :actions do
   %p
-    %a{ :href => "#{@volume.uri}?format=xml", :class => 'label warning' } XML
-    %a{ :href => "#{@volume.uri}?format=json", :class => 'label warning' } JSON
+    %a{ :href => "#{@volume.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@volume.id}?format=json", :class => 'label warning' } JSON
 
 %blockquote
   %p
     This entity represents a volume Instance
 
 - details 'Volume details' do
-  - row 'URI', @volume.uri
+  - row 'ID', @volume.id
   - row 'Description', @volume.description
   - row 'Created', @volume.created
   - row 'Bootable?', boolean_span_for(@volume.bootable)
-- 
1.7.6.5


Re: Updates CIMI Client views

Posted by Michal Fojtik <mf...@redhat.com>.
ACK. 

-- 
Michal Fojtik
Red Hat Inc.


On Monday, March 12, 2012 at 6:14 PM, marios@redhat.com wrote:

> 
> Cosmetic changes (views) for CIMI client app - updates 'uri' to 'id', and tabular output 



[PATCH 2/3] CIMI Client - updated views to use the new 'row' and 'details' helpers - tabular views

Posted by ma...@redhat.com.
From: marios <ma...@redhat.com>


Signed-off-by: marios <ma...@redhat.com>
---
 clients/cimi/views/machine_templates/index.haml    |   14 ++----
 clients/cimi/views/machine_templates/show.haml     |   12 ++---
 clients/cimi/views/machines/show.haml              |   46 +++++--------------
 .../cimi/views/network_configurations/index.haml   |   14 ++----
 .../cimi/views/network_configurations/show.haml    |   30 ++++---------
 clients/cimi/views/networks/index.haml             |   14 ++----
 clients/cimi/views/networks/show.haml              |   33 +++++---------
 .../cimi/views/volume_configurations/index.haml    |    6 +++
 clients/cimi/views/volume_configurations/show.haml |   26 ++++-------
 clients/cimi/views/volume_images/index.haml        |   12 ++---
 clients/cimi/views/volume_images/show.haml         |   23 +++------
 clients/cimi/views/volumes/index.haml              |    2 +-
 12 files changed, 80 insertions(+), 152 deletions(-)

diff --git a/clients/cimi/views/machine_templates/index.haml b/clients/cimi/views/machine_templates/index.haml
index cb14ac0..3daff47 100644
--- a/clients/cimi/views/machine_templates/index.haml
+++ b/clients/cimi/views/machine_templates/index.haml
@@ -15,17 +15,13 @@
     Machine Template entities within a Provider. This entity can be used to
     locate and create Machine Templates.
 
+%h3 MachineTemplateCollection
 %ul
   - @machine_templates.machine_templates.each do |temp|
     %li
       %a{ :href => "/cimi/machine_templates/#{temp.href.split('/').last}"}=temp.href.split('/').last
 
-%h3 Collection details
-
-%dl
-  %dt id
-  %dd=@machine_templates.id
-  %dt Description
-  %dd=@machine_templates.description
-  %dt Created
-  %dd=@machine_templates.created
+-details 'MachineTemplateCollection details' do
+  -row 'id',@machine_templates.id
+  -row 'Description',@machine_templates.description
+  -row 'Created',@machine_templates.created
diff --git a/clients/cimi/views/machine_templates/show.haml b/clients/cimi/views/machine_templates/show.haml
index 1bfe803..bc7d587 100644
--- a/clients/cimi/views/machine_templates/show.haml
+++ b/clients/cimi/views/machine_templates/show.haml
@@ -18,11 +18,7 @@
     Instance. Machine Configurations are created by Providers and MAY, at the
     Providers discretion, be created by Consumers.
 
-%dl
-  %dt id
-  %dd
-    %a{ :href => @machine_template.id }=@machine_template.id
-  %dt Description
-  %dd=@machine_template.description
-  %dt Created
-  %dd #{@machine_template.created}&nbsp;
+-details 'MachineTemplate details' do
+  -row 'id',@machine_template.id
+  -row 'Description',@machine_template.description
+  -row 'Created',@machine_template.created
diff --git a/clients/cimi/views/machines/show.haml b/clients/cimi/views/machines/show.haml
index 24f86d8..a847710 100644
--- a/clients/cimi/views/machines/show.haml
+++ b/clients/cimi/views/machines/show.haml
@@ -28,41 +28,19 @@
       %input{ :type => :hidden, :name => '_method', :value => 'delete'}
       %button{ :class => 'btn danger'} Destroy
 
-%h3 Details
+%blockquote
+  %p
+    This entity represents an instantiated compute resource
 
-%table{ :class => 'table table-bordered table-striped' }
-  %tbody
-    %tr
-      %th ID
-      %td
-        %a{ :href => @machine.id }=@machine.id
-    %tr
-      %th Description
-      %td=@machine.description
-    %tr
-      %th Created
-      %td #{@machine.created}&nbsp;
-    %tr
-      %th State
-      %td=state_span_for @machine.state
-    %tr
-      %th CPU
-      %td=boolean_span_for @machine.cpu
-    %tr
-      %th RAM
-      %td
-        - if @machine.memory.quantity.nil?
-          %span.label Not specified
-        - else
-          =[@machine.memory.quantity, @machine.memory.units].join("&nbsp;")
-    %tr
-      %th Meters
-      %td
-        - if @machine.meters.empty?
-          %span.label No meters
-        - else
-          - @machine.meters.each do |meters|
-            %dd=meters.ref
+
+-details 'Machine details' do
+  -row 'ID', @machine.id
+  -row 'Description',@machine.description
+  -row 'Created', @machine.created
+  -row 'State',state_span_for(@machine.state)
+  -row 'CPU', boolean_span_for(@machine.cpu)
+  -row 'RAM',(@machine.memory.quantity.nil? ? "Not specified" : ([@machine.memory.quantity, @machine.memory.units].join("&nbsp;")))
+  -row 'Meters', (@machine.meters.empty? ? "No meters" : ( @machine.meters.each{|meter| meters.id}))
 
 
 %h3 Properties
diff --git a/clients/cimi/views/network_configurations/index.haml b/clients/cimi/views/network_configurations/index.haml
index 9b7a370..de6d42f 100644
--- a/clients/cimi/views/network_configurations/index.haml
+++ b/clients/cimi/views/network_configurations/index.haml
@@ -18,17 +18,13 @@
     of Network Configurations within a Provider. This entity can be used
     to locate and create Network Configurations
 
+%h3 NetworkConfigurationCollection
 %ul
   - @network_configs.network_configurations.each do |conf|
     %li
       %a{ :href => "/cimi/network_configurations/#{conf.href.split('/').last}"}=conf.href.split('/').last
 
-%h3 Collection details
-
-%dl
-  %dt id
-  %dd=@network_configs.id
-  %dt Description
-  %dd=@network_configs.description
-  %dt Created
-  %dd=@network_configs.created
+-details 'NetworkConfigurationCollection details' do
+  -row 'ID', @network_configs.id
+  -row 'Description', @network_configs.description
+  -row 'Created', @network_configs.created
diff --git a/clients/cimi/views/network_configurations/show.haml b/clients/cimi/views/network_configurations/show.haml
index e35952e..9c1a0b1 100644
--- a/clients/cimi/views/network_configurations/show.haml
+++ b/clients/cimi/views/network_configurations/show.haml
@@ -21,23 +21,13 @@
     A Network Configuration entity is the set of configuration values representing
     the information needed to create a Network with certain characteristics.
 
-%dl
-  %dt id
-  %dd
-    %a{ :href => @network_config.id }=@network_config.id
-  %dt Description
-  %dd=@network_config.description
-  %dt Created
-  %dd=@network_config.created
-  %dt Access
-  %dd=@network_config.access
-  %dt Bandwidth Limit
-  %dd=@network_config.bandwidth_limit
-  %dt Traffic Priority
-  %dd=@network_config.traffic_priority
-  %dt Maximum Traffic Delay
-  %dd=@network_config.max_traffic_delay
-  %dt Maximum Traffic Loss
-  %dd=@network_config.max_traffic_loss
-  %dt Maximum Traffic Jitter
-  %dd=@network_config.max_traffic_jitter
+-details 'NetworkConfiguration details' do
+  -row 'id', @network_config.id
+  -row 'Description',@network_config.description
+  -row 'Created',@network_config.created
+  -row 'Access',@network_config.access
+  -row 'Bandwidth Limit',@network_config.bandwidth_limit
+  -row 'Traffic Priority',@network_config.traffic_priority
+  -row 'Maximum Traffic Delay',@network_config.max_traffic_delay
+  -row 'Maximum Traffic Loss',@network_config.max_traffic_loss
+  -row 'Maximum Traffic Jitter',@network_config.max_traffic_jitter
diff --git a/clients/cimi/views/networks/index.haml b/clients/cimi/views/networks/index.haml
index 75d80ee..74ecb1d 100644
--- a/clients/cimi/views/networks/index.haml
+++ b/clients/cimi/views/networks/index.haml
@@ -18,17 +18,13 @@
     A Network Collection entity represents the collection of Networks
     within a Provider. This entity can be used to locate and create Networks.
 
+%h3 NetworkCollection
 %ul
   - @networks.networks.each do |network|
     %li
       %a{ :href => "/cimi/networks/#{network.href.split('/').last}"}=network.href.split('/').last
 
-%h3 Collection details
-
-%dl
-  %dt id
-  %dd=@networks.id
-  %dt Description
-  %dd=@networks.description
-  %dt Created
-  %dd=@networks.created
+-details 'NetworkCollection details' do
+  -row 'ID', @networks.id
+  -row 'Description', @networks.description
+  -row 'Created', @networks.created
diff --git a/clients/cimi/views/networks/show.haml b/clients/cimi/views/networks/show.haml
index 44bca74..7aaf37e 100644
--- a/clients/cimi/views/networks/show.haml
+++ b/clients/cimi/views/networks/show.haml
@@ -21,25 +21,14 @@
     This entity represents a Network - a realized entity
     that represents an abstraction of a layer 2 broadcast domain.
 
-%dl
-  %dt id
-  %dd
-    %a{ :href => @network.id }=@network.id
-  %dt Description
-  %dd=@network.description
-  %dt Created
-  %dd=@network.created
-  %dt State
-  %dd=@network.state
-  %dt Access
-  %dd=@network.access
-  %dt Bandwidth Limit
-  %dd=@network.bandwidth_limit
-  %dt Traffic Priority
-  %dd=@network.traffic_priority
-  %dt Maximum Traffic Delay
-  %dd=@network.max_traffic_delay
-  %dt Maximum Traffic Loss
-  %dd=@network.max_traffic_loss
-  %dt Maximum Traffic Jitter
-  %dd=@network.max_traffic_jitter
+-details 'Network details' do
+  -row 'ID', @network.id
+  -row 'Description', @network.description
+  -row 'Created', @network.created
+  -row 'State', @network.state
+  -row 'Access', @network.access
+  -row 'Bandwidth Limit', @network.bandwidth_limit
+  -row 'Traffic Priority', @network.traffic_priority
+  -row 'Maximum Traffic Delay', @network.max_traffic_delay
+  -row 'Maximum Traffic Loss', @network.max_traffic_loss
+  -row 'Maximum Traffic Jitter', @network.max_traffic_jitter
diff --git a/clients/cimi/views/volume_configurations/index.haml b/clients/cimi/views/volume_configurations/index.haml
index 71af308..7f636ec 100644
--- a/clients/cimi/views/volume_configurations/index.haml
+++ b/clients/cimi/views/volume_configurations/index.haml
@@ -18,7 +18,13 @@
     Volume Configuration entities within a Provider. This entity can be used to
     locate and create Volume Configurations.
 
+%h3 VolumeConfigurationsCollection
 %ul
   - @volume_configurations.volume_configurations.each do |conf|
     %li
       %a{ :href => "/cimi/volume_configurations/#{conf.href.split('/').last}"}=conf.href.split('/').last
+
+- details 'VolumeConfigurationCollection details' do
+  -row 'ID', @volume_configurations.id
+  -row 'Description', @volume_configurations.description
+  -row 'Created', @volume_configurations.created
diff --git a/clients/cimi/views/volume_configurations/show.haml b/clients/cimi/views/volume_configurations/show.haml
index 2465423..58783a6 100644
--- a/clients/cimi/views/volume_configurations/show.haml
+++ b/clients/cimi/views/volume_configurations/show.haml
@@ -23,20 +23,12 @@
     Instance. Volume Configurations are created by Providers and MAY, at the
     Providers discretion, be created by Consumers.
 
-%dl
-  %dt id
-  %dd
-    %a{ :href => @volume_configuration.id }=@volume_configuration.id
-  %dt Description
-  %dd=@volume_configuration.description
-  %dt Created
-  %dd=@volume_configuration.created
-  %dt Format
-  %dd=boolean_span_for @volume_configuration.format
-  %dt Supports snapshots
-  %dd=boolean_span_for @volume_configuration.supports_snapshots
-  %dt Guest interface
-  %dd=boolean_span_for @volume_configuration.guest_interface
-  %dt Capacity
-  %dd
-    =[@volume_configuration.capacity.quantity, @volume_configuration.capacity.units].join('&nbsp;')
+- details 'VolumeConfiguration details' do
+  -row 'ID', @volume_configuration.id
+  -row 'Description', @volume_configuration.description
+  -row 'Created', @volume_configuration.created
+  -row 'Format', boolean_span_for(@volume_configuration.format)
+  -row 'Supports snapshots', boolean_span_for(@volume_configuration.supports_snapshots)
+  -row 'Guest interface', boolean_span_for(@volume_configuration.guest_interface)
+  -row 'Capacity', ([@volume_configuration.capacity.quantity, @volume_configuration.capacity.units].join('&nbsp;'))
+
diff --git a/clients/cimi/views/volume_images/index.haml b/clients/cimi/views/volume_images/index.haml
index 8a36205..b819daa 100644
--- a/clients/cimi/views/volume_images/index.haml
+++ b/clients/cimi/views/volume_images/index.haml
@@ -24,12 +24,8 @@
     %li
       %a{ :href => "/cimi/volume_images/#{image.href.split('/').last}"}=image.href.split('/').last
 
-%h3 Collection details
+- details 'VolumeImageCollection details' do
+  - row 'ID', @volume_images.id
+  - row ' Description', @volume_images.description
+  - row 'Created', @volume_images.created
 
-%dl
-  %dt id
-  %dd=@volume_images.id
-  %dt Description
-  %dd=@volume_images.description
-  %dt Created
-  %dd=@volume_images.created
diff --git a/clients/cimi/views/volume_images/show.haml b/clients/cimi/views/volume_images/show.haml
index d0257d7..7f32497 100644
--- a/clients/cimi/views/volume_images/show.haml
+++ b/clients/cimi/views/volume_images/show.haml
@@ -21,18 +21,11 @@
     This entity represents the information necessary for hardware virtualized
     resources to create a Volume Instance
 
-%dl
-  %dt id
-  %dd
-    %a{ :href => @volume_image.id }=@volume_image.id
-  %dt Description
-  %dd=@volume_image.description
-  %dt Created
-  %dd=@volume_image.created
-  %dt Bootable
-  %dd=boolean_span_for @volume_image.bootable
-  %dt Image Location
-  %dd
-    %a{:href => "/cimi/volumes/#{href_to_id(@volume_image.image_location.href)}"}=href_to_id @volume_image.image_location.href
-  %dt Image Data
-  %dd=boolean_span_for @volume_image.image_data
+- details 'VolumeImage details' do
+  -row 'ID', @volume_image.id
+  -row 'Description', @volume_image.description
+  -row 'Created', @volume_image.created
+  -row 'Bootable', boolean_span_for(@volume_image.bootable)
+  -row 'Image Location', "/cimi/volumes/#{href_to_id(@volume_image.image_location.href)}"
+  -row 'Image Data', boolean_span_for(@volume_image.image_data)
+
diff --git a/clients/cimi/views/volumes/index.haml b/clients/cimi/views/volumes/index.haml
index dc1b631..f645a9f 100644
--- a/clients/cimi/views/volumes/index.haml
+++ b/clients/cimi/views/volumes/index.haml
@@ -25,7 +25,7 @@
     %li
       %a{ :href => "/cimi/volumes/#{volume.href.split('/').last}"}=volume.href.split('/').last
 
-- details 'Collection details' do
+- details 'VolumeCollection details' do
   - row 'ID', @volumes.id
   - row 'Description', @volumes.description
   - row 'Created', @volumes.created
-- 
1.7.6.5