You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2013/04/30 16:41:24 UTC

[2/3] git commit: Changes needed to adapt to using a hash to contain all root entry point, vs the acts_as_root_entity method. Refactor service/cloud_entry_point.rb based on input from Michal Fojtik. Huge Thanks! Michal Fojtik!

Changes needed to adapt to using a hash to contain all root entry
point, vs the acts_as_root_entity method.
Refactor service/cloud_entry_point.rb based on input from Michal Fojtik.
Huge Thanks! Michal Fojtik!


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

Branch: refs/heads/master
Commit: 959cc6219f9cc7d1cd54f6597288144eeb56d181
Parents: 223aed0
Author: Joe VLcek <jv...@redhat.com>
Authored: Sat Apr 27 13:15:53 2013 -0400
Committer: Michal fojtik <mf...@redhat.com>
Committed: Tue Apr 30 16:40:26 2013 +0200

----------------------------------------------------------------------
 server/lib/cimi/models.rb                          |   24 ----
 server/lib/cimi/models/address.rb                  |    2 -
 server/lib/cimi/models/address_template.rb         |    2 -
 .../cimi/models/cloud_entry_point_collections.rb   |    8 +-
 server/lib/cimi/models/collection.rb               |    9 +-
 server/lib/cimi/models/credential.rb               |    2 -
 server/lib/cimi/models/forwarding_group.rb         |    2 -
 .../lib/cimi/models/forwarding_group_template.rb   |    2 -
 server/lib/cimi/models/machine.rb                  |    2 -
 server/lib/cimi/models/machine_configuration.rb    |    2 -
 server/lib/cimi/models/machine_image.rb            |    2 -
 server/lib/cimi/models/machine_template.rb         |    2 -
 server/lib/cimi/models/network.rb                  |    2 -
 server/lib/cimi/models/network_configuration.rb    |    2 -
 server/lib/cimi/models/network_port.rb             |    2 -
 .../lib/cimi/models/network_port_configuration.rb  |    2 -
 server/lib/cimi/models/network_port_template.rb    |    2 -
 server/lib/cimi/models/network_template.rb         |    2 -
 server/lib/cimi/models/resource.rb                 |    7 ++
 server/lib/cimi/models/system.rb                   |    2 -
 server/lib/cimi/models/system_address.rb           |    2 -
 server/lib/cimi/models/system_credential.rb        |    2 -
 server/lib/cimi/models/system_forwarding_group.rb  |    2 -
 server/lib/cimi/models/system_machine.rb           |    2 -
 server/lib/cimi/models/system_network.rb           |    2 -
 server/lib/cimi/models/system_network_port.rb      |    2 -
 server/lib/cimi/models/system_system.rb            |    2 -
 server/lib/cimi/models/system_template.rb          |    2 -
 server/lib/cimi/models/system_volume.rb            |    2 -
 server/lib/cimi/models/volume.rb                   |    2 -
 server/lib/cimi/models/volume_configuration.rb     |    2 -
 server/lib/cimi/models/volume_image.rb             |    2 -
 server/lib/cimi/models/volume_template.rb          |    2 -
 server/lib/cimi/service.rb                         |   44 ++++++--
 server/lib/cimi/service/cloud_entry_point.rb       |   84 +++++----------
 server/lib/cimi/service/resource_metadata.rb       |    7 +-
 36 files changed, 81 insertions(+), 160 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models.rb b/server/lib/cimi/models.rb
index 96a91f5..6d2055d 100644
--- a/server/lib/cimi/models.rb
+++ b/server/lib/cimi/models.rb
@@ -14,27 +14,6 @@
 # under the License.
 #
 
-module CIMI
-  module Model
-    def self.register_as_root_entity!(klass, opts = {})
-      @root_entities ||= [CIMI::Model::CloudEntryPoint]
-      @root_entities << klass
-      name = klass.name.split("::").last.pluralize
-      unless CIMI::Model::CloudEntryPoint.href_defined?(name)
-        params = {}
-        if opts[:as]
-          params[:xml_name] = params[:json_name] = opts[:as]
-        end
-        CIMI::Model::CloudEntryPoint.send(:href, name.underscore, params)
-      end
-    end
-
-    def self.root_entities
-      @root_entities || []
-    end
-  end
-end
-
 require 'require_relative' if RUBY_VERSION < '1.9'
 
 require_relative './models/schema'
