Sha256: e1f9d2b79919f4d69b0b7f0f69fa796a182c413902f319cb2d9f9a4c7582a3ac

Contents?: true

Size: 609 Bytes

Versions: 4

Compression:

Stored size: 609 Bytes

Contents

module Ironfan
  class Dsl

    class Cluster < Ironfan::Dsl::Compute
      collection :facets,       Ironfan::Dsl::Facet,   :resolver => :deep_resolve

      def initialize(attrs={},&block)
        super
        self.cluster_role       Ironfan::Dsl::Role.new(:name => "#{attrs[:name]}_cluster")
      end

      # Utility method to reference all servers from constituent facets
      def servers
        result = Gorillib::ModelCollection.new(:item_type => Ironfan::Dsl::Server, :key_method => :fullname)
        facets.each {|f| f.servers.each {|s| result << s} }
        result
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ironfan-4.3.0 lib/ironfan/dsl/cluster.rb
ironfan-4.2.3 lib/ironfan/dsl/cluster.rb
ironfan-4.2.2 lib/ironfan/dsl/cluster.rb
ironfan-4.2.1 lib/ironfan/dsl/cluster.rb