deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [3/4] git commit: CIMI: Renamed :uri to :id (CIMI 0.0.66)
Date Mon, 12 Mar 2012 13:53:28 GMT
CIMI: Renamed :uri to :id (CIMI 0.0.66)


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

Branch: refs/heads/master
Commit: 671d5ac41df7914adc55ad72e5aa7dc12b9a1d97
Parents: 684d8f0
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Wed Feb 29 16:07:50 2012 +0100
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Mon Mar 12 14:32:47 2012 +0100

----------------------------------------------------------------------
 server/lib/cimi/model/base.rb                      |    4 ++--
 server/lib/cimi/model/cloud_entry_point.rb         |    2 +-
 .../lib/cimi/model/entity_metadata_collection.rb   |    2 +-
 server/lib/cimi/model/machine.rb                   |    2 +-
 server/lib/cimi/model/machine_admin.rb             |    2 +-
 server/lib/cimi/model/machine_admin_collection.rb  |    2 +-
 server/lib/cimi/model/machine_collection.rb        |    2 +-
 server/lib/cimi/model/machine_configuration.rb     |    6 +++---
 .../cimi/model/machine_configuration_collection.rb |    2 +-
 server/lib/cimi/model/machine_image.rb             |    2 +-
 server/lib/cimi/model/machine_image_collection.rb  |    2 +-
 .../lib/cimi/model/machine_template_collection.rb  |    2 +-
 server/lib/cimi/model/network_collection.rb        |    4 ++--
 .../cimi/model/network_configuration_collection.rb |    4 ++--
 server/lib/cimi/model/volume.rb                    |    2 +-
 server/lib/cimi/model/volume_collection.rb         |    2 +-
 server/lib/cimi/model/volume_configuration.rb      |    2 +-
 .../cimi/model/volume_configuration_collection.rb  |    2 +-
 server/lib/cimi/model/volume_image.rb              |    2 +-
 server/lib/cimi/model/volume_image_collection.rb   |    2 +-
 .../lib/cimi/model/volume_template_collection.rb   |    2 +-
 21 files changed, 26 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/base.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/base.rb b/server/lib/cimi/model/base.rb
index 88c7c6a..16812ac 100644
--- a/server/lib/cimi/model/base.rb
+++ b/server/lib/cimi/model/base.rb
@@ -131,7 +131,7 @@ class CIMI::Model::Base
 
     # Return Array of links to current CIMI object
     def all_uri(context)
-      self.all(context).map { |e| { :href => e.uri } }
+      self.all(context).map { |e| { :href => e.id } }
     end
   end
 
@@ -197,7 +197,7 @@ class CIMI::Model::Base
   #
   # Common attributes for all resources
   #
-  text :uri, :name, :description, :created
+  text :id, :name, :description, :created
 
   # FIXME: this doesn't match with JSON
   hash :property, :content => :value do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/cloud_entry_point.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/cloud_entry_point.rb b/server/lib/cimi/model/cloud_entry_point.rb