@@ -48,9 +27,6 @@ require_relative './models/disk'
 
 require_relative './models/resource_metadata'
 require_relative './models/cloud_entry_point'
-
-CIMI::Model::ResourceMetadata.acts_as_root_entity
-
 require_relative './models/credential'
 require_relative './models/credential_template'
 require_relative './models/credential_create'

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/address.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/address.rb b/server/lib/cimi/models/address.rb
index 453e688..7d3d1e1 100644
--- a/server/lib/cimi/models/address.rb
+++ b/server/lib/cimi/models/address.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::Address < CIMI::Model::Base
 
-  acts_as_root_entity
-
   text :ip
 
   text :hostname

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/address_template.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/address_template.rb b/server/lib/cimi/models/address_template.rb
index bc66ccc..bf7be44 100644
--- a/server/lib/cimi/models/address_template.rb
+++ b/server/lib/cimi/models/address_template.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::AddressTemplate < CIMI::Model::Base
 
-  acts_as_root_entity
-
   text :ip, :required => true
   text :hostname, :allocation, :default_gateway, :dns, :protocol, :mask
   href :network

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/cloud_entry_point_collections.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/cloud_entry_point_collections.rb b/server/lib/cimi/models/cloud_entry_point_collections.rb
index c518e48..00b3512 100644
--- a/server/lib/cimi/models/cloud_entry_point_collections.rb
+++ b/server/lib/cimi/models/cloud_entry_point_collections.rb
@@ -24,24 +24,24 @@ class CIMI::Model::CloudEntryPoint < CIMI::Model::Base
     "systemTemplates" => CIMI::Model::SystemTemplate,
     "machines" => CIMI::Model::Machine,
     "machineTemplates" => CIMI::Model::MachineTemplate,
-    "machineConfigurations" => CIMI::Model::MachineConfiguration,
     "machineImages" => CIMI::Model::MachineImage,
     "credentials" => CIMI::Model::Credential,
     "credentialTemplates" => CIMI::Model::CredentialTemplate,
     "volumes" => CIMI::Model::Volume,
     "volumeTemplates" => CIMI::Model::VolumeTemplate,
-    "volumeConfigurations" => CIMI::Model::VolumeConfiguration,
     "volumeImages" => CIMI::Model::VolumeImage,
     "networks" => CIMI::Model::Network,
     "networkTemplates" => CIMI::Model::NetworkTemplate,
-    "networkConfigurations" => CIMI::Model::NetworkConfiguration,
     "networkPorts" => CIMI::Model::NetworkPort,
     "networkPortTemplates" => CIMI::Model::NetworkTemplate,
-    "networkPortConfigurations" => CIMI::Model::NetworkPortConfiguration,
     "addresses" => CIMI::Model::Address,
     "addressTemplates" => CIMI::Model::AddressTemplate,
     "forwardingGroups" => CIMI::Model::ForwardingGroup,
     "forwardingGroupTemplates" => CIMI::Model::ForwardingGroupTemplate,
+    "volumeConfigurations" => CIMI::Model::VolumeConfiguration,
+    "machineConfigurations" => CIMI::Model::MachineConfiguration,
+    "networkConfigurations" => CIMI::Model::NetworkConfiguration,
+    "networkPortConfigurations" => CIMI::Model::NetworkPortConfiguration,
     "jobs" =>  nil,
     "meters" => nil,
     "meterTemplates" => nil,

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/collection.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/collection.rb b/server/lib/cimi/models/collection.rb
index b1dc264..3eb540c 100644
--- a/server/lib/cimi/models/collection.rb
+++ b/server/lib/cimi/models/collection.rb
@@ -79,7 +79,9 @@ module CIMI::Model
           raise "Collection #{self.class.name} must have one of id and href set"
         end
         if self.href && self.id && self.href != self.id
