From: Dies Koper <di...@fast.au.fujitsu.com>

---
 server/lib/cimi/data/default_res/machine.col.xml | 4 ++--
 server/lib/cimi/models/base.rb                   | 4 ++--
 server/lib/cimi/models/machine.rb                | 2 +-
 server/lib/cimi/models/machine_configuration.rb  | 2 +-
 server/lib/cimi/models/machine_template.rb       | 6 ++----
 server/lib/cimi/models/volume.rb                 | 4 ++--
 server/tests/cimi/data/machine_template.json     | 3 +--
 server/tests/cimi/data/machine_template.xml      | 2 +-
 8 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/server/lib/cimi/data/default_res/machine.col.xml 
b/server/lib/cimi/data/default_res/machine.col.xml
index 8a5b146..34b0f48 100644
--- a/server/lib/cimi/data/default_res/machine.col.xml
+++ b/server/lib/cimi/data/default_res/machine.col.xml
@@ -11,10 +11,10 @@
   <disk>
     <capacity quantity="200" units="gigabyte" />
     <format>ntgs</format>
-    <attachmentPoint>/dev/sdb0</attachmentPoint>
+    <initialLocation>/dev/sdb0</initialLocation>
     <guestInterface>SATA</guestInterface>
   </disk>
-  <volume href="http://host:port/volume/vol01"; attachmentPoint="/dev/sdc01" 
protocol="NFS" />
+  <volume href="http://host:port/volume/vol01"; initialLocation="/dev/sdc01" />
   <networkInterface>
     <vsp href="http://host:port/vsp/vsp01"; />
     <hostname>example host name</hostname>
diff --git a/server/lib/cimi/models/base.rb b/server/lib/cimi/models/base.rb
index 2e3351d..04a1098 100644
--- a/server/lib/cimi/models/base.rb
+++ b/server/lib/cimi/models/base.rb
@@ -30,7 +30,7 @@ require_relative '../helpers/database_helper'
 #     text :status
 #     href :meter
 #     array :volumes do
-#       scalar :href, :attachment_point, :protocol
+#       scalar :href, :initial_location
 #     end
 #   end
 #
@@ -42,7 +42,7 @@ require_relative '../helpers/database_helper'
 #   if machine.status == "UP"
 #     ...
 #   end
-#   sda = machine.volumes.find { |v| v.attachment_point == "/dev/sda" }
+#   sda = machine.volumes.find { |v| v.initial_location == "/dev/sda" }
 #   handle_meter(machine.meter.href)
 #
 # The keywords for the DSL are
diff --git a/server/lib/cimi/models/machine.rb 
b/server/lib/cimi/models/machine.rb
index 5c2e59d..3beb2f7 100644
--- a/server/lib/cimi/models/machine.rb
+++ b/server/lib/cimi/models/machine.rb
@@ -160,7 +160,7 @@ class CIMI::Model::Machine < CIMI::Model::Base
   def self.convert_storage_volumes(instance, context)
     instance.storage_volumes ||= [] #deal with nilpointers
     instance.storage_volumes.map{|vol| 
{:href=>context.volume_url(vol.keys.first),
-                                       :attachment_point=>vol.values.first} }
+                                       :initial_location=>vol.values.first} }
   end
 
 end
diff --git a/server/lib/cimi/models/machine_configuration.rb 
b/server/lib/cimi/models/machine_configuration.rb
index c580195..69c9eb5 100644
--- a/server/lib/cimi/models/machine_configuration.rb
+++ b/server/lib/cimi/models/machine_configuration.rb
@@ -23,7 +23,7 @@ class CIMI::Model::MachineConfiguration < CIMI::Model::Base
   array :disks do
     text :capacity
     text :format
-    text :attachment_point
+    text :initial_location
   end
 
   array :operations do
diff --git a/server/lib/cimi/models/machine_template.rb 
b/server/lib/cimi/models/machine_template.rb
index faecc5c..4da9094 100644
--- a/server/lib/cimi/models/machine_template.rb
+++ b/server/lib/cimi/models/machine_template.rb
@@ -25,13 +25,11 @@ class CIMI::Model::MachineTemplate < CIMI::Model::Base
     :constraints => lambda { |c| c.driver.realms(c.credentials).map { |r| r.id 
}}
 
   array :volumes do
-    scalar :href
-    scalar :protocol
-    scalar :attachment_point
+    scalar :href, :initial_location
   end
 
   array :volume_templates do
-    scalar :href, :attachment_point, :protocol
+    scalar :href, :initial_location
   end
 
   array :network_interfaces do
diff --git a/server/lib/cimi/models/volume.rb b/server/lib/cimi/models/volume.rb
index 3bb0f10..19827a9 100644
--- a/server/lib/cimi/models/volume.rb
+++ b/server/lib/cimi/models/volume.rb
@@ -77,13 +77,13 @@ class CIMI::Model::Volume < CIMI::Model::Base
   def self.find_to_attach_from_json(json_in, context)
     json = JSON.parse(json_in)
     json["volumes"].map{|v| 
{:volume=>self.find(v["volume"]["href"].split("/volumes/").last, context),
-                             :attachment_point=>v["attachmentPoint"]  }}
+                             :initial_location=>v["initialLocation"]  }}
   end
 
   def self.find_to_attach_from_xml(xml_in, context)
     xml = XmlSimple.xml_in(xml_in)
     xml["volume"].map{|v| {:volume => 
self.find(v["href"].split("/volumes/").last, context),
-                           :attachment_point=>v["attachmentPoint"] }}
+                           :initial_location=>v["initialLocation"] }}
   end
 
   private
diff --git a/server/tests/cimi/data/machine_template.json 
b/server/tests/cimi/data/machine_template.json
index 816541c..6586a80 100644
--- a/server/tests/cimi/data/machine_template.json
+++ b/server/tests/cimi/data/machine_template.json
@@ -8,8 +8,7 @@
   "machineImage": { "href": "http://cimi.example.org/machine_images/1"; },
   "volumes": [{
     "href": "http://cimi.example.org/volumes/1";,
-    "attachmentPoint": "/dev/sda",
-    "protocol": "nfs"
+    "initialLocation": "/dev/sda"
   }],
   "networkInterfaces": [{
     "vsp": { "href": "http://cimi.example.org/vsps/1"; },
diff --git a/server/tests/cimi/data/machine_template.xml 
b/server/tests/cimi/data/machine_template.xml
index fed655c..d0f32b9 100644
--- a/server/tests/cimi/data/machine_template.xml
+++ b/server/tests/cimi/data/machine_template.xml
@@ -6,7 +6,7 @@
   <machineConfig href="http://cimi.example.org/machine_configs/1"/>
   <machineImage href="http://cimi.example.org/machine_images/1"/>
   <volume href="http://cimi.example.org/volumes/1";
-          attachmentPoint="/dev/sda" protocol="nfs" />
+          initialLocation="/dev/sda" />
   <networkInterface>
     <vsp href="http://cimi.example.org/vsps/1"/>
     <hostname>host.cimi.example.org</hostname>
-- 
1.8.0.msysgit.0


Reply via email to