index 7d76cfe..5db94df 100644
--- a/server/lib/cimi/model/cloud_entry_point.rb
+++ b/server/lib/cimi/model/cloud_entry_point.rb
@@ -23,7 +23,7 @@ class CIMI::Model::CloudEntryPoint < CIMI::Model::Base
     self.new(entities(context).merge({
       :name => context.driver.name,
       :description => "Cloud Entry Point for the Deltacloud #{context.driver.name} driver",
-      :uri => context.cloudEntryPoint_url,
+      :id => context.cloudEntryPoint_url,
       :created => Time.now,
       :entity_metadata => EntityMetadata.all_uri(context)
     }))

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/entity_metadata_collection.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/entity_metadata_collection.rb b/server/lib/cimi/model/entity_metadata_collection.rb
index 84589b3..63db7f7 100644
--- a/server/lib/cimi/model/entity_metadata_collection.rb
+++ b/server/lib/cimi/model/entity_metadata_collection.rb
@@ -21,7 +21,7 @@ class CIMI::Model::EntityMetadataCollection < CIMI::Model::Base
 
   def self.default(context)
     self.new(
-      :uri => context.entity_metadata_url,
+      :id => context.entity_metadata_url,
       :name => 'default',
       :created => Time.now,
       :entity_metadata => EntityMetadata.all_uri(context)

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/machine.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/machine.rb b/server/lib/cimi/model/machine.rb
index 2e31065..939629a 100644
--- a/server/lib/cimi/model/machine.rb
+++ b/server/lib/cimi/model/machine.rb
@@ -141,7 +141,7 @@ class CIMI::Model::Machine < CIMI::Model::Base
       :name => instance.id,
       :description => instance.name,
       :created => instance.launch_time,
-      :uri => context.machine_url(instance.id),
+      :id => context.machine_url(instance.id),
       :state => convert_instance_state(instance.state),
       :cpu => cpu || convert_instance_cpu(instance.instance_profile, context),
       :memory => memory || convert_instance_memory(instance.instance_profile, context),

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/machine_admin.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/machine_admin.rb b/server/lib/cimi/model/machine_admin.rb
index e3f92ee..fed7c80 100644
--- a/server/lib/cimi/model/machine_admin.rb
+++ b/server/lib/cimi/model/machine_admin.rb
@@ -51,7 +51,7 @@ class CIMI::Model::MachineAdmin < CIMI::Model::Base
       :username => key.username,
       :password => key.is_password? ? key.password : key.fingerprint,
       :key => key.is_key? ? key.pem_rsa_key : nil,
-      :uri => context.machine_admin_url(key.id),
+      :id => context.machine_admin_url(key.id),
       :created => Time.now
     )
   end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/machine_admin_collection.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/machine_admin_collection.rb b/server/lib/cimi/model/machine_admin_collection.rb
index 775f7f8..fd76a52 100644
--- a/server/lib/cimi/model/machine_admin_collection.rb
+++ b/server/lib/cimi/model/machine_admin_collection.rb
@@ -23,7 +23,7 @@ class CIMI::Model::MachineAdminCollection < CIMI::Model::Base
 
   def self.default(context)
     self.new(
-      :uri => context.machine_admins_url,
+      :id => context.machine_admins_url,
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} MachineAdminCollection",

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/machine_collection.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/machine_collection.rb b/server/lib/cimi/model/machine_collection.rb
index 65815d8..27aa61b 100644
--- a/server/lib/cimi/model/machine_collection.rb
+++ b/server/lib/cimi/model/machine_collection.rb
@@ -23,7 +23,7 @@ class CIMI::Model::MachineCollection < CIMI::Model::Base
 
   def self.default(context)
     self.new(
-      :uri => context.machines_url,
+      :id => context.machines_url,
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} MachineCollection",

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/machine_configuration.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/machine_configuration.rb b/server/lib/cimi/model/machine_configuration.rb
index 07f5429..f9d98f2 100644
--- a/server/lib/cimi/model/machine_configuration.rb
+++ b/server/lib/cimi/model/machine_configuration.rb
@@ -60,9 +60,9 @@ class CIMI::Model::MachineConfiguration < CIMI::Model::Base
         "of memory and #{cpu} CPU",
       :cpu => cpu,
       :created => Time.now.to_s,  # FIXME: DC hardware_profile has no mention about created_at
-      :memory => { :quantity => memory, :units => profile.memory.unit },
-      :disks => [ { :capacity => { :quantity => storage, :units => profile.storage.unit
} } ],
-      :uri => context.machine_configuration_url(profile.name)
+      :memory => { :quantity => profile.memory.value || profile.memory.default, :units
=> profile.memory.unit },
+      :disks => [ { :capacity => { :quantity => profile.storage.value || profile.storage.default,
:units => profile.storage.unit } } ],
+      :id => context.machine_configuration_url(profile.name)
     }
     self.new(machine_hash)
   end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/machine_configuration_collection.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/machine_configuration_collection.rb b/server/lib/cimi/model/machine_configuration_collection.rb