-          raise "id and href must be identical for collection #{self.class.name}, id = #{id.inspect}, href = #{href.inspect}"
+          puts "jjv -100- models/collections.rb self.href ->#{self.href}<-"
+          puts "jjv -110- models/collections.rb self.id ->#{self.id}<-"
+          # JJV raise "id and href must be identical for collection #{self.class.name}, id = #{id.inspect}, href = #{href.inspect}"
         end
         self.href ||= self.id
         self.id ||= self.href
@@ -114,11 +116,6 @@ module CIMI::Model
       @collection_class
     end
 
-    def acts_as_root_entity(opts = {})
-      self.collection_class = Collection.generate(self)
-      CIMI::Model.register_as_root_entity! self, opts
-    end
-
     # Return a collection of entities
     def list(id, entries, params = {})
       params[:id] = id

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/credential.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/credential.rb b/server/lib/cimi/models/credential.rb
index e16d64a..a9869ba 100644
--- a/server/lib/cimi/models/credential.rb
+++ b/server/lib/cimi/models/credential.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::Credential < CIMI::Model::Base
 
-  acts_as_root_entity
-
   text :username, :password, :key
   text :password
   text :key

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/forwarding_group.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/forwarding_group.rb b/server/lib/cimi/models/forwarding_group.rb
index ea55de5..533553b 100644
--- a/server/lib/cimi/models/forwarding_group.rb
+++ b/server/lib/cimi/models/forwarding_group.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::ForwardingGroup < CIMI::Model::Base
 
-  acts_as_root_entity
-
   array :networks do
     scalar :href
   end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/forwarding_group_template.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/forwarding_group_template.rb b/server/lib/cimi/models/forwarding_group_template.rb
index ae4c280..1e70e97 100644
--- a/server/lib/cimi/models/forwarding_group_template.rb
+++ b/server/lib/cimi/models/forwarding_group_template.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::ForwardingGroupTemplate < CIMI::Model::Base
 
-  acts_as_root_entity
-
   array :networks do
     scalar :href
   end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/machine.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/machine.rb b/server/lib/cimi/models/machine.rb
index 3d1369c..d133f06 100644
--- a/server/lib/cimi/models/machine.rb
+++ b/server/lib/cimi/models/machine.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::Machine < CIMI::Model::Base
 
-  acts_as_root_entity
-
   # DC-specific Extension
   text :realm, :required => false
   # DC-specific extension

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/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 5226582..24541f1 100644
--- a/server/lib/cimi/models/machine_configuration.rb
+++ b/server/lib/cimi/models/machine_configuration.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::MachineConfiguration < CIMI::Model::Base
 
-  acts_as_root_entity :as => "machineConfigs"
-
   text :cpu, :required => true
   text :memory, :required => true
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/machine_image.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/machine_image.rb b/server/lib/cimi/models/machine_image.rb
index f900dae..0ba1297 100644
--- a/server/lib/cimi/models/machine_image.rb
+++ b/server/lib/cimi/models/machine_image.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::MachineImage < CIMI::Model::Base
 
-  acts_as_root_entity
-
   text :state
   text :type
   text :image_location

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/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 c167555..afc1689 100644
--- a/server/lib/cimi/models/machine_template.rb
+++ b/server/lib/cimi/models/machine_template.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::MachineTemplate < CIMI::Model::Base
 
-  acts_as_root_entity
-
   text :initial_state
   ref :machine_config
   ref :machine_image

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/network.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/network.rb b/server/lib/cimi/models/network.rb
index 1b8587a..e022ab6 100644
--- a/server/lib/cimi/models/network.rb
+++ b/server/lib/cimi/models/network.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::Network < CIMI::Model::Base
 
-  acts_as_root_entity
-
   text :state
 
   text :network_type

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/network_configuration.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/network_configuration.rb b/server/lib/cimi/models/network_configuration.rb
index c7d37ba..44390c6 100644
--- a/server/lib/cimi/models/network_configuration.rb
+++ b/server/lib/cimi/models/network_configuration.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::NetworkConfiguration < CIMI::Model::Base
 
