deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r1234729 - /deltacloud/trunk/server/lib/cimi/model/
Date Mon, 23 Jan 2012 10:26:47 GMT
Author: mfojtik
Date: Mon Jan 23 10:26:46 2012
New Revision: 1234729

URL: http://svn.apache.org/viewvc?rev=1234729&view=rev
Log:
CIMI: Added all_uri() helper to map links from various CIMI entities to URI hash

Modified:
    deltacloud/trunk/server/lib/cimi/model/base.rb
    deltacloud/trunk/server/lib/cimi/model/cloud_entry_point.rb
    deltacloud/trunk/server/lib/cimi/model/machine_admin_collection.rb
    deltacloud/trunk/server/lib/cimi/model/machine_collection.rb
    deltacloud/trunk/server/lib/cimi/model/machine_configuration_collection.rb
    deltacloud/trunk/server/lib/cimi/model/machine_image_collection.rb
    deltacloud/trunk/server/lib/cimi/model/machine_template_collection.rb
    deltacloud/trunk/server/lib/cimi/model/volume_collection.rb
    deltacloud/trunk/server/lib/cimi/model/volume_configuration_collection.rb
    deltacloud/trunk/server/lib/cimi/model/volume_image_collection.rb
    deltacloud/trunk/server/lib/cimi/model/volume_template_collection.rb

Modified: deltacloud/trunk/server/lib/cimi/model/base.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model/base.rb?rev=1234729&r1=1234728&r2=1234729&view=diff
==============================================================================
--- deltacloud/trunk/server/lib/cimi/model/base.rb (original)
+++ deltacloud/trunk/server/lib/cimi/model/base.rb Mon Jan 23 10:26:46 2012
@@ -128,6 +128,11 @@ class CIMI::Model::Base
         define_method(:"#{name}=") { |newval| @attribute_values[name] = newval }
       end
     end
+
+    # Return Array of links to current CIMI object
+    def all_uri(context)
+      self.all(context).map { |e| { :href => e.uri } }
+    end
   end
 
   extend CIMI::Model::Schema::DSL

Modified: deltacloud/trunk/server/lib/cimi/model/cloud_entry_point.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model/cloud_entry_point.rb?rev=1234729&r1=1234728&r2=1234729&view=diff
==============================================================================
--- deltacloud/trunk/server/lib/cimi/model/cloud_entry_point.rb (original)
+++ deltacloud/trunk/server/lib/cimi/model/cloud_entry_point.rb Mon Jan 23 10:26:46 2012
@@ -39,14 +39,6 @@ class CIMI::Model::CloudEntryPoint < CIM
     end
   end
 
-  # Return an Hash of links to the EntityMetadata objects
-  def root_entity_metadata(context)
-    entity_metadata = EntityMetadata.all(context)
-    entity_metadata.map do |m|
-      { :href => m.uri }
-    end
-  end
-
   private
 
   def self.href_defined?(entity)

Modified: deltacloud/trunk/server/lib/cimi/model/machine_admin_collection.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model/machine_admin_collection.rb?rev=1234729&r1=1234728&r2=1234729&view=diff
==============================================================================
--- deltacloud/trunk/server/lib/cimi/model/machine_admin_collection.rb (original)
+++ deltacloud/trunk/server/lib/cimi/model/machine_admin_collection.rb Mon Jan 23 10:26:46
2012
@@ -27,7 +27,7 @@ class CIMI::Model::MachineAdminCollectio
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} MachineAdminCollection",
-      :machine_admins => MachineAdmin.all(context).map { |c| { :href => c.uri } }
+      :machine_admins => MachineAdmin.all_uri(context)
     )
   end
 

Modified: deltacloud/trunk/server/lib/cimi/model/machine_collection.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model/machine_collection.rb?rev=1234729&r1=1234728&r2=1234729&view=diff
==============================================================================
--- deltacloud/trunk/server/lib/cimi/model/machine_collection.rb (original)
+++ deltacloud/trunk/server/lib/cimi/model/machine_collection.rb Mon Jan 23 10:26:46 2012
@@ -27,7 +27,7 @@ class CIMI::Model::MachineCollection < C
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} MachineCollection",
-      :machines => Machine.all(context).map { |c| { :href => c.uri } }
+      :machines => Machine.all_uri(context)
     )
   end
 

Modified: deltacloud/trunk/server/lib/cimi/model/machine_configuration_collection.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model/machine_configuration_collection.rb?rev=1234729&r1=1234728&r2=1234729&view=diff
==============================================================================
--- deltacloud/trunk/server/lib/cimi/model/machine_configuration_collection.rb (original)
+++ deltacloud/trunk/server/lib/cimi/model/machine_configuration_collection.rb Mon Jan 23
10:26:46 2012
@@ -27,7 +27,7 @@ class CIMI::Model::MachineConfigurationC
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} MachineConfigurationCollection",
-      :machine_configurations => MachineConfiguration.all(context).map { |c| { :href =>
c.uri } }
+      :machine_configurations => MachineConfiguration.all_uri(context)
     )
   end
 