index c916bcb..171acac 100644
--- a/server/lib/cimi/model/machine_configuration_collection.rb
+++ b/server/lib/cimi/model/machine_configuration_collection.rb
@@ -23,7 +23,7 @@ class CIMI::Model::MachineConfigurationCollection < CIMI::Model::Base
 
   def self.default(context)
     self.new(
-      :uri => context.machine_configurations_url,
+      :id => context.machine_configurations_url,
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} MachineConfigurationCollection",

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/machine_image.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/machine_image.rb b/server/lib/cimi/model/machine_image.rb
index 682f05a..7389475 100644
--- a/server/lib/cimi/model/machine_image.rb
+++ b/server/lib/cimi/model/machine_image.rb
@@ -36,7 +36,7 @@ class CIMI::Model::MachineImage < CIMI::Model::Base
   def self.from_image(image, context)
     self.new(
       :name => image.id,
-      :uri => context.machine_image_url(image.id),
+      :id => context.machine_image_url(image.id),
       :description => image.description,
       :created => Time.now.to_s,
       :image_location => { :href => "#{context.driver.name}://#{image.id}" } # FIXME

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/machine_image_collection.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/machine_image_collection.rb b/server/lib/cimi/model/machine_image_collection.rb
index b5db633..b02ede7 100644
--- a/server/lib/cimi/model/machine_image_collection.rb
+++ b/server/lib/cimi/model/machine_image_collection.rb
@@ -23,7 +23,7 @@ class CIMI::Model::MachineImageCollection < CIMI::Model::Base
 
   def self.default(context)
     self.new(
-      :uri => context.machine_images_url,
+      :id => context.machine_images_url,
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} MachineImageCollection",

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/machine_template_collection.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/machine_template_collection.rb b/server/lib/cimi/model/machine_template_collection.rb
index 5aca625..e1e8d30 100644
--- a/server/lib/cimi/model/machine_template_collection.rb
+++ b/server/lib/cimi/model/machine_template_collection.rb
@@ -23,7 +23,7 @@ class CIMI::Model::MachineTemplateCollection < CIMI::Model::Base
 
   def self.default(context)
     self.new(
-      :uri => context.machine_template_url,
+      :id => context.machine_template_url,
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} MachineTemplateCollection",

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/network_collection.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/network_collection.rb b/server/lib/cimi/model/network_collection.rb
index 0def427..836d8e8 100644
--- a/server/lib/cimi/model/network_collection.rb
+++ b/server/lib/cimi/model/network_collection.rb
@@ -23,11 +23,11 @@ class CIMI::Model::NetworkCollection < CIMI::Model::Base
 
   def self.default(context)
     self.new(
-      :uri => context.networks_url,
+      :id => context.networks_url,
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} NetworkCollection",
-      :networks => Network.all(context).map { |c| { :href => c.uri } }
+      :networks => Network.all(context).map { |c| { :href => c.id } }
     )
   end
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/network_configuration_collection.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/network_configuration_collection.rb b/server/lib/cimi/model/network_configuration_collection.rb
index 6f06c4a..fd70047 100644
--- a/server/lib/cimi/model/network_configuration_collection.rb
+++ b/server/lib/cimi/model/network_configuration_collection.rb
@@ -23,11 +23,11 @@ class CIMI::Model::NetworkConfigurationCollection < CIMI::Model::Base
 
   def self.default(context)
     self.new(
-      :uri => context.network_configurations_url,
+      :id => context.network_configurations_url,
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} NetworkConfigurationCollection",
-      :network_configurations => NetworkConfiguration.all(context).map { |c| { :href =>
c.uri } }
+      :network_configurations => NetworkConfiguration.all(context).map { |c| { :href =>
c.id } }
     )
   end
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/volume.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/volume.rb b/server/lib/cimi/model/volume.rb
index 773dc1f..0a232d5 100644
--- a/server/lib/cimi/model/volume.rb
+++ b/server/lib/cimi/model/volume.rb
@@ -89,7 +89,7 @@ class CIMI::Model::Volume < CIMI::Model::Base
     self.new( { :name => volume.id,
                 :description => volume.id,
                 :created => volume.created,
-                :uri => context.volume_url(volume.id),
+                :id => context.volume_url(volume.id),
                 :capacity => { :quantity=>volume.capacity, :units=>"gibibyte"  },
#FIXME... units will vary
                 :bootable => "false", #fixme ... will vary... ec2 doesn't expose this
                 :supports_snapshots => "true", #fixme, will vary (true for ec2)

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/volume_collection.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/volume_collection.rb b/server/lib/cimi/model/volume_collection.rb
index 385ee0a..d5053c7 100644
--- a/server/lib/cimi/model/volume_collection.rb
+++ b/server/lib/cimi/model/volume_collection.rb
@@ -23,7 +23,7 @@ class CIMI::Model::VolumeCollection < CIMI::Model::Base
 
   def self.default(context)
     self.new(
-      :uri => context.volumes_url,
+      :id => context.volumes_url,
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} VolumeCollection",

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/volume_configuration.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/volume_configuration.rb b/server/lib/cimi/model/volume_configuration.rb
index b8f0155..75b37ea 100644
--- a/server/lib/cimi/model/volume_configuration.rb
+++ b/server/lib/cimi/model/volume_configuration.rb
@@ -47,7 +47,7 @@ class CIMI::Model::VolumeConfiguration < CIMI::Model::Base
 
   def self.create(size, context)
     self.new( {
-                :uri => context.volume_configuration_url(size),
+                :id => context.volume_configuration_url(size),
                 :name => size,
                 :description => "volume configuration with #{size} GiB",
                 :created => Time.now.to_s,

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/volume_configuration_collection.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/volume_configuration_collection.rb b/server/lib/cimi/model/volume_configuration_collection.rb
index 2dae421..ace31bf 100644
--- a/server/lib/cimi/model/volume_configuration_collection.rb
+++ b/server/lib/cimi/model/volume_configuration_collection.rb
@@ -23,7 +23,7 @@ class CIMI::Model::VolumeConfigurationCollection < CIMI::Model::Base
 
   def self.default(context)
     self.new(
-      :uri => context.volume_configurations_url,
+      :id => context.volume_configurations_url,
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} VolumeConfigurationCollection",

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/volume_image.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/volume_image.rb b/server/lib/cimi/model/volume_image.rb
index e32509e..03cc7fd 100644
--- a/server/lib/cimi/model/volume_image.rb
+++ b/server/lib/cimi/model/volume_image.rb
@@ -40,7 +40,7 @@ class CIMI::Model::VolumeImage < CIMI::Model::Base
                :name => snapshot.id,
                :description => snapshot.id,
                :created => snapshot.created,
-               :uri => context.volume_image_url(snapshot.id),
+               :id => context.volume_image_url(snapshot.id),
                :image_location => {:href=>context.volume_url(snapshot.storage_volume_id)},
                :bootable => "false"  #FIXME
             } )

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/volume_image_collection.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/volume_image_collection.rb b/server/lib/cimi/model/volume_image_collection.rb
index f2ee5cb..0172c04 100644
--- a/server/lib/cimi/model/volume_image_collection.rb
+++ b/server/lib/cimi/model/volume_image_collection.rb
@@ -23,7 +23,7 @@ class CIMI::Model::VolumeImageCollection < CIMI::Model::Base
 
   def self.default(context)
     self.new(
-      :uri => context.volume_images_url,
+      :id => context.volume_images_url,
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} VolumeImageCollection",

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/671d5ac4/server/lib/cimi/model/volume_template_collection.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/model/volume_template_collection.rb b/server/lib/cimi/model/volume_template_collection.rb
index 47ca480..6b6e4ac 100644
--- a/server/lib/cimi/model/volume_template_collection.rb
+++ b/server/lib/cimi/model/volume_template_collection.rb
@@ -23,7 +23,7 @@ class CIMI::Model::VolumeTemplateCollection < CIMI::Model::Base
 
   def self.default(context)
     self.new(
-      :uri => context.volume_template_url,
+      :id => context.volume_template_url,
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} VolumeTemplateCollection",


Mime
View raw message