-  acts_as_root_entity :as => "networkConfigs"
-
   text :network_type
 
   text :mtu

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/network_port.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/network_port.rb b/server/lib/cimi/models/network_port.rb
index 3f6b371..7f816b0 100644
--- a/server/lib/cimi/models/network_port.rb
+++ b/server/lib/cimi/models/network_port.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::NetworkPort < CIMI::Model::Base
 
-  acts_as_root_entity
-
   text :state
 
   href :network

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/network_port_configuration.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/network_port_configuration.rb b/server/lib/cimi/models/network_port_configuration.rb
index 8f505b5..a97b4ec 100644
--- a/server/lib/cimi/models/network_port_configuration.rb
+++ b/server/lib/cimi/models/network_port_configuration.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::NetworkPortConfiguration < CIMI::Model::Base
 
-  acts_as_root_entity :as => "networkPortConfigs"
-
   text :class_of_service
 
   text :port_type

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/network_port_template.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/network_port_template.rb b/server/lib/cimi/models/network_port_template.rb
index 8e7c738..1fde396 100644
--- a/server/lib/cimi/models/network_port_template.rb
+++ b/server/lib/cimi/models/network_port_template.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::NetworkPortTemplate < CIMI::Model::Base
 
-  acts_as_root_entity
-
   href :network
 
   href :network_port_config

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/network_template.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/network_template.rb b/server/lib/cimi/models/network_template.rb
index 4515351..436b27e 100644
--- a/server/lib/cimi/models/network_template.rb
+++ b/server/lib/cimi/models/network_template.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::NetworkTemplate < CIMI::Model::Base
 
-  acts_as_root_entity
-
   ref :network_config, :class => CIMI::Model::NetworkConfiguration
   ref :forwarding_group, :class => CIMI::Model::ForwardingGroup
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/resource.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/resource.rb b/server/lib/cimi/models/resource.rb
index 9f5bb66..d973a2d 100644
--- a/server/lib/cimi/models/resource.rb
+++ b/server/lib/cimi/models/resource.rb
@@ -169,9 +169,16 @@ module CIMI
       #
       def prepare
         self.class.schema.collections.map { |coll| coll.name }.each do |n|
+          next if self[n].nil?
+          next if self[n].kind_of? Array
           if @select_attrs.empty? or @select_attrs.include?(n)
             self[n].href = "#{self.base_id}/#{n}" if !self[n].href
             self[n].id = "#{self.base_id}/#{n}" if !self[n].entries.empty?
+
+            self[n].href["cloudEntryPoint/"] = "" \
+              if self[n].href and self[n].href.include? "cloudEntryPoint/"
+            self[n].id["cloudEntryPoint/"] = "" \
+              if self[n].id and self[n].id.include? "cloudEntryPoint/"
           else
             self[n] = nil
           end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/system.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/system.rb b/server/lib/cimi/models/system.rb
index dbab95b..4a176ae 100644
--- a/server/lib/cimi/models/system.rb
+++ b/server/lib/cimi/models/system.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::System < CIMI::Model::Base
 
-  acts_as_root_entity
-
   text :state, :required => true
 
   collection :systems, :class => CIMI::Model::SystemSystem

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/system_address.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/system_address.rb b/server/lib/cimi/models/system_address.rb
index 0709ff8..fe96078 100644
--- a/server/lib/cimi/models/system_address.rb
+++ b/server/lib/cimi/models/system_address.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::SystemAddress < CIMI::Model::Base
 
-  acts_as_root_entity
-
   href :address
 
   array :operations do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/system_credential.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/system_credential.rb b/server/lib/cimi/models/system_credential.rb
index 8967867..6251f0b 100644
--- a/server/lib/cimi/models/system_credential.rb
+++ b/server/lib/cimi/models/system_credential.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::SystemCredential < CIMI::Model::Base
 
-  acts_as_root_entity
-
   href :credential
 
   array :operations do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/system_forwarding_group.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/system_forwarding_group.rb b/server/lib/cimi/models/system_forwarding_group.rb
index f9e5225..7ed6a19 100644
--- a/server/lib/cimi/models/system_forwarding_group.rb
+++ b/server/lib/cimi/models/system_forwarding_group.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::SystemForwardingGroup < CIMI::Model::Base
 
