Sha256: 268fb533b2615de0882295cbecb62fcbe3d3150d6d0c4684acc22c3190f88392

Contents?: true

Size: 926 Bytes

Versions: 17

Compression:

Stored size: 926 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|
            environments = d[:Environments]
            next unless environments
            if environments[:Environment].is_a?(Array)
              environments[:Environment].each { |e| data << e }
            else
              data << 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

17 entries across 17 versions & 5 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/ecloud/models/compute/environments.rb
fog-ecloud-0.0.2 lib/fog/ecloud/models/compute/environments.rb
fog-ecloud-0.0.1 lib/fog/ecloud/models/compute/environments.rb
fog-1.25.0 lib/fog/ecloud/models/compute/environments.rb
nsidc-fog-1.24.1 lib/fog/ecloud/models/compute/environments.rb
fog-1.24.0 lib/fog/ecloud/models/compute/environments.rb
ns-fog-1.22.11 lib/fog/ecloud/models/compute/environments.rb
ns-fog-1.22.10 lib/fog/ecloud/models/compute/environments.rb
ns-fog-1.22.9 lib/fog/ecloud/models/compute/environments.rb
ns-fog-1.22.8 lib/fog/ecloud/models/compute/environments.rb
ns-fog-1.22.7 lib/fog/ecloud/models/compute/environments.rb
ns-fog-1.22.6 lib/fog/ecloud/models/compute/environments.rb
fog-1.23.0 lib/fog/ecloud/models/compute/environments.rb
ns-fog-1.22.4 lib/fog/ecloud/models/compute/environments.rb
ns-fog-1.22.3 lib/fog/ecloud/models/compute/environments.rb
ns-fog-1.22.2 lib/fog/ecloud/models/compute/environments.rb
fog-1.22.1 lib/fog/ecloud/models/compute/environments.rb