deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dko...@apache.org
Subject git commit: CIMI: replace volume related attachment_point and protocol attributes with initial_location as per published cimi spec
Date Mon, 25 Feb 2013 12:19:10 GMT
Updated Branches:
  refs/heads/master 7313aed50 -> 103bbf570


CIMI: replace volume related attachment_point and protocol
attributes with initial_location as per published cimi spec


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

Branch: refs/heads/master
Commit: 103bbf570bc6cd91cd97fb379fb05cdb4ac6a73a
Parents: 7313aed
Author: Dies Koper <diesk@fast.au.fujitsu.com>
Authored: Mon Feb 25 10:21:47 2013 +1100
Committer: Dies Koper <diesk@fast.au.fujitsu.com>
Committed: Mon Feb 25 23:18:04 2013 +1100

----------------------------------------------------------------------
 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(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/103bbf57/server/lib/cimi/data/default_res/machine.col.xml
----------------------------------------------------------------------
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>

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/103bbf57/server/lib/cimi/models/base.rb
----------------------------------------------------------------------
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

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/103bbf57/server/lib/cimi/models/machine.rb
----------------------------------------------------------------------
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

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/103bbf57/server/lib/cimi/models/machine_configuration.rb
----------------------------------------------------------------------
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

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/103bbf57/server/lib/cimi/models/machine_template.rb
----------------------------------------------------------------------
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

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/103bbf57/server/lib/cimi/models/volume.rb
----------------------------------------------------------------------
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

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/103bbf57/server/tests/cimi/data/machine_template.json
----------------------------------------------------------------------
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" },

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/103bbf57/server/tests/cimi/data/machine_template.xml
----------------------------------------------------------------------
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>


Mime
View raw message