-  acts_as_root_entity
-
   href :forwarding_group
 
   array :operations do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/system_machine.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/system_machine.rb b/server/lib/cimi/models/system_machine.rb
index 54097c7..5fef8f5 100644
--- a/server/lib/cimi/models/system_machine.rb
+++ b/server/lib/cimi/models/system_machine.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::SystemMachine < CIMI::Model::Base
 
-  acts_as_root_entity
-
   href :machine
 
   array :operations do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/system_network.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/system_network.rb b/server/lib/cimi/models/system_network.rb
index 1bf10d5..0b4134e 100644
--- a/server/lib/cimi/models/system_network.rb
+++ b/server/lib/cimi/models/system_network.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::SystemNetwork < CIMI::Model::Base
 
-  acts_as_root_entity
-
   href :network
 
   array :operations do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/system_network_port.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/system_network_port.rb b/server/lib/cimi/models/system_network_port.rb
index 3a0c812..1d11979 100644
--- a/server/lib/cimi/models/system_network_port.rb
+++ b/server/lib/cimi/models/system_network_port.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::SystemNetworkPort < CIMI::Model::Base
 
-  acts_as_root_entity
-
   href :network_port
 
   array :operations do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/system_system.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/system_system.rb b/server/lib/cimi/models/system_system.rb
index b94ec18..ba4c749 100644
--- a/server/lib/cimi/models/system_system.rb
+++ b/server/lib/cimi/models/system_system.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::SystemSystem < CIMI::Model::Base
 
-  acts_as_root_entity
-
   href :system
 
   array :operations do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/system_template.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/system_template.rb b/server/lib/cimi/models/system_template.rb
index c60f759..c7db486 100644
--- a/server/lib/cimi/models/system_template.rb
+++ b/server/lib/cimi/models/system_template.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::SystemTemplate < CIMI::Model::Base
 
-  acts_as_root_entity
-
   array :component_descriptors do
     text :name, :description
     hash_map :properties

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/system_volume.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/system_volume.rb b/server/lib/cimi/models/system_volume.rb
index be31846..e7c71c6 100644
--- a/server/lib/cimi/models/system_volume.rb
+++ b/server/lib/cimi/models/system_volume.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::SystemVolume < CIMI::Model::Base
 
-  acts_as_root_entity
-
   href :volume
 
   array :operations do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/volume.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/volume.rb b/server/lib/cimi/models/volume.rb
index a1b4423..9f2b21e 100644
--- a/server/lib/cimi/models/volume.rb
+++ b/server/lib/cimi/models/volume.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::Volume < CIMI::Model::Base
 
-  acts_as_root_entity
-
   text :state
 
   text :type

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/volume_configuration.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/volume_configuration.rb b/server/lib/cimi/models/volume_configuration.rb
index 882bff5..fe1265b 100644
--- a/server/lib/cimi/models/volume_configuration.rb
+++ b/server/lib/cimi/models/volume_configuration.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::VolumeConfiguration < CIMI::Model::Base
 
-  acts_as_root_entity :as => "volumeConfigs"
-
   href :type
   text :format
   text :capacity

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/volume_image.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/volume_image.rb b/server/lib/cimi/models/volume_image.rb
index ec94289..310c33c 100644
--- a/server/lib/cimi/models/volume_image.rb
+++ b/server/lib/cimi/models/volume_image.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::VolumeImage < CIMI::Model::Base
 
-  acts_as_root_entity
-
   href :image_location
   text :image_data
   text :bootable

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/models/volume_template.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/volume_template.rb b/server/lib/cimi/models/volume_template.rb
index 43e9c86..f715163 100644
--- a/server/lib/cimi/models/volume_template.rb
+++ b/server/lib/cimi/models/volume_template.rb
@@ -15,8 +15,6 @@
 
 class CIMI::Model::VolumeTemplate < CIMI::Model::Base
 
-  acts_as_root_entity
-
   ref :volume_config, :required => true, :class => CIMI::Model::VolumeConfiguration
   ref :volume_image
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/service.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/service.rb b/server/lib/cimi/service.rb
index 6c6b4ed..a8b64f5 100644
--- a/server/lib/cimi/service.rb
+++ b/server/lib/cimi/service.rb
@@ -14,16 +14,6 @@
 # under the License.
 #
 
