Sha256: 918cb5cebb2d8b6717e559cbcd5f2f5e2bc8efa2224b17947990056403d6aa3b

Contents?: true

Size: 860 Bytes

Versions: 32

Compression:

Stored size: 860 Bytes

Contents

require 'fog/ecloud/models/compute/environment'

module Fog
  module Compute
    class Ecloud

      class Environments < Fog::Ecloud::Collection

        model Fog::Compute::Ecloud::Environment

        undef_method :create

        identity :href

        def all
          data = []
          service.get_organization(href).body[:Locations][:Location].each do |d|
            if d[:Environments][:Environment].is_a?(Array)
              d[:Environments][:Environment].each { |e| data << e }
            else
              data << d[:Environments][:Environment]
            end
          end
          load(data)
        end

        def get(uri)
          if data = service.get_environment(uri)
            new(data.body)
          end
        rescue Fog::Errors::NotFound
          nil
        end

        Vdcs = Environments

      end
    end
  end
end

Version data entries

32 entries across 32 versions & 6 rubygems

Version Path
fog-maestrodev-1.18.0.20131114200144 lib/fog/ecloud/models/compute/environments.rb
gapinc-fog-1.12.1.2.1 lib/fog/ecloud/models/compute/environments.rb
fog-maestrodev-1.18.0.20131112185232 lib/fog/ecloud/models/compute/environments.rb
fog-maestrodev-1.18.0.20131111203459 lib/fog/ecloud/models/compute/environments.rb
fog-1.18.0 lib/fog/ecloud/models/compute/environments.rb
fog-1.17.0 lib/fog/ecloud/models/compute/environments.rb
fog-1.16.0 lib/fog/ecloud/models/compute/environments.rb
fog-maestrodev-1.15.0.20130927082724 lib/fog/ecloud/models/compute/environments.rb
fog-maestrodev-1.15.0.20130829165835 lib/fog/ecloud/models/compute/environments.rb
fog-1.15.0 lib/fog/ecloud/models/compute/environments.rb
gapinc-fog-1.14.0 lib/fog/ecloud/models/compute/environments.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/ecloud/models/compute/environments.rb
fog-1.14.0 lib/fog/ecloud/models/compute/environments.rb
fog-1.13.0 lib/fog/ecloud/models/compute/environments.rb
gapinc-fog-1.12.1.2 lib/fog/ecloud/models/compute/environments.rb
gapinc-fog-1.12.1.1 lib/fog/ecloud/models/compute/environments.rb
gapinc-fog-1.12.1a lib/fog/ecloud/models/compute/environments.rb
gapinc-fog-1.12.1 lib/fog/ecloud/models/compute/environments.rb
fog-1.12.1 lib/fog/ecloud/models/compute/environments.rb
fog-1.12.0 lib/fog/ecloud/models/compute/environments.rb