deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@redhat.com
Subject [PATCH 3/4] Adds CIMI::EntityMetadata to the CIMI::CloudEntryPoint
Date Thu, 08 Dec 2011 14:24:51 GMT
From: marios <marios@redhat.com>


Signed-off-by: marios <marios@redhat.com>
---
 server/lib/cimi/model/cloud_entry_point.rb |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/server/lib/cimi/model/cloud_entry_point.rb b/server/lib/cimi/model/cloud_entry_point.rb
index 62a91b6..e7464f0 100644
--- a/server/lib/cimi/model/cloud_entry_point.rb
+++ b/server/lib/cimi/model/cloud_entry_point.rb
@@ -15,6 +15,10 @@
 
 class CIMI::Model::CloudEntryPoint < CIMI::Model::Base
 
+array :entity_metadata do
+  scalar :href
+end
+
   def self.create(context)
     root_entities = CIMI::Model.root_entities.inject({}) do |result, entity|
       if context.respond_to? :"#{entity.underscore}_url"
@@ -22,11 +26,16 @@ class CIMI::Model::CloudEntryPoint < CIMI::Model::Base
       end
       result
     end
+    entity_metadata = EntityMetadata.all(context)
+    root_entity_meta = [] ; entity_metadata.each do |m|
+      root_entity_meta << {:href=>m.uri}
+    end
     root_entities.merge!({
       :name => context.driver.name,
       :description => "Cloud Entry Point for the Deltacloud #{context.driver.name} driver",
       :uri => context.cloudEntryPoint_url,
-      :created => Time.now
+      :created => Time.now,
+      :entity_metadata => root_entity_meta
     })
     self.new(root_entities)
   end
-- 
1.7.6.4


Mime
View raw message