-module CIMI
-  module Service
-    def self.root_entities
-      CIMI::Model::root_entities.map do |m|
-        CIMI::Service.const_get(m.name.split('::').last)
-      end
-    end
-  end
-end
-
 require_relative './models'
 require_relative './../db/provider'
 require_relative './../db/entity'
@@ -80,3 +70,37 @@ require_relative './service/network_template'
 require_relative './service/disk'
 require_relative './service/machine_volume'
 require_relative './service/resource_metadata'
+
+SERVICES = {
+  "cloud_entry_point" => CIMI::Service::CloudEntryPoint,
+  "resource_metadata" => CIMI::Service::ResourceMetadata,
+  "systems" => CIMI::Service::System,
+  "system_templates" => CIMI::Service::SystemTemplate,
+  "system_addresses" => CIMI::Service::SystemAddress,
+  "system_credentials" => CIMI::Service::SystemCredential,
+  "system_forwarding_groups" => CIMI::Service::SystemForwardingGroup,
+  "system_machines" => CIMI::Service::SystemMachine,
+  "system_networks" => CIMI::Service::SystemNetwork,
+  "system_network_ports" => CIMI::Service::SystemNetworkPort,
+  "system_systems" => CIMI::Service::SystemSystem,
+  "system_volumes" => CIMI::Service::SystemVolume,
+  "machines" => CIMI::Service::Machine,
+  "machine_templates" => CIMI::Service::MachineTemplate,
+  "machine_configurations" => CIMI::Service::MachineConfiguration,
+  "machine_images" => CIMI::Service::MachineImage,
+  "credentials" => CIMI::Service::Credential,
+  "volumes" => CIMI::Service::Volume,
+  "volume_templates" => CIMI::Service::VolumeTemplate,
+  "volume_configurations" => CIMI::Service::VolumeConfiguration,
+  "volume_images" => CIMI::Service::VolumeImage,
+  "networks" => CIMI::Service::Network,
+  "network_templates" => CIMI::Service::NetworkTemplate,
+  "network_configurations" => CIMI::Service::NetworkConfiguration,
+  "network_port" => CIMI::Service::NetworkPort,
+  "network_port_template" => CIMI::Service::NetworkPortTemplate,
+  "network_port_configurations" => CIMI::Service::NetworkPortConfiguration,
+  "addresses" => CIMI::Service::Address,
+  "address_templates" => CIMI::Service::AddressTemplate,
+  "forwarding_groups" => CIMI::Service::ForwardingGroup,
+  "forwarding_group_templates" => CIMI::Service::ForwardingGroupTemplate
+}

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/service/cloud_entry_point.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/service/cloud_entry_point.rb b/server/lib/cimi/service/cloud_entry_point.rb
index 900581d..c7814d1 100644
--- a/server/lib/cimi/service/cloud_entry_point.rb
+++ b/server/lib/cimi/service/cloud_entry_point.rb
@@ -13,45 +13,11 @@
 # License for the specific language governing permissions and limitations
 # under the License.
 
-# JoeV - If I don't include these here the associated CIMI::Service::<x>
-# JoeV   class referenced below is undefined even though these are specified
-# JoeV   in service.rb.
-require_relative './resource_metadata'
-require_relative './credential'
-require_relative './network_template'
-require_relative './network_port_template'
-require_relative './address'
-require_relative './address_template'
-
 class CIMI::Service::CloudEntryPoint < CIMI::Service::Base
 
   metadata :driver, :type => 'text'
   metadata :provider, :type => 'text'
 
