deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject [8/15] git commit: CIMI: define order of toplevel resources explicitly
Date Thu, 08 Nov 2012 17:13:51 GMT
CIMI: define order of toplevel resources explicitly

This allows us to load models in models.rb in the order in which they are
needed by the code


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

Branch: refs/heads/master
Commit: f18a366e2fb5e5fc75f0861c59fbd93389ed3b78
Parents: d3ebeb8
Author: David Lutterkort <lutter@redhat.com>
Authored: Wed Nov 7 18:39:45 2012 -0800
Committer: David Lutterkort <lutter@redhat.com>
Committed: Thu Nov 8 09:11:18 2012 -0800

----------------------------------------------------------------------
 server/lib/cimi/models.rb                   |   12 +++++-------
 server/lib/cimi/models/cloud_entry_point.rb |   17 +++++++++++++++++
 2 files changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/f18a366e/server/lib/cimi/models.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models.rb b/server/lib/cimi/models.rb
index 3f5dace..3e7027d 100644
--- a/server/lib/cimi/models.rb
+++ b/server/lib/cimi/models.rb
@@ -27,23 +27,21 @@ require_relative './models/action'
 require_relative './models/machine_volume'
 require_relative './models/disk'
 
-# Toplevel entities; order matters as it determines the order
-# in which the entities appear in the CEP
 require_relative './models/cloud_entry_point'
 require_relative './models/resource_metadata'
+require_relative './models/volume'
+require_relative './models/volume_template'
+require_relative './models/volume_configuration'
+require_relative './models/volume_image'
 require_relative './models/machine'
 require_relative './models/machine_template'
 require_relative './models/machine_configuration'
 require_relative './models/machine_image'
 require_relative './models/credential'
-require_relative './models/volume'
-require_relative './models/volume_template'
-require_relative './models/volume_configuration'
-require_relative './models/volume_image'
+require_relative './models/network_port'
 require_relative './models/network'
 require_relative './models/network_template'
 require_relative './models/network_configuration'
-require_relative './models/network_port'
 require_relative './models/network_port_template'
 require_relative './models/network_port_configuration'
 require_relative './models/address'

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/f18a366e/server/lib/cimi/models/cloud_entry_point.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/cloud_entry_point.rb b/server/lib/cimi/models/cloud_entry_point.rb
index 55b0a21..c03c524 100644
--- a/server/lib/cimi/models/cloud_entry_point.rb
+++ b/server/lib/cimi/models/cloud_entry_point.rb
@@ -15,8 +15,25 @@
 
 class CIMI::Model::CloudEntryPoint < CIMI::Model::Base
 
+  # All possible CIMI collections, in the order in which they should appear
+  # in the CEP
+  COLLECTIONS = [ "resourceMetadata", "systems", "systemTemplates",
+            "machines" , "machineTemplates", "machineConfigs",
+            "machineImages", "credentials", "credentialTemplates",
+            "volumes", "volumeTemplates", "volumeConfigs", "volumeImages",
+            "networks", "networkTemplates", "networkConfigs", "networkPorts",
+            "networkPortTemplates", "networkPortConfigs",
+            "addresses", "addressTemplates", "forwardingGroups",
+            "forwardingGroupTemplates",
+            "jobs", "meters", "meterTemplates", "meterConfigs",
+            "eventLogs", "eventLogTemplates" ]
+
   text  :base_uri, :xml_name => "baseURI", :json_name => "baseURI"
 
+  COLLECTIONS.each do |coll|
+    href coll.underscore
+  end
+
   def self.create(context)
     self.new(entities(context).merge({
       :name => context.driver.name,


Mime
View raw message