Modified: deltacloud/trunk/server/lib/cimi/model/machine_image_collection.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model/machine_image_collection.rb?rev=1234729&r1=1234728&r2=1234729&view=diff
==============================================================================
--- deltacloud/trunk/server/lib/cimi/model/machine_image_collection.rb (original)
+++ deltacloud/trunk/server/lib/cimi/model/machine_image_collection.rb Mon Jan 23 10:26:46
2012
@@ -27,7 +27,7 @@ class CIMI::Model::MachineImageCollectio
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} MachineImageCollection",
-      :machine_images => MachineImage.all(context).map { |c| { :href => c.uri } }
+      :machine_images => MachineImage.all_uri(context)
     )
   end
 

Modified: deltacloud/trunk/server/lib/cimi/model/machine_template_collection.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model/machine_template_collection.rb?rev=1234729&r1=1234728&r2=1234729&view=diff
==============================================================================
--- deltacloud/trunk/server/lib/cimi/model/machine_template_collection.rb (original)
+++ deltacloud/trunk/server/lib/cimi/model/machine_template_collection.rb Mon Jan 23 10:26:46
2012
@@ -27,7 +27,7 @@ class CIMI::Model::MachineTemplateCollec
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} MachineTemplateCollection",
-      :machine_templates => MachineTemplate.all(context).map { |c| { :href => c.uri
} }
+      :machine_templates => MachineTemplate.all_uri(context)
     )
   end
 

Modified: deltacloud/trunk/server/lib/cimi/model/volume_collection.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model/volume_collection.rb?rev=1234729&r1=1234728&r2=1234729&view=diff
==============================================================================
--- deltacloud/trunk/server/lib/cimi/model/volume_collection.rb (original)
+++ deltacloud/trunk/server/lib/cimi/model/volume_collection.rb Mon Jan 23 10:26:46 2012
@@ -27,7 +27,7 @@ class CIMI::Model::VolumeCollection < CI
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} VolumeCollection",
-      :volumes => Volume.all(context).map { |c| { :href => c.uri } }
+      :volumes => Volume.all_uri(context)
     )
   end
 

Modified: deltacloud/trunk/server/lib/cimi/model/volume_configuration_collection.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model/volume_configuration_collection.rb?rev=1234729&r1=1234728&r2=1234729&view=diff
==============================================================================
--- deltacloud/trunk/server/lib/cimi/model/volume_configuration_collection.rb (original)
+++ deltacloud/trunk/server/lib/cimi/model/volume_configuration_collection.rb Mon Jan 23 10:26:46
2012
@@ -27,7 +27,7 @@ class CIMI::Model::VolumeConfigurationCo
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} VolumeConfigurationCollection",
-      :volume_configurations => VolumeConfiguration.all(context).map { |c| { :href =>
c.uri } }
+      :volume_configurations => VolumeConfiguration.all_uri(context)
     )
   end
 

Modified: deltacloud/trunk/server/lib/cimi/model/volume_image_collection.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model/volume_image_collection.rb?rev=1234729&r1=1234728&r2=1234729&view=diff
==============================================================================
--- deltacloud/trunk/server/lib/cimi/model/volume_image_collection.rb (original)
+++ deltacloud/trunk/server/lib/cimi/model/volume_image_collection.rb Mon Jan 23 10:26:46
2012
@@ -27,7 +27,7 @@ class CIMI::Model::VolumeImageCollection
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} VolumeImageCollection",
-      :volume_images => VolumeImage.all(context).map { |c| { :href => c.uri } }
+      :volume_images => VolumeImage.all_uri(context)
     )
   end
 

Modified: deltacloud/trunk/server/lib/cimi/model/volume_template_collection.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model/volume_template_collection.rb?rev=1234729&r1=1234728&r2=1234729&view=diff
==============================================================================
--- deltacloud/trunk/server/lib/cimi/model/volume_template_collection.rb (original)
+++ deltacloud/trunk/server/lib/cimi/model/volume_template_collection.rb Mon Jan 23 10:26:46
2012
@@ -27,7 +27,7 @@ class CIMI::Model::VolumeTemplateCollect
       :name => 'default',
       :created => Time.now,
       :description => "#{context.driver.name.capitalize} VolumeTemplateCollection",
-      :volume_templates => VolumeTemplate.all(context).map { |c| { :href => c.uri }
}
+      :volume_templates => VolumeTemplate.all_uri(context)
     )
   end
 



Mime
View raw message