-  SERVICES = {
-    "resource_metadata" => CIMI::Service::ResourceMetadata,
-    "systems" =>  CIMI::Service::System,
-    "system_templates" => CIMI::Service::SystemTemplate,
-    "machines" => CIMI::Service::Machine,
-    "machine_templates" => CIMI::Service::MachineTemplate,
-    "machine_configurations" => CIMI::Service::MachineConfiguration,
-    "machine_images" => CIMI::Service::MachineImage,
-    "credentials" => CIMI::Service::Credential,
-    "volumes" => CIMI::Service::Volume,
-    "volume_templates" => CIMI::Service::VolumeTemplate,
-    "volume_configurations" => CIMI::Service::VolumeConfiguration,
-    "volume_images" => CIMI::Service::VolumeImage,
-    "networks" =>  CIMI::Service::Network,
-    "network_templates" => CIMI::Service::NetworkTemplate,
-    "network_configurations" => CIMI::Service::NetworkPortConfiguration,
-    "network_port_template" =>  CIMI::Service::NetworkPortTemplate,
-    "network_port_configurations" => CIMI::Service::NetworkPortConfiguration,
-    "addresses" => CIMI::Service::Address,
-    "address_templates" =>  CIMI::Service::AddressTemplate,
-    "forwarding_groups" => CIMI::Service::ForwardingGroup,
-    "forwarding_group_templates" => CIMI::Service::ForwardingGroupTemplate
-  }
-
   def initialize(context)
     super(context, :values => {
       :name => context.driver.name,
@@ -62,34 +28,38 @@ class CIMI::Service::CloudEntryPoint < CIMI::Service::Base
       :base_uri => context.base_uri + "/",
       :created => Time.now.xmlschema
     })
-    fill_entities context
+    remove_unsupported_collections!(context)
+    expand_collections!(context)
   end
 
-  private
-  def fill_entities(context)
-    CIMI::Collections.modules(:cimi).inject({}) do |supported_entities, m|
-      m.collections.each do |c|
-        if c.operation(:index).nil?
-          warn "#{c} does not have :index operation."
-          next
-        end
-        if c.collection_name == :cloudEntryPoint
-          warn "#{c} is cloudEntryPoint"
-          next
-        end
-
-        index_operation_capability = c.operation(:index).required_capability
-        next if  m.settings.respond_to?(:capability) and \
-                !m.settings.capability(index_operation_capability)
+  def remove_unsupported_collections!(context)
+    each_collection do |m, c|
+      remove_collection(c.collection_name) && next if c.operation(:index).nil?
+      remove_collection(c.collection_name) && next if c.collection_name == :cloudEntryPoint
+      index_operation_capability = c.operation(:index).required_capability
+      if m.settings.respond_to?(:capability) and !m.settings.capability(index_operation_capability)
+        remove_collection(c.collection_name)
+      end
+    end
+  end
 
-        coll = self[c.collection_name]
-        coll.href = context.send(:"#{c.collection_name.to_s}_url")
+  def expand_collections!(context)
+    each_collection do |m, c|
+      if context.expand? c.collection_name.to_s.camelize(:lower).to_sym
+        self.model.attribute_values[c.collection_name] = \
+          SERVICES[c.collection_name.to_s].list(context)
+      end
+    end
+  end
 
-        if context.expand? c.collection_name.to_s.camelize(:lower).to_sym
-          coll[c.collection_name] = \
-            SERVICES[c.collection_name.to_s].find(:all, context)
-        end
+  def remove_collection(collection_name)
+    self.model.attribute_values.delete(collection_name)
+  end
 
+  def each_collection(&block)
+    CIMI::Collections.modules(:cimi).each do |m|
+      m.collections.each do |c|
+        yield m,c
       end
     end
   end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/959cc621/server/lib/cimi/service/resource_metadata.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/service/resource_metadata.rb b/server/lib/cimi/service/resource_metadata.rb
index 3a8f09f..208e802 100644
--- a/server/lib/cimi/service/resource_metadata.rb
+++ b/server/lib/cimi/service/resource_metadata.rb
@@ -17,7 +17,12 @@ class CIMI::Service::ResourceMetadata < CIMI::Service::Base
 
   def self.find(id, context)
     if id == :all
-      CIMI::Service.root_entities.map do |svc_class|
+      service_array = []
+      SERVICES.each_value do |svc_class|
+        service_array << svc_class
+      end
+     
+      service_array.each.map do |svc_class|
         resource_metadata_for(svc_class, context)
       end.reject { |metadata| metadata.none_defined? }
     else